Prometheus native histograms

Prometheus native histograms store latency and size distributions in one structure instead of many fixed bucket series. This page explains when that change is worth planning, what it touches, and how to roll it out safely.

On this page

When Prometheus native histograms are worth planning for your latency metrics

Native histograms are a Prometheus histogram type that carries its bucket layout inside each sample, so a team does not have to fix bucket boundaries before instrumenting a service. Plan for them when your latency or size histograms are hard to bucket well, when one metric must serve both coarse dashboards and detailed percentile analysis, or when classic bucket series are driving storage and cardinality costs that nobody can fully explain. If your dashboards depend on hand-written histogram_quantile expressions over _bucket series, the change reaches far beyond the metric definition, so the decision belongs in the design phase. This section treats native histograms as an adoption path. It explains how to decide, what to check and who does the work.

Start with an inventory. List the histograms that drive latency SLOs, capacity planning and alerts, and note which instrumentation library produces each one. Then check which client libraries in your estate can expose native histograms and which of your services still expose only classic buckets. A mixed fleet is the normal case during transition, so the platform team should know early which services will keep classic histograms for longer. Record the Prometheus release line you run now and the one you plan to run. Your current long-term support line is 3.13, which receives bug fixes until July 31, 2027, according to the Prometheus release cycle page. Confirm in the Prometheus documentation and release notes for that line whether native histograms are enabled by default, which flags control them and how each release handles them.

Next, test the path end to end on one metric before any fleet-wide decision. Scrape the target with native histograms enabled, confirm what your remote write receiver and long-term storage accept, and check how federation, recording rules and alerting rules evaluate the new samples. Compare storage and query behavior against the classic histogram in your own environment, because the effect depends on your label sets, scrape interval and retention. Rewrite a small set of dashboards and alert rules that read the metric, then have the service owners review the results. Dashboard and alert migration usually takes more effort than the instrumentation change, so budget the review time explicitly.

When you request a quote, ask the partner to separate one-time work from recurring work. One-time work includes the inventory, the pilot, the rewrite of selected dashboards and rules, and the runbook for the transition. Recurring work includes upgrades to new release lines, support for dual formats during the transition and review of storage growth as more services move. Ask which items are fixed in a written scope and which depend on your environment, such as the number of services and the state of your remote write receiver. Those answers determine whether you should staff this internally or bring in a partner for a fixed-scope pilot.

What changes from classic bucketed histograms

Classic histograms are exposed as a family of series: one series per bucket boundary, each carrying an le label, plus a sum series and a count series. The application declares the boundaries when the metric is defined, and the client library writes every bucket out on each scrape. Native histograms carry the whole bucket structure inside a single histogram sample per series. Support for each form depends on the client library, its version and the scrape protocol in use, so confirm all three before changing instrumentation.

  • Classic form: _bucket series with le labels, plus _sum and _count, served in the text exposition format.
  • Native form: one histogram sample per series, which Prometheus can only ingest when the scrape negotiates the protobuf exposition format.
  • Dual exposition: some libraries can publish both forms for the same metric during a migration. Confirm whether your library supports this and in which version.
  • Code changes: moving to native usually means changing the declared metric type and its options, so instrumentation is part of the work.
  • Scrape configuration: the scrape settings for each job determine whether native samples are accepted.

Check your client library's changelog and the Prometheus scrape documentation for your version before assuming a metric is native.

Which configuration choices to settle before rollout

This table lists the configuration decisions that shape a native histogram rollout and, for each one, when the option fits and what to confirm in the official documentation for your chosen Prometheus version. Read it before changing any scrape or remote write settings, because several choices affect what your storage and dashboards receive. Treat the right-hand column as the checklist for the design review.

