From 7aa1f4571b09936e67997d25a610c2974dace810 Mon Sep 17 00:00:00 2001 From: machine424 Date: Thu, 5 Dec 2024 13:28:15 +0100 Subject: [PATCH] fix(remote): rename some remote read related metrics for better clarity. From the remote read handler side: prometheus_api_remote_read_queries -> prometheus_remote_read_handler_queries From the remote read client side: prometheus_remote_storage_read_queries_total -> prometheus_remote_read_client_queries_total prometheus_remote_storage_remote_read_queries -> prometheus_remote_read_client_queries prometheus_remote_storage_read_request_duration_seconds -> prometheus_remote_read_client_request_duration_seconds Signed-off-by: machine424 --- storage/remote/client.go | 12 ++++++------ storage/remote/read_handler.go | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/storage/remote/client.go b/storage/remote/client.go index ad766be9b..2538ee90a 100644 --- a/storage/remote/client.go +++ b/storage/remote/client.go @@ -81,8 +81,8 @@ var ( remoteReadQueriesTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: namespace, - Subsystem: subsystem, - Name: "read_queries_total", + Subsystem: "remote_read_client", + Name: "queries_total", Help: "The total number of remote read queries.", }, []string{remoteName, endpoint, "response_type", "code"}, @@ -90,8 +90,8 @@ var ( remoteReadQueries = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: namespace, - Subsystem: subsystem, - Name: "remote_read_queries", + Subsystem: "remote_read_client", + Name: "queries", Help: "The number of in-flight remote read queries.", }, []string{remoteName, endpoint}, @@ -99,8 +99,8 @@ var ( remoteReadQueryDuration = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: namespace, - Subsystem: subsystem, - Name: "read_request_duration_seconds", + Subsystem: "remote_read_client", + Name: "request_duration_seconds", Help: "Histogram of the latency for remote read requests. Note that for streamed responses this is only the duration of the initial call and does not include the processing of the stream.", Buckets: append(prometheus.DefBuckets, 25, 60), NativeHistogramBucketFactor: 1.1, diff --git a/storage/remote/read_handler.go b/storage/remote/read_handler.go index 8f2945f97..3e315a615 100644 --- a/storage/remote/read_handler.go +++ b/storage/remote/read_handler.go @@ -56,10 +56,10 @@ func NewReadHandler(logger *slog.Logger, r prometheus.Registerer, queryable stor marshalPool: &sync.Pool{}, queries: prometheus.NewGauge(prometheus.GaugeOpts{ - Namespace: "prometheus", - Subsystem: "api", // TODO: changes to storage in Prometheus 3.0. - Name: "remote_read_queries", - Help: "The current number of remote read queries being executed or waiting.", + Namespace: namespace, + Subsystem: "remote_read_handler", + Name: "queries", + Help: "The current number of remote read queries that are either in execution or queued on the handler.", }), } if r != nil {