From 5322c9fd18354b3b82f9034b0cdb97efed70158e Mon Sep 17 00:00:00 2001 From: Po-Yao Chen Date: Thu, 14 Nov 2024 17:28:39 +0000 Subject: [PATCH] update otel semconv to 1.26 (#531) Co-authored-by: Po-Yao Chen --- otellib/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/otellib/http.go b/otellib/http.go index fda865c..a8ac338 100644 --- a/otellib/http.go +++ b/otellib/http.go @@ -13,7 +13,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" - semconv "go.opentelemetry.io/otel/semconv/v1.20.0" + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" ) const scopeName = "github.com/theparanoids/crypki/otellib" @@ -57,7 +57,7 @@ func (h *httpMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) { labeler, _ := otelhttp.LabelerFromContext(r.Context()) // Add the http.target attribute to the OTel labeler. if r.URL != nil { - labeler.Add(semconv.HTTPTargetKey.String(r.URL.RequestURI())) + labeler.Add(semconv.HTTPRouteKey.String(r.URL.RequestURI())) } defer func() { if rec := recover(); rec != nil {