All Products
Search
Document Center

Application Real-Time Monitoring Service:OpenTelemetry endpoints for data reporting

Last Updated:Mar 11, 2026

Managed Service for Prometheus accepts OpenTelemetry metrics through OTLP/HTTP endpoints. Configure your OpenTelemetry SDK or Collector to export metrics to these endpoints, then query and visualize the data in Grafana.

Before you begin

Create a Prometheus instance for your environment:

Limits

  • Protocol: Only HTTP is supported. gRPC is not supported.

  • Serialization: Configure the application/protobuf serialization method for the Content-Encoding header. The application/json serialization method is not supported.

  • Unsupported metric types: Histogram(delta) and Exponential Histogram are not supported. Use Histogram(cumulative) instead.

Supported regions

RegionRegion ID
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
Singaporeap-southeast-1

OpenTelemetry-to-Prometheus metric type mapping

When Managed Service for Prometheus ingests OpenTelemetry metrics, it maps them to Prometheus metric types as follows:

OpenTelemetryPrometheus
Sum (monotonic, cumulative)Counter
Sum (monotonic, delta)Gauge
Sum (non-monotonic, cumulative)Gauge
GaugeGauge
Histogram (cumulative)Histogram
Histogram (delta)Not supported
Exponential HistogramNot supported
SummarySummary

Step 1: Get the OpenTelemetry endpoint

  1. Log on to the ARMS console.

  2. In the left navigation pane, choose Managed Service for Prometheus > Instances.

  3. In the top navigation bar, select the region of your Prometheus instance, find the instance, and click Settings in the Actions column.

  4. On the Settings page, copy the endpoint URL. Choose the endpoint based on your network environment:

    • Public endpoint: Use this when your application accesses Managed Service for Prometheus over the internet.

    • Internal endpoint: Use this when your application runs within the same Alibaba Cloud region and connects through the internal network.

Step 2: Configure your OpenTelemetry exporter

Configure your OpenTelemetry metric exporter to send data to the endpoint from Step 1.

Configure with environment variables (all languages)

Set the standard OpenTelemetry environment variables to configure the exporter for any language SDK or the OpenTelemetry Collector:

# Required: Set the OTLP endpoint from Step 1
export OTEL_EXPORTER_OTLP_ENDPOINT=<your-opentelemetry-endpoint>

# Required: Use HTTP/protobuf protocol (gRPC is not supported)
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf

# Recommended: Enable gzip compression to reduce network usage
export OTEL_EXPORTER_OTLP_COMPRESSION=gzip

Replace <your-opentelemetry-endpoint> with the endpoint URL copied from the ARMS console in Step 1.

Configure with the Java SDK

Replace the endpoint in OtlpHttpMetricExporterBuilder with the endpoint from Step 1:

import io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter;

OtlpHttpMetricExporter exporter = OtlpHttpMetricExporter.builder()
    .setEndpoint("<your-opentelemetry-endpoint>")  // Endpoint from Step 1
    .setCompression("gzip")                         // Recommended: reduce network usage
    .build();

For a complete, runnable example, see the sample code on GitHub.

Optional parameters

ParameterRequirementDescription
CompressionRecommendedSet to gzip to reduce network consumption. Disabled by default.
metricNamespaceOptionalAdd a prefix to all metric names when reporting to Managed Service for Prometheus. Set this through a custom header.
skipGlobalLabelOptionalSet to true through a custom header to prevent Managed Service for Prometheus from attaching default OpenTelemetry scope labels to your metrics.

To configure metricNamespace and skipGlobalLabel, add them as custom HTTP headers in your exporter configuration. For implementation details, see the sample code.

Step 3: Verify metrics in Grafana

After your application starts sending metrics, verify the data is arriving by querying it in Grafana.

  1. Log on to the ARMS console. In the left-side navigation pane, choose Managed Service for Grafana > Workspace Management.

  2. On the Workspace Management page, click Grafana shared edition. On the Workspace Information page, select a public endpoint and click Log On.

  3. In the left-side navigation pane of Grafana, click the Explore icon.

  4. In the data source dropdown at the top of the Explore page, select the Prometheus instance that corresponds to the endpoint you configured in Step 1.

    Important

    Select your Prometheus instance as the data source, not a different data source.

  5. Enter a PromQL query to search for your metrics. For example, if your application exports a metric named http_requests_total, type http_requests_total in the query editor and click Run query.