Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/observe-and-act/send-data/alloy/collect/prometheus-native-histograms.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/observe-and-act/send-data/alloy/collect/prometheus-native-histograms/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Collect Prometheus native histograms
Prometheus native histograms need configuration on both the scrape side and the write side. If only one side is enabled, samples are silently dropped or never requested from the target.
This topic shows a minimal end-to-end pipeline that:
- Scrapes native histograms with
prometheus.scrape - Forwards them with
prometheus.remote_write
Components used in this topic
Before you begin
- A scrape target that exposes native histograms over the Prometheus Protobuf format.
- A remote endpoint that accepts native histograms, for example Grafana Mimir or Grafana Cloud Metrics with native histograms enabled.
Configure delivery
Native histogram samples only leave Alloy when send_native_histograms is true on the remote write endpoint:
prometheus.remote_write "mimir" {
endpoint {
url = "https://mimir.example.com/api/v1/push"
send_native_histograms = true
}
}Without send_native_histograms = true, classic metrics still flow, but native histogram samples are not sent.
Configure scraping
Native histograms are negotiated through the Prometheus Protobuf exposition format.
Set scrape_native_histograms = true and put PrometheusProto first in scrape_protocols:
prometheus.scrape "app" {
targets = [
{"__address__" = "app.default.svc.cluster.local:8080"},
]
scrape_native_histograms = true
scrape_protocols = [
"PrometheusProto",
"OpenMetricsText1.0.0",
"OpenMetricsText0.0.1",
"PrometheusText1.0.0",
"PrometheusText0.0.4",
]
forward_to = [prometheus.remote_write.mimir.receiver]
}When scrape_native_histograms is true, Alloy already defaults scrape_protocols to start with PrometheusProto. Setting the list explicitly makes the requirement obvious in the config.
Full example
prometheus.remote_write "mimir" {
endpoint {
url = "https://mimir.example.com/api/v1/push"
send_native_histograms = true
}
}
prometheus.scrape "app" {
targets = [
{"__address__" = "app.default.svc.cluster.local:8080"},
]
scrape_native_histograms = true
scrape_protocols = [
"PrometheusProto",
"OpenMetricsText1.0.0",
"OpenMetricsText0.0.1",
"PrometheusText1.0.0",
"PrometheusText0.0.4",
]
forward_to = [prometheus.remote_write.mimir.receiver]
}Checklist
| Component | Setting | Why |
|---|---|---|
prometheus.scrape | scrape_native_histograms = true | Request native histograms from the target |
prometheus.scrape | scrape_protocols starts with PrometheusProto | Native histograms use the Protobuf exposition format |
prometheus.remote_write endpoint | send_native_histograms = true | Forward native histogram samples to the backend |
Other pipeline components such as prometheus.relabel do not need extra flags for native histograms.
Related
Was this page helpful?
Related resources from Grafana Labs


