Files
892384c504 replace hedged requests roundtrips total with counter (#4063)
* replace hedged requests roundtrips total with counter

* update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Mario <[email protected]>

---------

Co-authored-by: Mario <[email protected]>
2024-09-12 23:46:33 +05:30

22 lines
615 B
Go

package instrumentation
import (
"github.com/cristalhq/hedgedhttp"
"github.com/grafana/tempo/pkg/hedgedmetrics"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var hedgedRequestsMetrics = promauto.NewCounter(
prometheus.CounterOpts{
Namespace: "tempodb",
Name: "backend_hedged_roundtrips_total",
Help: "Total number of hedged backend requests.",
},
)
// PublishHedgedMetrics flushes metrics from hedged requests every 10 seconds
func PublishHedgedMetrics(s *hedgedhttp.Stats) {
hedgedmetrics.Publish(s, hedgedRequestsMetrics)
}