Skip to content
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

Tracer debug logging #1066

Merged
merged 6 commits into from
Nov 21, 2022
Merged

Tracer debug logging #1066

merged 6 commits into from
Nov 21, 2022

Conversation

jasonjkeller
Copy link
Contributor

@jasonjkeller jasonjkeller commented Oct 31, 2022

Adds some additional logging to help troubleshoot Inconsistent state! tracer != last tracer errors.

Additional logging will appear when the following is set:

-Dnewrelic.config.log_level=finest 
-Dnewrelic.debug=true

Grep'ing the agent logs for Tracer Debug: should produce all of the debug log messages related to this issue, which shows how tracers are being created and processed.

For context, this issue occurs when the agent is handling some async activity and is adding tracers for each method call and popping tracers off the stack as each method call completes. The agent tracks what the first tracer (root tracer) is when the async activity started and by the end we would expect that that last tracer we pop off should be the root, but in this case it isn't, which means that the agent has lost track of the correct call stack into this async code. When the pointer to the tracer object at the top of the stack differs from the actual tracer object that gets popped off then the agent is in an inconsistent state. If this happens the agent discards the async information it was attempting to record and logs the inconsistent state error.

It could potentially be caused by an internal error in some instrumented code that causes the agent to exit early without properly handling it or if the agent loses track of the active transaction.

Copy link
Contributor

@tbradellis tbradellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jasonjkeller jasonjkeller merged commit 852e0cf into main Nov 21, 2022
@jasonjkeller jasonjkeller deleted the tracer-debug-logging branch November 21, 2022 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants