diff --git a/CHANGELOG.md b/CHANGELOG.md index c39767b6c4a..fa1367c41be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#7679](https://github.com/thanos-io/thanos/pull/7679) Query: respect store.limit.* flags when evaluating queries ### Added - +- [#7763](https://github.com/thanos-io/thanos/pull/7763) Ruler: use native histograms for client latency metrics. - [#7609](https://github.com/thanos-io/thanos/pull/7609) API: Add limit param to metadata APIs (series, label names, label values). - [#7429](https://github.com/thanos-io/thanos/pull/7429): Reloader: introduce `TolerateEnvVarExpansionErrors` to allow suppressing errors when expanding environment variables in the configuration file. When set, this will ensure that the reloader won't consider the operation to fail when an unset environment variable is encountered. Note that all unset environment variables are left as is, whereas all set environment variables are expanded as usual. - [#7560](https://github.com/thanos-io/thanos/pull/7560) Query: Added the possibility of filtering rules by rule_name, rule_group or file to HTTP api. diff --git a/pkg/extprom/http/instrument_client.go b/pkg/extprom/http/instrument_client.go index 75d33243c7a..ebdda5fbe1a 100644 --- a/pkg/extprom/http/instrument_client.go +++ b/pkg/extprom/http/instrument_client.go @@ -27,6 +27,8 @@ type ClientMetrics struct { // e.g. 1 ClientMetrics should be used for all the clients that talk to Alertmanager. func NewClientMetrics(reg prometheus.Registerer) *ClientMetrics { var m ClientMetrics + const maxBucketNumber = 256 + const bucketFactor = 1.1 m.inFlightGauge = promauto.With(reg).NewGauge(prometheus.GaugeOpts{ Subsystem: "http_client", @@ -46,6 +48,9 @@ func NewClientMetrics(reg prometheus.Registerer) *ClientMetrics { Name: "dns_duration_seconds", Help: "Trace dns latency histogram.", Buckets: []float64{0.025, .05, .1, .5, 1, 5, 10}, + + NativeHistogramBucketFactor: bucketFactor, + NativeHistogramMaxBucketNumber: maxBucketNumber, }, []string{"event"}, ) @@ -56,6 +61,9 @@ func NewClientMetrics(reg prometheus.Registerer) *ClientMetrics { Name: "tls_duration_seconds", Help: "Trace tls latency histogram.", Buckets: []float64{0.025, .05, .1, .5, 1, 5, 10}, + + NativeHistogramBucketFactor: bucketFactor, + NativeHistogramMaxBucketNumber: maxBucketNumber, }, []string{"event"}, ) @@ -66,6 +74,9 @@ func NewClientMetrics(reg prometheus.Registerer) *ClientMetrics { Name: "request_duration_seconds", Help: "A histogram of request latencies.", Buckets: []float64{0.025, .05, .1, .5, 1, 5, 10}, + + NativeHistogramBucketFactor: bucketFactor, + NativeHistogramMaxBucketNumber: maxBucketNumber, }, []string{"code", "method"}, )