[go: up one dir, main page]

Skip to content

Fix prometheus metirc labels for ratelimit handler

The prometheus metric labels for concurrency ratelimit handler is wrongly tagged.

Where the metric is declared at internal/middleware/limithandler/metrics.go as

inprogressGaugeVec = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Namespace: "gitaly",
		Subsystem: "rate_limiting",
		Name:      "in_progress",
		Help:      "Gauge of number of number of concurrent invocations currently in progress for this endpoint",
	},
	[]string{"system", "grpc_service", "grpc_method"},
)

queuedGaugeVec = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Namespace: "gitaly",
		Subsystem: "rate_limiting",
		Name:      "queued",
		Help:      "Gauge of number of number of invocations currently queued for this endpoint",
	},
	[]string{"system", "grpc_service", "grpc_method"},
)

But used in the same file using a wrongly ordered labels

...
queuedGauge := queuedGaugeVec.WithLabelValues(serviceName, methodName, system)
inprogressGauge := inprogressGaugeVec.WithLabelValues(serviceName, methodName, system)
...

This merge request fix this by simply correcting the label ordering.

#3393 (closed)

Edited by Xing Xin

Merge request reports

Loading