Skip to content

Commit

Permalink
Merge pull request #7763 from pedro-stanaka/feat/http-wrappers-native…
Browse files Browse the repository at this point in the history
…-histo

ruler: use native histograms for client metrics
  • Loading branch information
fpetkovski authored Sep 27, 2024
2 parents 90215ad + 303b1f1 commit 80179ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions pkg/extprom/http/instrument_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"},
)
Expand All @@ -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"},
)
Expand All @@ -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"},
)
Expand Down

0 comments on commit 80179ce

Please sign in to comment.