Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Po-Yao Chen committed Nov 14, 2024
1 parent 60b80b7 commit 08398d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions otellib/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 08398d7

Please sign in to comment.