Prometheus native histograms

Native histograms store latency and size distributions as sparse, exponential-bucket data instead of many fixed `_bucket` series. This page covers what changes, what to enable, and what to confirm before you migrate.

On this page

Why teams consider Prometheus native histograms

Native histograms are a Prometheus histogram type that stores a distribution as a single sparse structure instead of a fixed set of _bucket time series, one per boundary, plus _sum and _count. A team should evaluate them when its estate has many classic histograms for latency or request size, series counts keep climbing as bucket boundaries multiply across services and label combinations, and percentile queries using histogram_quantile are slow or expensive on dashboards and in alert rules. The first decision is whether the problem is histogram cost at all, so start by counting _bucket series per metric and identifying which histograms drive most of the growth.

The Prometheus overview describes the project as valuing reliability over precision, and it is not a good choice where 100% accuracy is required, such as per-request billing. Native histograms do not change that stance. They change how distributions are stored and queried, so a team should treat them as a way to keep percentile estimates useful at lower series cost, not as an exact record of every observation. Any SLO or alert that depends on a percentile should be reviewed with that trade-off in mind, and the people who own those alerts should agree on it before any rule is rewritten.

Feature support depends on the Prometheus server version, the client library in each service, and the scrape and storage settings in use, so the feature set is not uniform across an estate. Before planning a rollout, confirm in the release notes of the server you run whether native histograms are enabled by default, what experimental or feature-flag steps apply, and which client libraries in your language stack emit them. Your team should also confirm that every component that reads these metrics, including dashboards, recording rules and any remote write receiver, handles the new type. Record the result per environment so the evaluation rests on your own versions rather than general claims.

What changes from classic bucketed histograms

A classic histogram spreads one measurement across many series, and every query, dashboard and alert is written against that shape. A native histogram stores the distribution as one sparse sample, so the changes reach the data model, bucket design, PromQL and the client code that emits the metric. Check each one against the Prometheus server and client library versions you run before you change anything.

Data model: one sample instead of many

A classic histogram writes a _bucket series for every bucket boundary, plus _sum and _count. A native histogram writes one sparse histogram sample per observation window, so series count drops and the number of bucket series no longer drives storage. Teams lose the ability to read individual le label values directly. Confirm how your server version exposes native histograms in scrapes and remote write before you plan dashboards around the new shape.

Bucket layout and selection

Classic histograms need bucket boundaries chosen in advance in client code, and a wrong guess loses resolution at the latency that matters. Native histograms use an exponential bucket schema, so the resolution is set by a schema value rather than by hand-picked boundaries. Review the schema and any bucket limits your client library exposes, because they control accuracy and memory use. Record the chosen values in your metric standards so teams do not diverge.

Query shape in PromQL

Most classic quantile queries use histogram_quantile over rate of _bucket series grouped by le. Native histograms are queried through the same histogram functions, but the metric name no longer carries a _bucket suffix and the le grouping step disappears. Rewrite alert rules and recording rules together with dashboards, and test each one against recent data, because a query that still names _bucket will return nothing. Confirm the exact function behavior for your Prometheus version in the PromQL documentation.

Client library emission

Native histograms only exist if the instrumented application emits them. Client libraries differ in whether they expose native histograms by default, whether they keep classic buckets alongside, and which configuration keys switch the mode on. Ask each team which library and version they use, then confirm the emission options in that library's release notes. Mixed fleets that emit both forms need a clear plan for which metric names dashboards read.

What teams give up and gain

Teams give up code that reads individual le labels, bucket-based SLO queries written by hand, and some tooling that only understands classic buckets. They gain lower series counts, finer resolution without fixed boundaries, and fewer bucket series to manage per metric. Inventory every consumer of the histogram, including alert rules, exporters and external dashboards, before you switch, since the gains do not help a consumer that cannot read the new format.

Configuration options and when each fits

This table compares three ways to adopt native histograms: keeping classic histograms only, running both during a transition, or moving a subset of latency metrics first. Read each row as a setting or component that must line up across the client, scrape, remote write and storage path, and check exact flag and config key names in the Prometheus release notes for your version.

