OpenTelemetry Prometheus Exporter

Export OpenTelemetry metrics in Prometheus format so Prometheus can scrape your Python application.

Library
PyPI
v0.66b0
2,649 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
93 /100 Excellent
Development Activity 96
Maintenance 96
Community 80
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 84
Code Quality 82
Innovation 70
Learning Curve 76

opentelemetry-exporter-prometheus is the official OpenTelemetry Python exporter that bridges the OpenTelemetry metrics SDK to Prometheus. It converts OTel metric instruments (counters, up-down counters, gauges, and histograms) into Prometheus-format samples and exposes them for scraping via the standard prometheus_client library.

It plugs into the OpenTelemetry metrics pipeline as a MetricReader, so instrumentation written against the vendor-neutral OpenTelemetry API can be surfaced to a Prometheus server without changing application code. This lets teams standardize on OpenTelemetry instrumentation while keeping Prometheus as their metrics backend.

What You Get

  • A PrometheusMetricReader that collects OpenTelemetry metrics for Prometheus scraping
  • Mapping of OTel counters, up-down counters, gauges, and histograms to Prometheus metric types
  • Integration with the prometheus_client library’s HTTP exposition
  • An opentelemetry_metrics_exporter entry point for auto-configuration
  • Correct handling of OTel attributes as Prometheus labels

Common Use Cases

  • Exposing OpenTelemetry-instrumented application metrics to an existing Prometheus deployment
  • Standardizing on vendor-neutral OTel instrumentation while keeping Prometheus as the metrics backend
  • Scraping counters, gauges, and histograms from a Python service via a /metrics endpoint

Under The Hood

Architecture - The package lives in the opentelemetry-python monorepo at exporter/opentelemetry-exporter-prometheus and is deliberately small. src/opentelemetry/exporter/prometheus/__init__.py defines the PrometheusMetricReader (and an internal _AutoPrometheusMetricReader used by the auto-configuration entry point), which subclasses the OTel SDK MetricReader and, on collection, translates the SDK’s in-memory metric data into a Prometheus registry. _mapping.py holds the logic that maps OTel instrument types and attribute sets onto Prometheus metric names, types, and labels, delegating exposition to the prometheus_client Collector interface.

Tech Stack - Pure Python (3.10+), built with hatchling. It depends on opentelemetry-api and opentelemetry-sdk for the metrics pipeline and on prometheus_client (>=0.5.0) for Prometheus-format serialization and HTTP exposition.

Code Quality - The exporter ships a focused test suite — test_prometheus_exporter, test_mapping, and test_entrypoints — verifying instrument translation, label mapping, and auto-configuration wiring. As part of the CNCF OpenTelemetry project it follows that repo’s rigorous CI, linting, and review standards; it is marked Beta, with a documented limitation around multiprocessing environments.

API Design - Usage is idiomatic OpenTelemetry: construct a PrometheusMetricReader, pass it to a MeterProvider, and start the prometheus_client HTTP server — no exporter-specific glue is needed. The opentelemetry_metrics_exporter entry point enables fully zero-code setup under OTel auto-instrumentation. Familiarity with the OpenTelemetry metrics model is the main prerequisite, which sets a moderate learning curve.

Used by 94 apps in this directory

Python
67%
Apache 2.0

Agent Control

AI Agents

314

An open-source runtime control plane for AI agents — define safety guardrails once, apply them across agents built on LangChain, CrewAI, Google ADK, or AWS Strands, and update controls without redeploying code.

View details
74
Repo Health
71
Technical
67
Dependency
Built with
Python 67%
TypeScript 32%
Updated 5 days ago
Python
67%
Apache 2.0

Agent Control

AI Agents

314

An open-source runtime control plane for AI agents — define safety guardrails once, apply them across agents built on LangChain, CrewAI, Google ADK, or AWS Strands, and update controls without redeploying code.

View details
74
Repo Health
71
Technical
67
Dependency
Built with
Python 67%
TypeScript 32%
Updated 5 days ago
Python
99%
MIT

Agent Lightning

AI Development

18,515

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
85
Repo Health
68
Technical
69
Dependency
Built with
Python 99%
Updated 5 days ago
Python
99%
MIT

Agent Lightning

AI Development

18,515

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
85
Repo Health
68
Technical
69
Dependency
Built with
Python 99%
Updated 5 days ago
TypeScript
56%
Other

agenta

AI Development · Developer Tools · Devops

4,788

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript 56%
Python 39%
Updated 6 days ago
TypeScript
56%
Other

agenta

AI Development · Developer Tools · Devops

4,788

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript 56%
Python 39%
Updated 6 days ago
TypeScript
56%
Other

agenta

AI Development · Developer Tools · Devops

4,788

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript 56%
Python 39%
Updated 6 days ago
Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,358

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 5 days ago
Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,358

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers