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

replace hedged requests roundtrips total with counter #4063

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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
* [BUGFIX] Correct block end time when the ingested traces are outside the ingestion slack [#3954](https://github.com/grafana/tempo/pull/3954) (@javiermolinar)
* [BUGFIX] Fix race condition where a streaming response could be marshalled while being modified in the combiner resulting in a panic. [#3961](https://github.com/grafana/tempo/pull/3961) (@joe-elliott)
* [BUGFIX] Pass search options to the backend for SearchTagValuesBlocksV2 requests [#3971](https://github.com/grafana/tempo/pull/3971) (@javiermolinar)
* [BUGFIX] Replace hedged requests roundtrips total with a counter. [#4063](https://github.com/grafana/tempo/pull/4063) (@galalen)

## v2.5.0

Expand Down
6 changes: 3 additions & 3 deletions modules/querier/external/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ var (
NativeHistogramMaxBucketNumber: 100,
NativeHistogramMinResetDuration: 1 * time.Hour,
}, []string{"endpoint"})
metricExternalHedgedRequests = promauto.NewGauge(
prometheus.GaugeOpts{
metricExternalHedgedRequests = promauto.NewCounter(
prometheus.CounterOpts{
Namespace: "tempo",
Name: "querier_external_endpoint_hedged_roundtrips_total",
Help: "Total number of hedged external requests. Registered as a gauge for code sanity. This is a counter.",
Help: "Total number of hedged external requests.",
},
)
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/hedgedmetrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const (
)

// PublishHedgedMetrics flushes metrics from hedged requests every 10 seconds
func Publish(s *hedgedhttp.Stats, gauge prometheus.Gauge) {
func Publish(s *hedgedhttp.Stats, counter prometheus.Counter) {
ticker := time.NewTicker(hedgedMetricsPublishDuration)
go func() {
for range ticker.C {
Expand All @@ -21,7 +21,7 @@ func Publish(s *hedgedhttp.Stats, gauge prometheus.Gauge) {
if hedgedRequests < 0 {
hedgedRequests = 0
}
gauge.Set(float64(hedgedRequests))
counter.Add(float64(hedgedRequests))
}
}()
}
6 changes: 3 additions & 3 deletions tempodb/backend/instrumentation/hedged_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"
)

var hedgedRequestsMetrics = promauto.NewGauge(
prometheus.GaugeOpts{
var hedgedRequestsMetrics = promauto.NewCounter(
prometheus.CounterOpts{
Namespace: "tempodb",
Name: "backend_hedged_roundtrips_total",
Help: "Total number of hedged backend requests. Registered as a gauge for code sanity. This is a counter.",
Help: "Total number of hedged backend requests.",
},
)

Expand Down