DecisionWhen the option fitsWhat to confirm in the docs for your version
Classic buckets alongside native histogramsKeep both during transition when dashboards, alerts or SLO reports still depend on classic bucket series and must stay comparableWhether the client library exposes both representations at once and how the scrape side handles the combined output
Scrape protocol negotiationUse when targets can serve native histograms and the scrape config must accept that format without breaking classic-only targetsWhich scrape protocols the server negotiates by default, the fallback order, and which settings must be allowed in the scrape config
Remote write receiver and destination supportChoose when samples leave the server for long-term or central storage and the receiving system must accept native histogram samplesWhether the receiver and remote write protocol version accept native histograms, and whether any intermediate agent or gateway drops them
Retention and storage sizing assumptionsRevisit when you plan retention by time or size and expect histogram series to change the volume of data writtenHow the storage docs describe block and retention behavior for your version, and how to measure real ingestion before setting limits
Recording rules and alerting expressionsMigrate first when recording rules or alerts use classic bucket series with histogram_quantileWhich PromQL functions accept native histograms in your version, and where classic-only expressions need rewriting or parallel evaluation
Dashboard and query migrationPlan when Grafana panels, saved queries and SLO reports read classic bucket names directlyHow your Grafana version queries native histograms, and whether panels should be validated against both representations before cutover

How to roll out native histograms without breaking dashboards

This sequence moves a monitoring estate from classic bucketed histograms to native histograms in stages, so dashboards, alert rules and recording rules keep returning comparable results at every checkpoint. Each step closes with a check you can run, and the rollout ends only when no consumer you own still reads the classic series.

  1. Inventory histogram metrics and their consumers

    Your platform team lists every classic histogram exposed by your applications and exporters, then searches recording rules, alert rules, dashboards and API clients for queries that reference the _bucket, _sum and _count series. Record the owner of each consumer and the label sets they depend on. The step is done when every histogram has a named owner and a list of the queries that read it, so no consumer is discovered after the cutover.

  2. Pick a Prometheus release on a supported line

    Platform engineering selects a Prometheus release on a line that still receives bug fixes. Minor releases generally stop receiving fixes after six weeks, while long-term support lines receive fixes for one year. The current LTS line is 3.13, supported until July 31, 2027. Read the release notes for native histogram behavior, required settings and any changes to scrape or remote write, then record the version in your change plan. The step is done when the chosen version and its support end date are approved.

  3. Enable native histograms in a test environment

    In a non-production environment, your team turns on native histogram support using the setting documented for the chosen release and configures the target applications or client libraries to expose native histograms. Confirm the exposed format by querying the test server directly and checking that the native series arrive alongside the classic ones without scrape errors. The step is done when a sample histogram returns a native representation and the scrape health for those targets stays green.

  4. Dual-run classic and native series

    Keep classic histograms exposed while native histograms are enabled, so both forms are collected for the same targets over the same period. Compare query results for the same latency or size question, for example a quantile over a fixed window, using the classic buckets and the native histogram functions. Investigate any difference that exceeds your tolerance and document why it exists. The step is done when the owners of each consumer sign off that the results agree within the tolerance they set.

  5. Update remote write and long-term storage

    If Prometheus sends samples to external storage through remote write, confirm that the receiving system accepts native histograms and that the sending configuration carries them without dropping or converting them unexpectedly. Check ingestion on the storage side by querying a native histogram series there and comparing its value with the local server for the same time range. Confirm that retention on the remote system meets your requirements before continuing. The step is done when a sample matches on both sides.

  6. Migrate recording rules and dashboards

    Rewrite recording rules and dashboard panels to use native histogram functions, one consumer at a time, starting with the least critical. Keep the classic version of each panel available until the new one is verified. Grafana panels and alert expressions should be tested against the same time range in both versions and checked for label and unit consistency. The step is done when every consumer on the inventory list returns matching results in its native form and the owners approve the change.

  7. Retire classic series

    Once no consumer reads the classic series, stop exposing them from the applications and remove the classic-only recording rules and panels. Watch alert evaluation, dashboard load and remote storage ingestion for a period agreed with the owners, and confirm that no query errors reference missing _bucket series. Keep the inventory and comparison results as evidence of the change. The step is done when the classic series are no longer collected and the monitoring checks stay healthy with only native histograms in place.

How to rewrite PromQL queries and dashboards for native histograms

