Alibaba Cloud Managed Service for Prometheus provides OpenTelemetry endpoints for you to import OpenTelemetry metrics of your application and use Grafana to obtain monitoring data. This way, you can efficiently monitor and manage the performance and health of the application.
Usage notes
OpenTelemetry metrics can only be reported over HTTP. gRPC is not supported.
When you use HTTP to report data, configure the default application/protobuf serialization method for the Content-Encoding header. The application/json serialization method is not supported.
The following table describes the mapping relationships between the OpenTelemetry metric model and the Prometheus metric model.
OpenTelemetry
Prometheus
Sum(monotonic & cumulative)
Counter
Sum(monotonic & delta)
Gauge
Sum(none-monotonic & cumulative)
Gauge
Gauge
Gauge
Histogram(cumulative)
Histogram
Histogram(delta)
Not supported
Exponential Histogram
Not supported
Summary
Summary
The following table lists the regions that support OpenTelemetry endpoints.
Geographical area
Region name
Region ID
Regions in China
China (Hangzhou)
cn-hangzhou
China (Shanghai)
cn-shanghai
China (Shenzhen)
cn-shenzhen
China (Heyuan)
cn-heyuan
China (Guangzhou)
cn-guangzhou
China (Qingdao)
cn-qingdao
China (Beijing)
cn-beijing
China (Zhangjiakou)
cn-zhangjiakou
China (Hohhot)
cn-huhehaote
China (Ulanqab)
cn-wulanchabu
China (Chengdu)
cn-chengdu
China (Hong Kong)
cn-hongkong
Regions outside China
Singapore
ap-southeast-1
Prerequisites
A Prometheus instance is created. For more information, see the following topics:
Step 1: Obtain an OpenTelemetry endpoint
Log on to the ARMS console.
In the left-side navigation pane, choose .
In the top navigation bar of the Instances page, select a region, find your Prometheus instance, and click Settings in the Actions column.
On the Settings page, copy the public or internal OpenTelemetry endpoint based on your business requirements.
Step 2: Modify the Endpoint parameter of your application
Take a Java application as an example. You need to replace the Endpoint parameter in OtlpHttpMetricExporterBuilder with the OpenTelemetry endpoint obtained in Step 1 to import the OpenTelemetry metrics of the application to Managed Service for Prometheus. For more information, see Sample code.
You also need to configure the following parameters:
By default, compression is disabled for OpenTelemetry clients. We recommend that you set the
Compression
parameter togzip
to reduce network consumption.If you want to add prefixes to all metrics when you report OpenTelemetry metrics to Managed Service for Prometheus, you can configure a set of headers and set the
metricNamespace
parameter.After OpenTelemetry metrics are reported to Managed Service for Prometheus, OpenTelemtery scope labels are attached to all metrics by default. You can configure a group of
headers
and set the skipGlobalLabel parameter totrue
, so that Managed Service for Prometheus does not add the default scope labels when it processes the received metrics.
For more information about how to configure the preceding parameters, see Sample code.
Step 3: View monitoring data in Grafana
Log on to the ARMS console. In the left-side navigation pane, choose .
On the Workspace Management page, click Grafana shared edition. On the Workspace Information page, select a public endpoint and click Log On.
In the left-side navigation pane, click . On the right side of the Explore page, select a data source.
ImportantSelect the Prometheus instance as the data source.