OptionWhen it fitsWhat it affectsWhat to confirm first
Classic histograms onlyDashboards, alerts and recording rules are tied to _bucket series, and no receiver in your path accepts native histograms yetNo change to scrape, remote write or storage. Bucket boundaries stay fixed in client code, and percentile accuracy depends on bucket choiceWhether any remote write receiver or long-term store in your path handles native histogram samples
Classic and native side by sideTeams need a transition period and existing alerts must keep firing while new queries are validatedClient exposes both formats, so series count and scrape size grow. Queries and dashboards need a clear owner for each metricWhether your client library can emit both formats, and the exact scrape setting that accepts native histograms in your version
Native histograms on a subset of latency metricsA few high-traffic services with clear latency SLOs are the first candidates, and rollback is simpleLimits blast radius on storage, query cost and dashboards. Rewritten PromQL covers only the selected metricsWhich services change first, and the query and alert rules that must be rewritten before cutover
Scrape-side acceptance settingAny target exposing native histograms, so Prometheus ingests them instead of dropping themGoverns what the scraper accepts from targets. Without it, native histogram samples are not stored locallyThe scrape protocol and feature flag names in the release notes for your Prometheus version
Remote write settingsA central store receives samples from this Prometheus, so native histograms must be sent, not only stored locallyControls whether histogram payloads leave the server. Older remote write configurations may drop or convert themThe remote write protocol version your receiver supports and the config keys that enable native histogram sending
Receiver storage supportLong-term storage or a central receiver must keep native histograms for queries and retentionDetermines whether historical native data is queryable, and how retention and downsampling apply to itNative histogram support in your receiver's current release and how it handles queries over mixed formats
Client library emissionServices already use a supported client library that can emit native histograms in its current releaseChanges what each service exposes, bucket schema and series naming. Requires redeploying each serviceLanguage-specific support status and any experimental flags in each client library's documentation
Keep bucket definitions for existing alertsAlerts or SLO burn-rate rules depend on specific bucket boundaries that native histograms do not reproduce one for onePreserves alert behavior during migration, at the cost of keeping classic series alive longerWhich alert rules reference le labels, and whether they need a rewrite before the classic series is removed

Where classic and native histogram samples must both be accepted on the way to queries

The path starts in the application, where the client library exposes a histogram on a scrape endpoint. Prometheus scrapes it into its local TSDB, then remote write forwards samples across a network trust boundary to long-term storage. Grafana runs PromQL against either store. Check that every hop accepts both classic bucket series and native histogram samples, and that the network hop to the remote receiver is encrypted and authenticated, since remote write carries the same data outside the Prometheus server.

Classic and native histogram samples must pass each hop, and the remote write link crosses a trust boundary.

How to enable native histograms step by step

This sequence takes a team from checking version compatibility to a staged rollout of native histograms, with a verification check at each step so that nothing reaches production unverified. Each step produces evidence that the previous one worked.

  1. Confirm server and client library versions

    Before changing anything, the platform owner checks which Prometheus server version is running and which client library version each service uses. Read the release notes for both to confirm that native histogram support exists in those exact versions and to note any experimental status or known limitations. Record the versions in your change ticket. This step is done when every server and client version in scope has been matched against its release notes and the gaps are listed, with owners assigned to close them.

  2. Enable the feature in a non-production server

    Turn on the native histogram feature on a non-production Prometheus instance using the feature flag and configuration keys named in the official documentation for the version you run. Do not copy flag names from blog posts or older guides, since they change between releases. Restart or reload the server as the documentation describes. This step is done when the server starts cleanly, the flag appears in the runtime flags page or configuration output, and the target list shows no new scrape errors.

  3. Instrument one latency metric and confirm storage

    Choose one latency histogram in a single non-production service and configure its client library to expose a native histogram alongside or instead of the classic buckets, following that library's documentation. Let Prometheus scrape it, then query the metric name in the expression browser. Confirm the series returns a native histogram value rather than only _bucket series. This step is done when a query on the metric returns a native sample and the series is visible in the TSDB status or head statistics.

  4. Verify remote write receivers accept the format

    If Prometheus forwards samples to long-term storage, check with that receiver's documentation whether it accepts native histograms in the remote write format your server sends. Send the test metric through the pipeline, then query the receiver directly for the same series. Watch the Prometheus remote write metrics for failed or dropped samples. This step is done when the receiver returns the series with its histogram data intact and the remote write failure counters stay flat during a sample window.

  5. Check dashboards and alert rules still return results

    Run each dashboard panel and alert rule that depends on the instrumented metric against the test server. Classic queries that use _bucket series with histogram_quantile may return nothing for a native-only metric, so compare results with the same time range on the classic metric. Rewrite affected PromQL using the native histogram functions described in the documentation for your version, then confirm each rule evaluates without errors. This step is done when every panel and rule has been reviewed, each one shows expected values, and the rewritten expressions are recorded in version control.

  6. Roll out native histograms service by service

    Enable the client library change and the matching dashboard and rule updates one service at a time, starting with services that have low impact if a problem appears. Keep the classic histogram where other consumers still depend on it until they are migrated. Check each service after its change for scrape success, series counts and query results. This step is done when each service in the rollout list has passed the same checks as the test instance, and the owners of dependent dashboards and alerts have confirmed their views still work.

  7. Review storage and query effects after rollout

    After the services run for a period, review the Prometheus TSDB size, head series count and query latency for the instrumented metrics against the numbers you recorded before the change. Native histograms change how samples are stored and queried, so compare the storage footprint with the classic baseline rather than assuming a result. Document any dashboards that are slow and tune them. This step is done when the team has a written comparison of storage and query behavior, and any exceptions have a recorded owner and next action.