Rewriting queries for native histograms starts with an inventory, not with edits. Classic histograms expose a family of bucket series with an le label, and most latency and size queries depend on that shape: they select the bucket series, aggregate across the le label and pass the result to histogram_quantile. Native histograms store each sample as a single histogram value, so the bucket-series pattern no longer applies to them. The expressions that use them need different functions and aggregation patterns. Before changing anything, list every place where a classic histogram is read, because a query that still targets bucket series will often return empty results rather than an obvious error, and that failure can stay hidden until someone looks at a dashboard during an incident.

Start with alerting rules, recording rules and Grafana panels, and treat each one as a separate audit item. For alerts, record the expression, the threshold, the for duration, the labels that routing depends on and the Alertmanager receiver it reaches. For recording rules, note which downstream rules and alerts consume the output series, since a rewritten recording rule changes every consumer. For Grafana panels, capture the data source, the query, any transformations, legend formats and template variables that depend on the le label. Panels that compute percentiles from bucket series are the most likely to break silently. Ask your team to confirm which dashboards are used in on-call runbooks, because those have the least tolerance for a changed number.

Once the inventory exists, build a mapping table from each old expression to its new equivalent. Each row should name the source rule or panel, the old query, the new query, the owner who approved the change and the reason for any difference in label sets or output units. Keep the mapping in version control next to the rule files so changes are reviewed the same way as other configuration. Where a classic query combines several histograms or uses rate over bucket series and then sums, write the new version as a separate step and do not assume a one-to-one substitution. Illustrative only: a row might show a classic percentile query on the left and the native histogram equivalent on the right, with a note on the label set that changes. Confirm each mapping against the current Prometheus documentation for the version you run.

Verify each rewritten expression by comparing old and new results over a shared time window. Choose a window that includes normal traffic and at least one period of elevated load, and evaluate the classic and native expressions at the same timestamps while both histogram forms are being ingested. Compare the percentile values, the rate or count values and the series counts returned. Expect small numeric differences, because bucket interpolation and native bucket boundaries are not identical, and decide in advance what difference is acceptable for each alert threshold. A difference that flips an alert across its threshold needs a review, not a tolerance adjustment. Record the comparison results with the mapping table so the decision to cut over has evidence behind it.

The main risk is an incomplete audit. Dashboards nobody maintains, ad hoc queries in Explore and external tools that read the Prometheus API can all depend on classic bucket series, and none of them appear in the rule files. Plan a retention period for the classic series during the transition so those consumers keep working, and ask the team to confirm how long old dashboards will remain in use. Keep a rollback path for each rule group, so a rewritten expression can be reverted without restoring the whole configuration. Ownership matters too: name one person to approve each cutover, and make sure on-call engineers know which panels changed and how to read them.

What native histograms do to storage, remote write and retention

Native histograms change what each series carries, so the storage path you already run needs a check before you enable them. The cards below cover local storage, remote write, retention and sizing, and the questions to settle with your remote storage vendor first.

Local storage layout

Prometheus writes its local time series database in two-hour blocks, backed by a write-ahead log. A native histogram is stored as a single series rather than one series per bucket, so the number of series you hold can fall even as each sample carries more data. Check how your sample volume and head block memory change in a staging instance before you roll the change out to production.

Single-node local storage

Local storage is not clustered or replicated, so one Prometheus server holds the only copy of its local data. A disk failure or a lost volume means losing the recent history held locally. Plan backups, snapshot handling and recovery for the server itself, and treat the local database as you would any other single-node database.

Remote write to long-term storage

Remote write sends samples to external systems for long-term storage and querying. Native histogram samples must be accepted end to end, from the sender through the receiver and any gateway in between. Confirm with the remote storage vendor whether it accepts native histogram samples, which versions and protocol settings it requires, and how its costs scale with sample volume and series count.

Remote write queue and failure handling

Remote write buffers samples in queues on the sending server, so a slow or unreachable receiver builds a backlog. Test how much backlog your server can hold during an outage and what happens to histogram samples the receiver rejects. Decide how you will monitor the queue and alert on rejected samples before enabling native histograms on the remote path.

