-
Notifications
You must be signed in to change notification settings - Fork 869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log a warning whenever GlobalOpenTelemetry.set() is called #5264
Log a warning whenever GlobalOpenTelemetry.set() is called #5264
Conversation
@Advice.OnMethodEnter(suppress = Throwable.class) | ||
public static void onEnter() { | ||
LoggerFactory.getLogger(application.io.opentelemetry.api.GlobalOpenTelemetry.class) | ||
.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe info? (which is the javaagent's default log level, so will still get logged)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that warn
makes slightly more sense in this case (since the log warns you about incorrect API usage), but I don't really have a strong opinion on this. I'll change that if we decide so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only concern is about users adding the javaagent later to an existing app that was previously manually instrumented, and then they're stuck with this warning message which is not really actionable
let's keep at warn
and we can always revisit later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only concern is about users adding the javaagent later to an existing app that was previously manually instrumented, and then they're stuck with this warning message which is not really actionable
let's keep at
warn
and we can always revisit later
Why not actionable? They can remove their manual usages of GlobalOpenTelemetry.set
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I should have been more specific, I was thinking about ops users
I decided to implement this while I still remember about it 😅
CC @jack-berg