-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Describe the bug
The bug is that the default span attrs can't be overriden after they are set.
My case was that I wanted to unset the default nginx span attrs, because they are outdated with modern semconv, which now uses other attr names.
F.e., instead of http.flavor the network.protocol.name should be used, or instead of http.user_agent the user_agent.original should be used and so on.
But after I set the attrs to an empty string (which is the only way to expect the behaviour of unsetting an attr) by using otel_span_attr http.flavor "";, it just adds it as another attr, as seen in Grafana:

To reproduce
Steps to reproduce the behavior:
- Deploy default
nginxusing Docker imagenginx:1.28.0-alpine-otelwith mounted/etc/nginx/conf.d/otel.conf:
# /etc/nginx/conf.d/otel.conf
otel_exporter {
endpoint ${X_OTEL_EXPORTER_ENDPOINT};
}
otel_service_name nginx;
otel_span_attr http.flavor "";
otel_trace on;- Deploy Grafana with Tempo or any other tracing dashboard.
- View traces in Grafana, there would be 2 entries of the
http.flavorattr.
Expected behavior
It is expected so the http.flavor attr is removed from the span attrs, or so there is at least another way to do so to have full control of the attrs that are set.
Your environment
Docker image: nginx:1.28.0-alpine-otel