Skip to content

Commit

Permalink
update otel semconv to 1.26 (#531)
Browse files Browse the repository at this point in the history
Co-authored-by: Po-Yao Chen <[email protected]>
  • Loading branch information
py4chen and Po-Yao Chen authored Nov 14, 2024
1 parent 60b80b7 commit 5322c9f
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 5322c9f

Please sign in to comment.