---
title: "How to Convert Prometheus Histograms to OTLP with the OpenTelemetry Collector"
url: https://daily.dev/posts/how-to-convert-prometheus-histograms-to-otlp-with-the-opentelemetry-collector-eeyizafgb
source_url: https://www.freecodecamp.org/news/how-to-convert-prometheus-histogramsotlp-with-the-opentelemetry-collector
type: article
source: "freeCodeCamp"
published: 2026-08-24T16:57:17.965Z
updated: 2026-08-24T16:57:41.376Z
tags: ["observability", "opentelemetry", "prometheus", "fastapi"]
reading_time: 9
upvotes: 1
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Convert Prometheus Histograms to OTLP with the OpenTelemetry Collector

**[freeCodeCamp](https://daily.dev/sources/freecodecamp)** · 9 min read · 1 upvotes · 0 comments

## Summary

A step-by-step guide walks through converting Prometheus histogram metrics into the OpenTelemetry OTLP format using the OpenTelemetry Collector. Using a sample FastAPI payment application exposing a payment_transaction_duration_seconds histogram, it covers configuring the Prometheus receiver to scrape metrics, how the Collector maps Prometheus _bucket/_sum/_count series into the OpenTelemetry Histogram data model, setting up the OTLP exporter with TLS, wiring the full pipeline, and verifying delivery to SigNoz Cloud with troubleshooting tips.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.freecodecamp.org/news/how-to-convert-prometheus-histogramsotlp-with-the-opentelemetry-collector>

## Questions this post answers

### How does the OpenTelemetry Collector convert Prometheus histogram metrics into OTLP format?

The Prometheus receiver scrapes the three separate Prometheus histogram series (_bucket, _sum, _count) and maps them into a single OpenTelemetry Histogram data model containing the count, sum, explicit bucket boundaries, and bucket counts, which is then exported via the OTLP exporter to an observability backend like SigNoz, preserving the full latency distribution instead of collapsing it into an average.

_daily.dev surfaces guides like this for engineers wiring Prometheus metrics into OTLP-based observability stacks._

### What Prometheus receiver configuration is needed to scrape a /metrics endpoint with the OpenTelemetry Collector?

Define a prometheus receiver block with a scrape_configs entry specifying a job_name, scrape_interval (commonly 15s), and static_configs targets pointing to the host:port serving /metrics, for example targets: ["payment-api:8080"]. Shorter intervals catch transient issues but risk overloading the service, while longer intervals may miss short-lived latency spikes.

_Engineers tuning scrape intervals for high-throughput services can find similar configuration walkthroughs on daily.dev._

### Why do Prometheus histograms show more information than a simple average metric?

Histograms record how many observations fall into each latency bucket, revealing the full distribution rather than a single number. For example, if most requests complete in 50ms but 5% take over 2 seconds, an average of 150ms hides that serious performance issue, while the bucketed histogram exposes the outliers so slow database queries or overloaded services can be investigated.

_daily.dev helps engineers debugging latency distributions keep up with observability and metrics practices._

## Similar posts on daily.dev

- [How Prometheus Exporters Work With OpenTelemetry](https://daily.dev/posts/how-prometheus-exporters-work-with-opentelemetry-hxjdcu2qr) · Last9 · 4 upvotes · 0 comments
- [Prometheus and OpenTelemetry finally play nice](https://daily.dev/posts/prometheus-and-opentelemetry-finally-play-nice-2lupjc8qw) · The New Stack · 0 upvotes · 0 comments

---

Tags: [#observability](https://daily.dev/tags/observability), [#opentelemetry](https://daily.dev/tags/opentelemetry), [#prometheus](https://daily.dev/tags/prometheus), [#fastapi](https://daily.dev/tags/fastapi)

[View this post on daily.dev](https://daily.dev/posts/how-to-convert-prometheus-histograms-to-otlp-with-the-opentelemetry-collector-eeyizafgb)
