1
0
Fork 0

Upgrade to OpenTelemetry Semantic Conventions v1.26.0

This commit is contained in:
Michael 2024-06-27 14:14:03 +02:00 committed by GitHub
parent 2f9905061e
commit 8cb1829698
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 558 additions and 217 deletions

View file

@ -16,7 +16,7 @@ import (
"github.com/traefik/traefik/v3/pkg/middlewares"
"github.com/traefik/traefik/v3/pkg/tracing"
"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
"go.opentelemetry.io/otel/trace"
)
@ -95,7 +95,7 @@ func (r *retry) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
currentSpan.SetAttributes(attribute.String("traefik.middleware.name", r.name))
// Only add the attribute "http.resend_count" defined by semantic conventions starting from second attempt.
if attempts > 1 {
currentSpan.SetAttributes(semconv.HTTPResendCount(attempts - 1))
currentSpan.SetAttributes(semconv.HTTPRequestResendCount(attempts - 1))
}
req = req.WithContext(tracingCtx)