-
Notifications
You must be signed in to change notification settings - Fork 278
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
Traces not being emitted for custom instrumentation #433
Comments
An update to this, it appears if I disabled agent woven instrumentation via When debugging the |
Nice job digging into the details. My guess is we have some fragile instrumentation that starts a span in one method, assumes it is the active span and rather than maintain reference, retrieves the current active span and finishes it. This would probably imply that the span you're creating is being finished twice. It would be helpful to review the set of classes that are modified when you do have the instrumentation enabled. Set the log level to debug and search for lines like this in your log output:
You can also disable all the instrumentation as you did, but then selectively enable individual ones that you want to use until it stops working. |
Ok i'll try that, also really hard to debug the agent as it appears to rewrite the class package from |
Ok got them
|
@nhoughto great, thanks. If you want to build the agent locally, there's a gradle flag to disable the shadow package rename. Were you able to narrow down at all which integration might be causing the problems? Here are some to try:
(Those seem to be the only integrations that are triggering. Maybe start by re-enabling everything and disable those three and see if it still works.) One last piece of info... Could you provide a stacktrace for the point at which you call Also, any details you could provide as to what might be "underneath" or called by Thanks! |
So the custom tracing works until the JDBC integration is added (the disabling of it is removed 🤔 ).
|
@nhoughto I can't reproduce this and I can't figure out what is causing the problem. Perhaps you could provide a small sample app that demonstrates the issue? Thanks! |
Repro test could be hard, will need to unpick it from the rest of the app 😢 I'll put it on the list and see how hard it is, we are blocked by #429 anyway atm. |
Closing as there has been no activity on this issue in over a year. Please create a new issue if the problem still persists. |
Trying to get our APM going with some custom and agent woven instrumentation using a GlobalTracer, running in Java 8 on undertow servlet container. Our custom code is very similar to the example code:
But these custom events never appear in the APM UI, or the logs via
LoggingWriter
. Digging into your tracing code, it appearswrite()
is never being called for these traces in theexpireReference
method.because the
pendingReferenceCount
is always greater than 1 for custom traces, but it is 0 for agent woven instrumentation. Its not clear to me what this counter is aiming to achieve or how / when it gets incremented. Is this style of tracing (custom and auto agent) supported? Are there any gotchas? From the docs it looks like I only have to make sure to callclose()
on the span and things should work, as per the codeclose()
is definitely being called, but ends up in theexpireReferences
method inPendingTrace.java
and never gets written out.I can see the counter gets incremented in
registerContinuation
andregisterSpan
, and we are running in a servlet container so continuations are possible, I'm not sure what to try next.The text was updated successfully, but these errors were encountered: