The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/ngalert/metrics/remote_writer.go

30 lines
933 B

package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
type RemoteWriter struct {
WritesTotal *prometheus.CounterVec
WriteDuration *prometheus.HistogramVec
}
func NewRemoteWriterMetrics(r prometheus.Registerer) *RemoteWriter {
return &RemoteWriter{
WritesTotal: promauto.With(r).NewCounterVec(prometheus.CounterOpts{
Namespace: Namespace,
Subsystem: Subsystem,
Name: "remote_writer_writes_total",
Help: "The total number of remote writes attempted.",
}, []string{"org", "backend", "status_code"}),
WriteDuration: promauto.With(r).NewHistogramVec(
prometheus.HistogramOpts{
Namespace: Namespace,
Subsystem: Subsystem,
Name: "remote_writer_write_duration_seconds",
Help: "Histogram of remote write durations.",
Buckets: prometheus.DefBuckets,
}, []string{"org", "backend"}),
}
}