Retention by time or size

The default local retention is 15 days, and you can set it by time, by size, or by both. Native histograms can change how fast the local database grows, so a retention value that worked for classic histograms may no longer fit your disk. Measure growth after enabling native histograms and adjust the limit before the disk fills.

Sizing the local disk

Disk sizing depends on sample rate, series count, sample size and retention together. Native histograms change the sample size and series count, so an old sizing estimate is not reliable. Run a representative load for long enough to see a full retention cycle, and ask your vendor or team which sizing method they used before relying on the result.

Which client libraries and exporters emit native histograms

Support for native histograms depends on two things that vary independently: the instrumentation client library in each application and the exporter or application version that serves the metric. A service written in one language may emit native histograms after a library upgrade while a sibling service in another language still emits only classic buckets. The practical rule is that native histogram support is confirmed per service and per version, never assumed across the estate. Before you change any scrape or remote write configuration, make that confirmation the first task on the page.

Start with an inventory. List every language runtime that produces histograms, the client library and version each service uses, and every exporter that bridges a third-party system into Prometheus, such as database, network or hardware exporters. For each entry, record whether the histogram it exposes is native, classic only, or both. Confirm this against the library's own documentation and a live scrape of a test instance, not against memory or a general claim. Owners of each service should sign off the inventory, because the people who ship the code usually know which library version is pinned.

Expect a long period where both formats coexist. Some services will emit classic buckets only, some will expose both, and some will expose only native histograms. Dashboards, recording rules and alerts written against classic bucket series (the _bucket suffixed series with le labels) will return different results or nothing once a service switches. Decide early whether a service keeps dual exposure during transition, which lets queries be migrated on their own schedule, or switches outright with coordinated query changes. Dual exposure increases series count and scrape payload for that service, so the decision should be recorded alongside the inventory.

Plan for mixed formats in the query layer as well. A single panel that compares latency across two services can silently mix a native series with a classic series if both are selected by the same metric name. Identify queries that aggregate across services of different types and mark them for review. Where a service's format changes, verify that the new series still carry the labels your alert routing and ownership model depend on, and confirm that retention and remote write targets accept the new series type. Treat each format change as a change to a monitored system, with a rollback path and a named owner.

Keep the check repeatable. Library and exporter versions change with routine dependency updates, so a one-time inventory goes stale quickly. Add a recurring review, tied to your release process, that re-checks format support for each service after its dependencies change. Ask your implementation partner, and the library maintainers where needed, to confirm the exact behavior for each language and version in your estate before rollout. Where a version is not documented clearly enough to decide, test it in a non-production environment and record the result as evidence.

Security and operational checks before turning native histograms on

Native histograms change what scrapers, remote write receivers and dashboards must handle, so the rollout touches more of the estate than a typical metric change. The checks below cover the security posture each new path inherits and the operational steps that let you reverse a change.

TLS and client certificates

Scrape targets, remote write receivers and any reverse proxy in front of them should use TLS. Prometheus supports TLS and client certificate authentication, with TLS 1.2 as the minimum version. Client certificates let each side verify the other. Before enabling native histograms, list every scrape and remote write endpoint that will carry the new samples, confirm each certificate chain and expiry date, and check the minimum TLS version each receiver accepts.

Basic authentication only over TLS

Prometheus supports HTTP basic authentication with bcrypt-hashed passwords. The hash protects the stored secret, but credentials sent without TLS travel in cleartext, so the hash does not protect the traffic. Before rollout, confirm that every endpoint using basic authentication terminates TLS, and that the password entries in your web configuration file are bcrypt hashes, not plain text.

Keep admin APIs disabled

Prometheus disables its admin HTTP APIs by default. The --web.enable-admin-api flag enables destructive operations such as deleting series, and --web.enable-lifecycle enables reload and shutdown endpoints. Histogram rollouts often involve configuration reloads, so keep both flags off in production unless a runbook requires them, and document who may enable them during a maintenance window.

Exporter URL parameters as open proxies