Rewriting PromQL queries and dashboards for native histograms

Queries that use rate on _bucket series with histogram_quantile must be reviewed before native histograms go live, and most of them will need rewriting. A native histogram is a single series rather than a set of series with an le label, so expressions that select _bucket series, group by le, or depend on bucket boundaries will return nothing or the wrong shape once the metric changes. Alert rules and recording rules that reference le need the same review, because a recording rule that writes bucketed output can silently stop producing data. Start by building an inventory: export every dashboard definition and every rule file, search them for _bucket, le and histogram_quantile, and record which metric each expression depends on and who owns it.

Run old and new queries side by side before cutting anything over. Keep the classic histogram series and the native histogram series available for the same service during a planned overlap, then evaluate both versions of each query over the same sample period. Compare the quantile values, the series count returned and the timing of threshold crossings for alert expressions. Differences are expected where bucket interpolation differs from native histogram estimation, so the goal is to agree on an acceptable tolerance with the people who read each dashboard, not to demand identical numbers. Confirm query function support and output shape for the exact Prometheus version you run, since the functions and result types that work on native histograms can differ by release, and check the current behavior in the Prometheus overview documentation and the release notes for your line.

The effort scales with the number of dashboards, panels, alert rules and recording rules that touch histograms, not with cluster size alone. A small cluster with many bespoke dashboards can take longer than a large cluster with one shared template. Ask a partner to estimate the work from the inventory, and expect the quote to cover the inventory, rewritten expressions, the comparison period, owner sign-off and the rollback steps for each rule group. Recurring cost appears when new services are instrumented with classic histograms, so decide early which metrics stay classic and which move.

How native histograms affect storage and remote write

On a single Prometheus server, native histogram samples are written into the same local time series database that holds every other sample. Prometheus organizes that database into two-hour blocks and records incoming writes in a write-ahead log before they reach a block. Native histograms change the size of each sample, not the layout of the database, so the effect on disk shows up in blocks and the WAL as a change in bytes per series and in how many series you keep. Retention still defaults to 15 days and can be set by time or by size, so a larger per-sample footprint reduces how far back you can query before the size limit is reached.

  • Blocks and WAL: Histogram samples are stored in the same two-hour blocks and WAL as other series, so WAL growth tracks ingestion volume.
  • Retention: The default 15-day retention applies unchanged, but a size-based limit will trim older data sooner if samples grow.
  • Local storage is not replicated: The storage documentation states that local storage is not clustered or replicated, so a larger histogram footprint is also a larger single-node backup and recovery concern.
  • Query effects: Queries over native histograms return fewer, denser series than classic buckets, which changes dashboard load.
  • Sizing: Measure series count and sample size on your own data before and after enabling native histograms, because the saving depends on your label sets and bucket layouts.

