-
Notifications
You must be signed in to change notification settings - Fork 34
#62 document OpenTelemetry auto discovery NPE's #66
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
Conversation
During auto-discovery it is possible that you see NPE's in OpenTelemetry when the VertxContextProvider picked up as the default ContextProvder. This behavior can be prevented with a system property.
Thank you @steven-aerts Can you share the full stack trace please? |
I guess this comes from current context which is We should update the implementation so that the noop scope is used if the current context is Can you take care of it? |
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.
Comment about the doc
@@ -67,3 +67,12 @@ The default sending policy is `PROPAGATE`, you can configure the policy with {@l | |||
---- | |||
{@link examples.OpenTelemetryExamples#ex6} | |||
---- | |||
|
|||
== Vert.x tracing and auto-configuration |
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.
If you agree to modify the code as suggested, I think this part should be re-written to indicate that the VertxContextStorage
is fine with pure Vert.x application but it might not be the best choice for mixed apps. And then the user needs to select the appropriate storage via the sysprop
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.
Both we, as the reporter of #62 seem to have seen this in a pure Vert.x applications, but OpenTelemetry itself is also creating traces for the actions it does, and those traces need a ContextStorage
which works for them.
I will see if I can try to reword it.
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.
Then perhaps the Vertx Context Storage can delegate to the default storage when not running on the Vert.x thread?
Stacktrace and more context in #62. This might solve this issue without any need to define a system property. |
If we do this, then it's no longer possible to call |
That is sad, I am not too familiar with the opentelemetry code base, to understand how to best fall back. For example in more complex examples, like how to behave if a third Do you think it is still usefull to update the documentation? Or do you think this is something which needs need be addressed in code? |
That's indeed a good question. But I think it's one we can leave up to the application to decide. A good default behavior for the Vert.x Context Storage is to delegate to OpenTelemetry's default context storage. But maybe we can make that configurable. i.e. let the application configure an alternative fallback in |
@steven-aerts thank you for bringing this to our attention. I will close this PR in favor of #72 (which makes the Vert.x context storage provider use the default provider when not invoked on a Vert.x thread). |
During auto-discovery it is possible that you see NPE's in OpenTelemetry when the VertxContextProvider picked up as the default ContextProvder. This behavior can be prevented with a system property.