Exporters such as SNMP and Blackbox take their targets from URL parameters. Anyone with HTTP access to these exporters can make them send requests to arbitrary endpoints. Restrict network access to exporter ports, limit which Prometheus servers can call them, and review scrape configurations that pass target parameters, so that new histogram-producing jobs do not widen that reach.

Plan upgrades on a supported line

A new Prometheus minor release begins every 6 weeks, and a minor release generally stops receiving bug fixes after those 6 weeks. Long-term support releases receive bug fixes for one year. The current LTS line is 3.13, supported until July 31, 2027. Choose the release line you will run before enabling native histograms, and confirm that your client libraries and downstream receivers support that version.

Roll back configuration changes

Keep Prometheus configuration, recording rules and alert rules in version control, and record the last known good revision before each change. Validate files with promtool before reloading, and confirm that reverting the file restores earlier scrape and remote write behavior. Ask your vendor or the upstream documentation how an older Prometheus version reads data written in the new histogram format.

What to confirm in your environment before committing

Before you commit to native histograms, verify the behavior you need instead of assuming it. Start with the release and client libraries. Confirm that the Prometheus version you plan to run, and the instrumentation library in each service, both expose native histogram support and that the feature is enabled by default or by the flag your team expects. Check which versions of each library your services actually run, because mixed fleets often expose classic buckets from some services and native histograms from others. Ask the library maintainers, or read their release notes, rather than relying on a general statement that native histograms are supported.

Next, confirm that every tool reading your metrics understands native histograms. Dashboards, alerting pipelines, recording rules, long-term storage and federation each sit on a different code path. For each one, run a test query against a native histogram series and compare the result with the same measurement from a classic histogram. Pay particular attention to remote write receivers and any federation hop, since a component that silently drops or converts histogram samples will produce data that looks plausible but is wrong. Where a downstream product does not document native histogram support, treat that as an open question and test it, then confirm the result with the vendor. DeployOpen can run these tests, but it does not guarantee third-party compatibility.

Then measure how cardinality and sizing change in your own data. Native histograms reduce the number of series per histogram metric, but each sample carries a larger structure, so the net effect on storage, memory and query cost depends on your bucket layouts and label sets. Take a representative sample of your histogram metrics, count their series and label combinations before and after a trial, and compare ingestion rate, head block memory and query latency on your heaviest dashboards. Do not extrapolate from a small lab run to production label counts without checking both.

Finally, read the Prometheus documentation for the limits that apply to your use case and record them in your decision. The project states that it values reliability over precision and is not a good choice where 100% accuracy is required, such as per-request billing. Histogram quantiles are estimates, and a native histogram changes how those estimates are built, so any financial or contractual measurement needs a different system of record. Confirm also which features of the native format are still changing in the release you choose, and plan an explicit review point before each upgrade so that the decision is revisited against current documentation rather than the version you tested.

What buyers ask before hiring help with native histograms

How much does it cost to move Prometheus to native histograms?

Prometheus has no license fee and no paid edition, so the cost comes from four places: infrastructure, storage, implementation work and the people who run the platform. Implementation is the main one-time cost. It covers the scrape and remote write changes, dashboard and rule rewrites, and testing. Infrastructure, storage and operations time recur after go-live. The main cost drivers are the size of your estate, the number of histogram metrics, the dashboards and recording or alerting rules that query them, any changes to remote storage, and how much testing your change process requires. Ask for a quote that separates one-time work from recurring costs and shows the effort for each driver.

How long does a native histogram migration take?

The duration depends on the scope, so it is set in the written scope after an assessment of your environment, not guessed in advance. Confirm the timeline against these drivers: how many histogram families you run, how many dashboards and rules read them, how many downstream consumers receive remote write, which client library versions your services use, and how many test and change windows your organization requires. A phased plan that starts with one service or one cluster lets you measure the real effort before committing to the full estate. Ask for milestones with clear exit criteria for each phase.

What does our team need to provide for native histogram work?