Before you enable native histograms on a single server, confirm the disk and retention limits you have set and run a test scrape to see the real change on your data.

Security and operational considerations

Native histogram adoption touches the same surfaces as any Prometheus change: scrape and remote write paths, the query UI and API, admin endpoints and the server version. The cards below cover each surface and the test that should happen before a server or receiver change goes live.

Transport security for scrape and remote write

Scrape targets and remote write endpoints carry metric data across the network, so each path needs TLS and, where the receiver supports it, client certificate authentication. Prometheus supports TLS with TLS 1.2 as the minimum. If you use HTTP basic authentication, never run it without TLS, because the credentials would travel in cleartext. Check every scrape job and remote write block in configuration, not only the ones you changed for histograms.

Security model

Access control on the query UI and API

Prometheus has no built-in single sign-on, and its security model notes there is no built-in CSRF protection on mutating endpoints. Native histogram queries are often run ad hoc from the UI, so place an authenticating reverse proxy in front of the web UI and API to handle identity and access. Confirm that the proxy, not the Prometheus listener, is the only route users can reach.

Admin endpoints kept disabled

Prometheus admin HTTP APIs are disabled by default. The --web.enable-admin-api flag enables destructive operations, and --web.enable-lifecycle enables reload and shutdown endpoints. Enable these only for a named maintenance task, such as deleting series after a bad histogram rollout, and turn them off again afterward. Record who changed the flag and when.

Exporter target abuse

The security model warns that exporters such as SNMP and Blackbox take targets from URL parameters, so anyone with HTTP access to them can make them send requests to arbitrary endpoints. Restrict network access to these exporters and check that only Prometheus can reach them. This matters when histogram instrumentation is added to services that are scraped through an exporter.

Testing the upgrade path for histogram data

Native histograms depend on the Prometheus version on both the scraping server and any remote write receiver. Prometheus minor releases stop receiving bug fixes after 6 weeks, and LTS lines get bug fixes for one year, so plan the version you run. Before a server or receiver change, test queries, dashboards and recording rules against native histogram samples in a staging copy, and confirm the receiver accepts the data type you send.

Release cycle

Limits and what to confirm in your environment

Before you commit to native histograms, confirm each limit against the release notes and vendor documentation for your own stack rather than assuming support. Start with the client libraries your services use. Check which languages and library versions emit native histograms, whether they can emit them alongside classic buckets during a transition, and whether your exporters and custom instrumentation expose them at all. A service that still emits only classic buckets will not gain anything from enabling the feature on the server.

Next, trace the path after scraping. Every remote write receiver, long-term store, recording rule consumer and dashboard tool between the Prometheus server and the screen must accept the format. Ask each vendor directly which native histogram support they have, which PromQL functions they evaluate correctly, and what they do with a sample they cannot read. Also confirm how long-term storage handles the format, because a receiver that silently downsamples or drops native histograms can make your latency panels look healthy while hiding the tail.

Finally, treat the bucket schema as a design decision, not a default. Test the resolution your schema gives across the latency ranges your services actually see, and measure how many active series and how much storage the new format adds under your label set. Remember that Prometheus overview describes the system as valuing reliability over precision and not suited to workloads that need 100% accuracy, such as per-request billing. Histogram quantiles are estimates, so use native histograms for service level views and capacity planning, and keep exact accounting in systems designed for it.

Questions buyers ask about native histogram adoption

What does native histogram adoption cost, and what drives it up?

Most of the cost is engineer time, not software, because Prometheus is Apache-2.0 licensed and has no paid edition. The main components are query and dashboard rewrites, client library upgrades in each service, receiver and remote write checks, and testing against your alert rules. Costs rise with the number of services that emit histograms, the number of dashboards and rules that read them, and how many downstream systems receive remote write. Ask any quote to itemize these components separately, state which items are one-time and which recur (such as upgrades to Prometheus minor releases), and name the assumptions about how many services and dashboards are in scope.

How long does a native histogram pilot take?

