Kubernetes 1.36 Native Histogram Metrics
Enable Prometheus native histograms in Kubernetes 1.36 for higher-resolution metrics with lower storage cost. Covers all control plane components.
π‘ Quick Answer: Kubernetes 1.36 adds Prometheus Native Histogram support (Alpha) across all control plane components. Native histograms provide higher resolution than classic histograms with 10x less storage and no bucket configuration needed.
The Problem
Classic Prometheus histograms have significant drawbacks:
- Fixed buckets β you choose bucket boundaries at instrumentation time, before knowing the actual distribution
- Wrong boundaries β miss important percentile boundaries (p95, p99) if buckets donβt align
- High cardinality β each bucket is a separate time series (10 buckets = 10 series per metric)
- Storage cost β histogram metrics consume 10-20x more storage than gauges
- Aggregation errors β merging histograms across instances introduces quantile errors
The Solution
Native histograms use exponential bucketing with automatic boundary selection. No configuration needed, higher accuracy, lower storage.
Enable Native Histograms (Alpha Feature Gate)
# API Server
kube-apiserver --feature-gates=NativeHistograms=true
# Scheduler
kube-scheduler --feature-gates=NativeHistograms=true
# Kubelet
kubelet --feature-gates=NativeHistograms=true
# Controller Manager
kube-controller-manager --feature-gates=NativeHistograms=true
# Kube-Proxy
kube-proxy --feature-gates=NativeHistograms=truekubeadm Cluster Configuration
apiVersion: kubeadm.k8s.io/v1beta4
kind: ClusterConfiguration
apiServer:
extraArgs:
- name: feature-gates
value: "NativeHistograms=true"
scheduler:
extraArgs:
- name: feature-gates
value: "NativeHistograms=true"
controllerManager:
extraArgs:
- name: feature-gates
value: "NativeHistograms=true"
---
apiVersion: kubeadm.k8s.io/v1beta4
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
- name: feature-gates
value: "NativeHistograms=true"Configure Prometheus to Scrape Native Histograms
# prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'kubernetes-apiservers'
kubernetes_sd_configs:
- role: endpoints
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
scrape_protocols:
- PrometheusProto # Required for native histograms
- OpenMetricsText1.0.0
- OpenMetricsText0.0.1
- PrometheusText0.0.4
relabel_configs:
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: default;kubernetes;httpsPrometheus Operator Configuration
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: k8s
namespace: monitoring
spec:
version: v3.2.0
scrapeProtocols:
- PrometheusProto # Enable protobuf scraping for native histograms
- OpenMetricsText1.0.0
- PrometheusText0.0.4
enableFeatures:
- native-histograms
serviceMonitorSelector:
matchLabels:
team: platformQuery Native Histograms in PromQL
# Classic histogram quantile (old way):
histogram_quantile(0.99, rate(apiserver_request_duration_seconds_bucket[5m]))
# Native histogram quantile (new way β same function, automatic):
histogram_quantile(0.99, rate(apiserver_request_duration_seconds[5m]))
# No _bucket suffix needed!
# Native histogram average:
histogram_avg(rate(apiserver_request_duration_seconds[5m]))
# Native histogram count and sum still work:
histogram_count(rate(apiserver_request_duration_seconds[5m]))
histogram_sum(rate(apiserver_request_duration_seconds[5m]))
# Fraction of requests under 500ms:
histogram_fraction(0, 0.5, rate(apiserver_request_duration_seconds[5m]))Key Metrics Now Supporting Native Histograms
# API Server request latency (most important for SLOs)
apiserver_request_duration_seconds
# Scheduler binding latency
scheduler_binding_duration_seconds
# Kubelet Pod start duration
kubelet_pod_start_duration_seconds
# Controller Manager work queue latency
workqueue_queue_duration_secondsStorage Comparison
# Classic histogram: apiserver_request_duration_seconds
# 15 buckets Γ ~200 label combinations = 3,000 time series
# Storage: ~150 KB/scrape
# Native histogram: apiserver_request_duration_seconds
# 1 native histogram Γ ~200 label combinations = 200 time series
# Storage: ~15 KB/scrape
# 10x reduction in storage for the same (or better) accuracyGrafana Dashboard Updates
{
"targets": [
{
"expr": "histogram_quantile(0.99, rate(apiserver_request_duration_seconds{job=\"apiserver\"}[5m]))",
"legendFormat": "p99 latency",
"format": "native"
}
],
"type": "timeseries",
"title": "API Server Request Latency (Native Histogram)"
}Grafana 10.3+ supports native histogram visualization with heatmap panels.
Common Issues
Prometheus not scraping native histograms
- Cause: Missing
PrometheusProtoinscrape_protocols - Fix: Add
PrometheusProtoas the first entry in scrape protocols
Old dashboards show no data
- Cause: Queries use
_bucketsuffix which doesnβt exist for native histograms - Fix: Remove
_bucketsuffix;histogram_quantileworks on both formats
Storage not decreasing
- Cause: Classic histograms still emitted alongside native (dual emission)
- Fix: In alpha, both formats may be emitted. Storage savings fully realized in beta.
Best Practices
- Enable
PrometheusProtoscraping β required for native histogram ingestion - Update Prometheus to 2.50+ β native histogram support needed
- Update Grafana to 10.3+ β for native histogram visualization
- Test in non-production first β alpha feature, verify metric compatibility
- Update alerting rules β remove
_bucketreferences from histogram queries - Keep classic histograms during migration β dual emission ensures no data gaps
Key Takeaways
- Native histograms are Alpha in Kubernetes 1.36 across all control plane components
- 10x less storage with higher accuracy β no bucket configuration needed
- Requires Prometheus protobuf scraping (
PrometheusProtoprotocol) - Same
histogram_quantile()PromQL function works for both formats - New functions:
histogram_avg(),histogram_fraction()for richer analysis

Recommended
Kubernetes Recipes β The Complete Book100+ production-ready patterns with detailed explanations, best practices, and copy-paste YAML. Everything in one place.
Get the Book βLearn by Doing
CopyPasteLearn β Hands-on Cloud & DevOps CoursesMaster Kubernetes, Ansible, Terraform, and MLOps with interactive, copy-paste-run lessons. Start free.
Browse Courses βπ Deepen Your Skills β Hands-on Courses
Courses by CopyPasteLearn.com β Learn IT by Doing
