Add EnableNativeHistograms feature gate
Description of the issue
To enable native histograms, we need to add the following feature gate
receiver.prometheusreceiver.EnableNativeHistograms
sample:
--feature-gates=receiver.prometheusreceiver.EnableNativeHistograms
Description of changes
- Add EnableNativeHistograms feature gate
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Sample prometheus metrics:
prometheus_test_untyped{include="yes",prom_type="untyped"} 1
# TYPE prometheus_test_counter counter
prometheus_test_counter{include="yes",prom_type="counter"} 1
# TYPE prometheus_test_counter_exclude counter
prometheus_test_counter_exclude{include="no",prom_type="counter"} 1
# TYPE prometheus_test_gauge gauge
prometheus_test_gauge{include="yes",prom_type="gauge"} 500
# TYPE prometheus_test_summary summary
prometheus_test_summary_sum{include="yes",prom_type="summary"} 200
prometheus_test_summary_count{include="yes",prom_type="summary"} 50
prometheus_test_summary{include="yes",quantile="0",prom_type="summary"} 0.1
prometheus_test_summary{include="yes",quantile="0.5",prom_type="summary"} 0.25
prometheus_test_summary{include="yes",quantile="1",prom_type="summary"} 5.5
# TYPE prometheus_test_histogram histogram
prometheus_test_histogram_sum{include="yes",prom_type="histogram"} 300
prometheus_test_histogram_count{include="yes",prom_type="histogram"} 75
prometheus_test_histogram_bucket{include="yes",le="0",prom_type="histogram"} 1
prometheus_test_histogram_bucket{include="yes",le="0.5",prom_type="histogram"} 12
prometheus_test_histogram_bucket{include="yes",le="2.5",prom_type="histogram"} 35
prometheus_test_histogram_bucket{include="yes",le="5",prom_type="histogram"} 60
prometheus_test_histogram_bucket{include="yes",le="+Inf",prom_type="histogram"} 75
# TYPE prometheus_test_native_histogram histogram
# HELP prometheus_test_native_histogram This is a native histogram example
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="-Inf"} 0
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="-1.0"} 0
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="0.0"} 5
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="1.0"} 18
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="2.0"} 25
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="3.0"} 42
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="4.0"} 56
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="5.0"} 67
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="10.0"} 89
prometheus_test_native_histogram_bucket{include="yes",prom_type="native_histogram",le="+Inf"} 100
prometheus_test_native_histogram_count{include="yes",prom_type="native_histogram"} 100
prometheus_test_native_histogram_sum{include="yes",prom_type="native_histogram"} 450.25
prometheus_test_native_histogram_created{include="yes",prom_type="native_histogram"} 1753987200.0
Requirements
Before commiting your code, please do the following steps.
- Run
make fmtandmake fmt-sh - Run
make lint
Integration Tests
To run integration tests against this PR, add the ready for testing label.
I'm not sure if the sample metrics you used in the test are actually native prometheus histograms. They look like classic histograms that are just named native. We need to find the definition for prometheus native histograms.
This PR was marked stale due to lack of activity.
This PR was marked stale due to lack of activity.