Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruler: use native histograms for client metrics #7763

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading