1
0
Fork 0

Add k8s resource attributes automatically

Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
Kevin Pollet 2025-07-21 12:06:04 +02:00 committed by GitHub
parent 7b78128d4e
commit 78cc85283c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 170 additions and 60 deletions

View file

@ -322,9 +322,11 @@ and Traefik now keeps them encoded to avoid any ambiguity.
## v3.5.0
### TraceVerbosity on Routers and Entrypoints
### Observability
Starting with v3.5, a new `traceVerbosity` option is available for both entrypoints and routers.
#### TraceVerbosity on Routers and Entrypoints
Starting with `v3.5.0`, a new `traceVerbosity` option is available for both entrypoints and routers.
This option allows you to control the level of detail for tracing spans.
Routers can override the value inherited from their entrypoint.
@ -339,3 +341,20 @@ Possible values are:
- `detailed`: enables the creation of additional spans for each middleware executed for each request processed by a router.
See the updated documentation for [entrypoints](../reference/install-configuration/entrypoints.md) and [dynamic routers](../reference/dynamic-configuration/file.md#observability-options).
#### K8s Resource Attributes
Since `v3.5.0`, the semconv attributes `k8s.pod.name` and `k8s.pod.uid` are injected automatically in OTel resource attributes when OTel tracing/logs/metrics are enabled.
For that purpose, the following right has to be added to the Traefik Kubernetes RBACs:
```yaml
...
- apiGroups:
- ""
resources:
- pods
verbs:
- get
...
```

View file

@ -15,6 +15,14 @@ rules:
- get
- list
- watch
# The pods right is needed to inject k8s.pod.uid and k8s.pod.name OTel attributes.
# When OTel tracing/logs/metrics are not enabled, this rule is not needed.
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- discovery.k8s.io
resources:

View file

@ -11,6 +11,14 @@ rules:
verbs:
- list
- watch
# The pods get right is needed to inject k8s.pod.uid and k8s.pod.name in OTel attributes.
# When OTel tracing/logs/metrics are not enabled, this rule is not needed.
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- ""
resources: