mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Loki backend and client depend on a requester * Instrument all requests to loki using weaveworks TimedClient * Construct collector in metrics package
24 lines
715 B
Go
24 lines
715 B
Go
package metrics
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
"github.com/weaveworks/common/instrument"
|
|
)
|
|
|
|
type Historian struct {
|
|
WriteDuration *instrument.HistogramCollector
|
|
}
|
|
|
|
func NewHistorianMetrics(r prometheus.Registerer) *Historian {
|
|
return &Historian{
|
|
WriteDuration: instrument.NewHistogramCollector(promauto.With(r).NewHistogramVec(prometheus.HistogramOpts{
|
|
Namespace: Namespace,
|
|
Subsystem: Subsystem,
|
|
Name: "state_history_request_duration_seconds",
|
|
Help: "Histogram of request durations to the state history store.",
|
|
Buckets: instrument.DefBuckets,
|
|
}, instrument.HistogramCollectorBuckets)),
|
|
}
|
|
}
|