Jul 29th, 2023

Ingest OpenTelemetry metrics with Prometheus natively

Native support for OpenTelemetry metrics in Prometheus

OTLP metrics ingestion support in Prometheus

Contents

OpenTelemetry and Prometheus are two critical projects in the monitoring and observability world. Prometheus supports metrics monitoring, and OpenTelemetry also allows metrics besides logs and traces.

The semantic convention for metrics in OpenTelemetry(OTLP metrics) does not align with Prometheus' native metrics naming convention.

To address this disparity, there is a module in otel-collector-contrib that offers centralized functions that facilitate the conversion of OpenTelemetry metrics into metrics compliant with Prometheus.

This package translates and maps metric names, units, and labels between the OpenTelemetry and Prometheus conventions. This translation allows sending OTLP metrics to Prometheus using an OpenTelemetry collector. But the native support for ingesting OTLP metrics was absent in Prometheus.

Native support for OpenTelemetry metrics in Prometheus

Send metrics to Prometheus via Otel Collector
Send metrics to Prometheus via Otel Collector.

Recently a pull request by Goutham - Prometheus maintainer and Product Manager at Grafana Labs, was merged in the Prometheus codebase, which adds support for ingesting OpenTelmetry metrics using a new OTLP-compatible ingestion endpoint.

"🚀 Prometheus is integrating OpenTelemetry natively, starting with the next release. 🎉 The initial pull request has been merged, paving the way for a combined pull-based model and OTLP metrics, so no matter how you generate your metrics, we get you covered. 📈" said Prometheus maintainer Julien Pivotto.

A new feature flag otlp-write-receiver has been added, enabling the feature for natively ingesting OpenTelemetry metrics.

The OpenTelemetry metrics can be sent on /otlp/v1/metrics the endpoint and ingested natively.

This change is still experimental, and before the final release, a lot of documentation updates will also happen; I will update this post with the changes and add the final Prometheus release version in which this change will be present!

There is already a discussion in Cortex issue tracker of reusing this capability.

Check out the HackerNews discussion on this post.

I had given a talk at Conf42 Devops 2024 on "The complete handbook to OpenTelemetry Metrics" where I discussed about Prometheus and OpenTelemetry Metrics in more details.

Check the video below:

Once you're ingesting OpenTelemetry metrics into Prometheus, you'll want to query them effectively. These guides will help:

💡
Stay in the loop about the latest developments in the realm of OpenTelemetry and Prometheus by subscribing to our blog. Receive regular updates and stay informed!
About the authors
Prathamesh Sonpatki

Prathamesh Sonpatki

Prathamesh works as an evangelist at Last9, runs SRE stories - where SRE and DevOps folks share their stories, and maintains o11y.wiki - a glossary of all terms related to observability.

Last9 keyboard illustration

Start observing for free. No lock-in.

OPENTELEMETRY • PROMETHEUS

Just update your config. Start seeing data on Last9 in seconds.

DATADOG • NEW RELIC • OTHERS

We've got you covered. Bring over your dashboards & alerts in one click.

BUILT ON OPEN STANDARDS

100+ integrations. OTel native, works with your existing stack.

Gartner Cool Vendor 2025 Gartner Cool Vendor 2025
High Performer High Performer
Best Usability Best Usability
Highest User Adoption Highest User Adoption