How to add custom attributes to traces? #5710
Replies: 2 comments
-
I would expect ( |
Beta Was this translation helpful? Give feedback.
-
Hello @trask , first of all thanks for your time, it's nor working the Span.current() not only in the Filter, nor it works in the endpoint, I don't know why, it returns an invalid trace, the APM is properly registering the call to the endpoint Lol, someone told me they had only 1 dep in the pom, and then it worked, I let it reported here, because maybe others has the same problem I had the following deps <dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api-trace</artifactId>
<version>0.13.1</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>1.24.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>1.28.0</version>
</dependency>
After removing the unrequired deps and let the pom like this <dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>1.28.0</version>
</dependency>
It now works properly! 🍷 |
Beta Was this translation helpful? Give feedback.
-
Hello I have a Spring boot app, I just added the javaagent, and the application is sending a lot of useful information, the problem is that I need to be able to add custom attribute to the data, in the current case the username.
How can I archieve that?, I already tried with Span.current() (doesn't return the trace that should has been generated by the javaagent), I also tried with SpanProcessor (I don't know how to add it to the javaavent), AutoConfigurationCustomizer is not fired neither
I was expected to do something like
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions