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)