You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add opt-in support for Prometheus native histograms (#4108)
Adds opt-in support for Prometheus native histograms, as discussed in
#3898.
- New options: -enable-prometheus-native-histograms and
-prometheus-native-histogram-bucket-factor (default 1.1, exported as
metrics.DefaultNativeHistogramFactor)
- Dual emission: classic bucketed histograms are kept, so this is fully
backward compatible with existing dashboards/alerts; when the flag is
off there is no behavior change
- When a native bucket factor is set and `Buckets` is empty,
client_golang drops classic buckets instead of applying defaults — the
helper falls back to `prometheus.DefBuckets` to preserve them
- `NativeHistogramMaxBucketNumber=160` and
`NativeHistogramMinResetDuration=1h`, per the [Prometheus
docs](https://prometheus.io/docs/specs/native_histograms/) and OTEL/KEP
recommendation, are set to bound memory; happy to make these
configurable if preferred
- Native histograms are only transmitted via the protobuf exposition
format, so text `/metrics` output is unchanged; docs updated accordingly
Fixes#3898
---------
Signed-off-by: Ashrafahmed9 <ashrafahmed1232@gmail.com>
flag.BoolVar(&cfg.EnableRouteLIFOMetrics, "enable-route-lifo-metrics", false, "enable metrics for the individual route LIFO queues")
449
451
flag.Var(cfg.MetricsFlavour, "metrics-flavour", "Metrics flavour is used to change the exposed metrics format. Supported metric formats: 'codahale', 'prometheus' and 'otel', you can select multiple or all of them by using one option with ',' separated values")
450
452
flag.BoolVar(&cfg.DisableMetricsCompression, "disable-metrics-compression", false, "disable metrics compression on /metrics handler endpoint.")
453
+
flag.BoolVar(&cfg.EnablePrometheusNativeHistograms, "enable-prometheus-native-histograms", false, "enables prometheus native histograms in addition to the classic bucketed histograms")
454
+
flag.Float64Var(&cfg.PrometheusNativeHistogramBucketFactor, "prometheus-native-histogram-bucket-factor", metrics.DefaultNativeHistogramFactor, "resolution of prometheus native histograms, must be greater than 1, defaults to 1.1 when native histograms are enabled")
451
455
flag.Var(cfg.FilterPlugins, "filter-plugin", "set a custom filter plugins to load, a comma separated list of name and arguments")
452
456
flag.Var(cfg.PredicatePlugins, "predicate-plugin", "set a custom predicate plugins to load, a comma separated list of name and arguments")
453
457
flag.Var(cfg.DataclientPlugins, "dataclient-plugin", "set a custom dataclient plugins to load, a comma separated list of name and arguments")
Copy file name to clipboardExpand all lines: docs/operation/operation.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -302,6 +302,21 @@ To monitor skipper we recommend the following queries:
302
302
303
303
You may add static metrics labels like `version` using Prometheus [relabeling feature](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config).
304
304
305
+
### Prometheus native histograms
306
+
307
+
Skipper can additionally expose [Prometheus native
308
+
histograms](https://prometheus.io/docs/specs/native_histograms/) for
309
+
all histogram metrics:
310
+
311
+
-enable-prometheus-native-histograms
312
+
313
+
Classic bucketed histograms are kept, so this is backwards compatible
314
+
with existing dashboards and alerts. The resolution of native
315
+
histograms can be tuned with `-prometheus-native-histogram-bucket-factor`, which
316
+
must be greater than 1 and defaults to 1.1. Note that native
317
+
histograms are only transmitted via the protobuf exposition format,
318
+
so the scraping Prometheus needs `--enable-feature=native-histograms`.
319
+
305
320
### OpenTelemetry (OTel)
306
321
307
322
Skipper can push metrics to any [OpenTelemetry](https://opentelemetry.io/) compatible backend
0 commit comments