Your team provides the context that only you hold. That includes an inventory of histogram metrics and the services that emit them, access to Prometheus configuration, dashboards, rules and Grafana, and named owners for each dashboard and alert. You also need test environments that resemble production, a change approval process, and time from the people who run remote storage and any downstream systems. Someone on your side should own decisions about label changes and retention. Without these inputs, the assessment and the testing stages take longer and the quote carries more uncertainty.

Can an in-house team migrate to native histograms without outside help?

Yes, an in-house team can do the work if it has Prometheus operating experience, time to learn the PromQL changes, and capacity for testing. Prometheus is open source under Apache-2.0, and its documentation is public. The harder parts are rewriting queries that depend on classic bucket series, confirming that every remote write consumer handles the new data, and sizing storage on realistic series counts. Many teams start with a pilot on one service to judge the effort. Outside help is most useful when the estate is large, when several teams depend on the same dashboards, or when the work must fit a fixed change schedule.

What does a quote for native histogram work depend on?

A quote follows from the written scope, so the inputs matter more than any standard rate. Expect the quote to depend on the number of Prometheus servers and clusters, the number of histogram metrics, the dashboards and recording or alerting rules to rewrite, the remote storage backend and its support for the new data, the client library versions in each service, the testing and rollback requirements, and any support after go-live. DeployOpen does not publish a price list. Ask for a quote that lists each assumption, the items excluded from scope, and what would change the price if the inventory differs from what was assumed.

Will native histograms change storage use on our Prometheus servers?

Storage use changes with the shape of your data, so measure it on a test server with representative series counts and scrape intervals before sizing production. Prometheus stores data in a local time series database made of two-hour blocks, with a write-ahead log and a default retention of 15 days that you can configure by time or size. Local storage is not clustered or replicated, so it should be managed like any single-node database, with backups and a plan for long-term storage through remote write. Confirm the effect on retention and disk I/O in your environment, and include the change in capacity planning and the recurring storage cost.

What should we check in our Prometheus setup before scoping native histograms?

Start with the version and support status of each Prometheus server, because minor releases generally stop receiving bug fixes about six weeks after release, while long-term support lines receive fixes for one year. Confirm that the current LTS line, 3.13, is supported until July 31, 2027, and plan the migration against a version you can keep patched. Then inventory scrape configurations, client libraries and exporters, dashboards and rules that use histogram bucket series, remote write configurations and their receivers, and Alertmanager routing. Record which teams own each item. This inventory is the main input to the scope and the quote.

How DeployOpen scopes and delivers a native histogram rollout

DeployOpen plans and implements Prometheus in infrastructure you control, including the changes native histograms require across scraping, remote write, client libraries, storage and queries. Engagements are fixed-scope, with the scope, deliverables and timeline agreed in writing before work starts.

How we scope

  • Inventory every histogram metric, its client library and its current bucket layout before deciding what changes
  • Confirm whether your Prometheus version and scrape path accept native histograms, and which components need upgrades first
  • Map the PromQL queries, recording rules, alerts and dashboards that reference classic _bucket series
  • Record the written scope, deliverables and timeline before any configuration changes begin

How we build

  • Enable native histogram scraping on a test Prometheus and validate samples against a known workload
  • Configure remote write and any downstream long-term storage so native histogram samples are accepted and queried correctly
  • Rewrite affected PromQL queries and dashboards, and test them against both classic and native data during a parallel run
  • Review storage growth and retention settings with the team before rolling the change to production

How we hand over

  • Deliver the configuration, rewritten queries, dashboards and rules in version control with a short change record
  • Document which client libraries, exporters and remote write receivers were verified, and which still need confirmation
  • Walk your operators through the query differences, known gaps and the rollback procedure for the histogram change
  • Provide a checklist for future histogram metrics so new services follow the same pattern

How we support

  • Offer ongoing support, upgrades and monitoring of the rollout as a retainer, if your team wants continued help
  • Plan follow-up reviews when Prometheus releases change native histogram behavior, using the release notes as the reference point
  • Keep the parallel-run comparison available for a defined period so regressions in latency dashboards are caught early
  • Confirm the support model, response expectations and upgrade cadence in the written agreement before work begins

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.