diff --git a/docs/content/migration/v2.md b/docs/content/migration/v2.md index 41329d7f4..95b3b636a 100644 --- a/docs/content/migration/v2.md +++ b/docs/content/migration/v2.md @@ -441,8 +441,14 @@ Therefore, the [RBAC](../reference/dynamic-configuration/kubernetes-gateway.md#r ## v2.6.0 to v2.6.1 +### Metrics + In `v2.6.1`, the metrics system does not support any more custom HTTP method verbs to prevent potential metrics cardinality overhead. In consequence, for metrics having the method label, if the HTTP method verb of a request is not one defined in the set of common methods for [`HTTP/1.1`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) or the [`PRI`](https://datatracker.ietf.org/doc/html/rfc7540#section-11.6) verb (for `HTTP/2`), the value for the method label becomes `EXTENSION_METHOD`, instead of the request's one. + +### Tracing + +In `v2.6.1`, the Datadog tags added to a span changed from `service.name` to `traefik.service.name` and from `router.name` to `traefik.router.name`. diff --git a/pkg/middlewares/tracing/forwarder.go b/pkg/middlewares/tracing/forwarder.go index c65d322e1..51c313f4c 100644 --- a/pkg/middlewares/tracing/forwarder.go +++ b/pkg/middlewares/tracing/forwarder.go @@ -43,8 +43,8 @@ func (f *forwarderMiddleware) ServeHTTP(rw http.ResponseWriter, req *http.Reques span, req, finish := tr.StartSpanf(req, ext.SpanKindRPCClientEnum, "forward", opParts, "/") defer finish() - span.SetTag("service.name", f.service) - span.SetTag("router.name", f.router) + span.SetTag("traefik.service.name", f.service) + span.SetTag("traefik.router.name", f.router) ext.HTTPMethod.Set(span, req.Method) ext.HTTPUrl.Set(span, req.URL.String()) span.SetTag("http.host", req.Host) diff --git a/pkg/middlewares/tracing/forwarder_test.go b/pkg/middlewares/tracing/forwarder_test.go index d8b1cbb99..1253412d3 100644 --- a/pkg/middlewares/tracing/forwarder_test.go +++ b/pkg/middlewares/tracing/forwarder_test.go @@ -36,12 +36,12 @@ func TestNewForwarder(t *testing.T) { router: "some-service.domain.tld", expected: expected{ Tags: map[string]interface{}{ - "http.host": "www.test.com", - "http.method": "GET", - "http.url": "http://www.test.com/toto", - "service.name": "some-service.domain.tld", - "router.name": "some-service.domain.tld", - "span.kind": ext.SpanKindRPCClientEnum, + "http.host": "www.test.com", + "http.method": "GET", + "http.url": "http://www.test.com/toto", + "traefik.service.name": "some-service.domain.tld", + "traefik.router.name": "some-service.domain.tld", + "span.kind": ext.SpanKindRPCClientEnum, }, OperationName: "forward some-service.domain.tld/some-service.domain.tld", }, @@ -56,12 +56,12 @@ func TestNewForwarder(t *testing.T) { router: "some-service-100.slug.namespace.environment.domain.tld", expected: expected{ Tags: map[string]interface{}{ - "http.host": "www.test.com", - "http.method": "GET", - "http.url": "http://www.test.com/toto", - "service.name": "some-service-100.slug.namespace.environment.domain.tld", - "router.name": "some-service-100.slug.namespace.environment.domain.tld", - "span.kind": ext.SpanKindRPCClientEnum, + "http.host": "www.test.com", + "http.method": "GET", + "http.url": "http://www.test.com/toto", + "traefik.service.name": "some-service-100.slug.namespace.environment.domain.tld", + "traefik.router.name": "some-service-100.slug.namespace.environment.domain.tld", + "span.kind": ext.SpanKindRPCClientEnum, }, OperationName: "forward some-service-100.slug.namespace.enviro.../some-service-100.slug.namespace.enviro.../bc4a0d48", }, @@ -76,12 +76,12 @@ func TestNewForwarder(t *testing.T) { router: "some-service1.namespace.environment.domain.tld", expected: expected{ Tags: map[string]interface{}{ - "http.host": "www.test.com", - "http.method": "GET", - "http.url": "http://www.test.com/toto", - "service.name": "some-service1.namespace.environment.domain.tld", - "router.name": "some-service1.namespace.environment.domain.tld", - "span.kind": ext.SpanKindRPCClientEnum, + "http.host": "www.test.com", + "http.method": "GET", + "http.url": "http://www.test.com/toto", + "traefik.service.name": "some-service1.namespace.environment.domain.tld", + "traefik.router.name": "some-service1.namespace.environment.domain.tld", + "span.kind": ext.SpanKindRPCClientEnum, }, OperationName: "forward some-service1.namespace.environment.domain.tld/some-service1.namespace.environment.domain.tld", }, @@ -96,12 +96,12 @@ func TestNewForwarder(t *testing.T) { router: "some-service1.backend.namespace.environment.domain.tld", expected: expected{ Tags: map[string]interface{}{ - "http.host": "www.test.com", - "http.method": "GET", - "http.url": "http://www.test.com/toto", - "service.name": "some-service1.frontend.namespace.environment.domain.tld", - "router.name": "some-service1.backend.namespace.environment.domain.tld", - "span.kind": ext.SpanKindRPCClientEnum, + "http.host": "www.test.com", + "http.method": "GET", + "http.url": "http://www.test.com/toto", + "traefik.service.name": "some-service1.frontend.namespace.environment.domain.tld", + "traefik.router.name": "some-service1.backend.namespace.environment.domain.tld", + "span.kind": ext.SpanKindRPCClientEnum, }, OperationName: "forward some-service1.frontend.namespace.envir.../some-service1.backend.namespace.enviro.../fa49dd23", },