No supplied figure sets a fixed duration, so the length depends on the inventory and the test windows you can give. A pilot usually runs one or a few services end to end: enabling native histogram scraping, confirming the client library version emits them, checking that remote write receivers accept them, and comparing query results with the classic series. The duration is set by how many services you pilot, how long your test window runs, how many dashboards need rewriting and how quickly owners can review results. Ask for a written schedule with milestones and an explicit list of what the pilot will and will not prove.

What does our team need to provide before the work starts?

Three inputs decide whether the work stays on schedule. First, an inventory of dashboards, recording rules and alert rules that query histogram series, including the PromQL they use. Second, a named owner for each service that emits histograms, who can approve client library upgrades and confirm behavior. Third, test windows in staging and production where traffic is representative and changes can be rolled back. Missing any of these usually shows up as rework late in the project. Confirm these inputs in the scope document so the quote reflects your real estate rather than an assumption.

Can our in-house team adopt native histograms without outside help?

Yes, many teams can do it internally, provided they have engineers who know PromQL, the client libraries their services use, and the remote write path to any long-term store. The work is incremental and reversible, so the risk is mostly in dashboards and alerts that silently change behavior. An outside partner adds value when the estate is large, when several teams own services with different languages, or when the team lacks capacity to run a pilot and rewrite queries at the same time. Ask a partner to show how they would verify query equivalence and what they would hand over.

Can classic and native histograms run side by side?

Yes, the design goal of a migration is usually to run both representations during a transition so that existing dashboards and alerts keep working while new queries are validated. Running both increases series count and scrape size for the services that expose both, so the storage and cardinality effects should be measured during the pilot rather than assumed. Plan an end date for the classic series, a list of rules that still depend on them, and a rollback path. Confirm with the Prometheus documentation for your exact release how each representation is exposed and queried.

What breaks when we switch dashboards and alerts to native histogram queries?

The most common failures are queries that assume the _bucket series and le labels, recording rules that reference bucket names, and alerts whose thresholds were tuned against classic bucket boundaries. Native histograms change how quantiles are calculated, so panels can show different numbers even when the underlying traffic is identical. Engineers should compare old and new results over the same time range, document any intentional differences, and retune alert thresholds before the classic series are removed. Test alert routing as well, since a changed expression can stop firing silently.

What should we check in a receiver before enabling native histograms?

Check that every remote write receiver and long-term store accepts native histogram samples in the protocol version you send, and that its query layer can read them. Some receivers accept only classic histograms, and storage-side behavior differs between products. Confirm the receiver version, its documented support for native histograms and its query results against a sample of traffic. Record the Prometheus version used for scraping, because the feature set and its maturity depend on that release, and plan an upgrade path if it is outside the supported lines.

How DeployOpen works on this

DeployOpen plans and implements native histogram adoption inside infrastructure you control, starting from which latency and size metrics matter and which queries and dashboards depend on them. The work is scoped in writing before any change reaches a production Prometheus server.

How we scope

  • Inventory the classic histograms in use, their bucket layouts, and the PromQL queries, recording rules and dashboards that read them
  • Confirm which client libraries and Prometheus versions each service runs, and whether native histograms are supported there
  • Agree in writing which metrics migrate, which run in parallel with classic buckets, and what storage and remote write changes are in scope
  • Engagements are fixed-scope, with deliverables and timelines agreed before work starts

How we build

  • Enable native histogram scraping on a test Prometheus server and verify ingestion, memory use and query results against the classic histograms
  • Rewrite affected PromQL queries, recording rules and dashboard panels, and test them against side-by-side results
  • Check remote write receivers and long-term storage for native histogram support before any sender change is made
  • Record configuration, rollback steps and each change in version-controlled files

How we hand over

  • Deliver the query and dashboard rewrite list with before and after expressions, owners and test evidence
  • Document the scrape, remote write and storage settings, plus the conditions under which classic buckets can be retired
  • Walk through the rollout and rollback runbook with the teams that operate Prometheus and the services they instrument
  • Provide a checklist for future histogram design so new services follow the same approach

How we support

  • Retest queries and dashboards after Prometheus upgrades, since native histogram behavior may change between releases
  • Review client library upgrades in instrumented services before they change histogram exposition in production
  • Offer ongoing support, upgrades and continuous testing as a retainer if your team wants continuing coverage
  • Confirm the support boundaries, response expectations and retainer terms in the written agreement

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.