mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* 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]>
22 lines
615 B
Go
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)
|
|
}
|