From 0cf8fda76b0d08b47e05ddbe98d51d8abf7e0074 Mon Sep 17 00:00:00 2001 From: Andreas Christou Date: Wed, 6 Nov 2024 12:36:10 +0000 Subject: [PATCH] Handle endpoint type correctly (#1135) --- backend/httpclient/datasource_metrics_middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/httpclient/datasource_metrics_middleware.go b/backend/httpclient/datasource_metrics_middleware.go index e4bcdf8e5..9f14ef5f4 100644 --- a/backend/httpclient/datasource_metrics_middleware.go +++ b/backend/httpclient/datasource_metrics_middleware.go @@ -136,7 +136,7 @@ func executeMiddleware(next http.RoundTripper, labels prometheus.Labels) http.Ro ctx := r.Context() labels["endpoint"] = "" if ep := ctx.Value(endpointctx.EndpointCtxKey); ep != nil { - labels["endpoint"] = ep.(string) + labels["endpoint"] = fmt.Sprintf("%v", ep) } requestCounter := datasourceRequestCounter.MustCurryWith(labels) requestHistogram := datasourceRequestHistogram.MustCurryWith(labels)