All posts

OpenTelemetry and Prometheus: Using Them Together

Observability
June 2, 2025

Introduction: Why OpenTelemetry + Prometheus?

In the world of observability, metrics are table stakes. But managing the firehose of telemetry data from microservices, containers, and distributed systems? That’s where tools like OpenTelemetry and Prometheus become mission-critical.

This guide walks you through how to use the OpenTelemetry Collector to gather metrics and forward them to Prometheus. It's built for DevOps engineers who need reliable, vendor-neutral telemetry pipelines and want to harness Prometheus' power without reinventing the wheel.

What is OpenTelemetry?

OpenTelemetry (OTel) is a CNCF project that standardizes the collection of observability data (metrics, logs, and traces) across your services. It includes APIs, SDKs, and a crucial component: the OpenTelemetry Collector, which helps manage, process, and export telemetry data without vendor lock-in.

What is Prometheus?

Prometheus is an open-source monitoring and alerting system, known for its pull-based metrics collection, PromQL query language, and integration with Kubernetes. It stores time-series data and is the go-to solution for infrastructure monitoring.

How Do OpenTelemetry and Prometheus Work Together?

While Prometheus natively scrapes metrics from instrumented endpoints, integrating it with OpenTelemetry allows you to:

  • Standardize how metrics are generated across languages.
  • Centralize processing and routing through the OTel Collector.
  • Push enriched or filtered metrics into Prometheus for storage and analysis.

This integration is ideal for teams moving toward a more flexible, scalable telemetry architecture.

Integrating OpenTelemetry Collector with Prometheus

‍

Configure Prometheus to Scrape OTel Collector

Edit your prometheus.yml to scrape the collector:


‍ Restart Prometheus and check the targets page to ensure it can scrape the metrics.

Install OpenTelemetry Collector

Use a pre-built binary or container image.

‍

Create an OpenTelemetry Collector Configuration

You'll need a config file (otel-config.yaml) to receive OTLP data and export metrics in Prometheus format.

‍

This config sets up the collector to:

  • Receive OTLP metrics over gRPC and HTTP.
  • Batch process them.
  • Export metrics on a Prometheus-compatible /metrics endpoint.

Instrument Your Code with OTel SDK

For example, in Go:

‍

This code pushes metrics to your running collector, which then exposes them to Prometheus.

Smarter Telemetry Management with Sawmills

While OpenTelemetry and Prometheus offer flexibility and transparency, managing high-volume telemetry pipelines gets complex fast. That’s where Sawmills smart telemetry platform comes in.

With Sawmills, you can:

  • Visualize data flows: Explore and audit what telemetry is being collected and where it's going.
  • Optimize metrics: Drop high-cardinality labels, enforce log formats, and prevent data bloat before Prometheus ingests it.
  • Automate policies: Apply real-time policies like sampling or routing with one-click actions in the Telemetry Explorer.
  • Manage compliance: Block PII, standardize formats, and prevent data overages with policy-driven pipelines.

You get AI-powered insights that identify inefficiencies and recommend optimizations—automatically.

Conclusion

Combining OpenTelemetry Collector with Prometheus unlocks a more standardized and powerful observability pipeline. With this setup:

  • Metrics are decoupled from specific backends.
  • You gain a consistent approach across services and languages.
  • Prometheus remains your reliable, fast, and flexible metrics store.

Looking to scale beyond basic setup? Sawmills can help you bring control, cost-efficiency, and clarity to your telemetry chaos. Schedule a demo today.

‍

‍