From 9138a9170a21dfa3c6b994c36ce89189e563adbb Mon Sep 17 00:00:00 2001 From: samuelgrant123 Date: Sat, 15 Feb 2025 16:27:54 -0500 Subject: [PATCH 1/2] changing identifiers for newly implemented min and max functions Signed-off-by: samuelgrant123 --- api/prometheus/v1/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/prometheus/v1/api.go b/api/prometheus/v1/api.go index cddf027fd..f25d8a100 100644 --- a/api/prometheus/v1/api.go +++ b/api/prometheus/v1/api.go @@ -692,9 +692,9 @@ type TSDBHeadStats struct { // WalReplayStatus represents the wal replay status. type WalReplayStatus struct { - Min int `json:"min"` - Max int `json:"max"` - Current int `json:"current"` + StartOffset int `json:"startOffset"` + EndOffset int `json:"endOffset"` + Current int `json:"current"` } // Stat models information about statistic value. From bb228f0062959a40ed3d645ea50bf141c3299f07 Mon Sep 17 00:00:00 2001 From: samuelgrant123 Date: Sun, 16 Feb 2025 00:26:59 -0500 Subject: [PATCH 2/2] fixing Refresh client_golang examples #1652 Signed-off-by: samuelgrant123 --- examples/random/main.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/examples/random/main.go b/examples/random/main.go index 9192e94c2..96b19b66c 100644 --- a/examples/random/main.go +++ b/examples/random/main.go @@ -33,6 +33,8 @@ import ( type metrics struct { rpcDurations *prometheus.SummaryVec rpcDurationsHistogram prometheus.Histogram + rpcRequests *prometheus.CounterVec + activeRpcs *prometheus.GaugeVec } func NewMetrics(reg prometheus.Registerer, normMean, normDomain float64) *metrics { @@ -65,9 +67,32 @@ func NewMetrics(reg prometheus.Registerer, normMean, normDomain float64) *metric Buckets: prometheus.LinearBuckets(normMean-5*normDomain, .5*normDomain, 20), NativeHistogramBucketFactor: 1.1, }), + + //Adding the counter metric type + rpcRequests: prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "rpc_requests_total", + Help: "RPC request distributions.", + }, + []string{"service"}, + ), + + //Adding the gauge metric type + activeRpcs: prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Name: "rpc_active_calls", + Help: "RPC call distributions.", + }, + []string{"service"}, + ), } + reg.MustRegister(m.rpcDurations) reg.MustRegister(m.rpcDurationsHistogram) + //Registering the counter vec + reg.MustRegister(m.rpcRequests) + //Registing the gauge vec + reg.MustRegister(m.activeRpcs) return m }