-
Notifications
You must be signed in to change notification settings - Fork 333
Adding Logging for JMS ITERATION Scope
#10632
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
Merged
gh-worker-dd-mergequeue-cf854d
merged 7 commits into
master
from
mhlidd/add_jms_logging
Feb 19, 2026
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d58e8d7
adding logging
mhlidd 1b7234d
adding wrapper to avoid bytebuddy issues
mhlidd 4b360cc
PR comments
mhlidd a1992da
Merge branch 'master' into mhlidd/add_jms_logging
mhlidd 38051a9
Merge branch 'master' into mhlidd/add_jms_logging
mhlidd c19cb84
adding log helper to helper class names
mhlidd 2b2852b
moving logger out of nested class
mhlidd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| package datadog.trace.core.scopemanager; | ||
|
|
||
| import static datadog.trace.api.ConfigDefaults.DEFAULT_ASYNC_PROPAGATING; | ||
| import static datadog.trace.api.telemetry.LogCollector.SEND_TELEMETRY; | ||
| import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; | ||
| import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; | ||
| import static datadog.trace.core.scopemanager.ContinuableScope.CONTEXT; | ||
|
|
@@ -238,15 +239,24 @@ public void closePrevious(final boolean finishSpan) { | |
|
|
||
| // close any immediately previous iteration scope | ||
| final ContinuableScope top = scopeStack.top; | ||
| if (top != null && top.source() == ITERATION) { | ||
| if (iterationKeepAlive > 0) { // skip depth check because cancelling is cheap | ||
| cancelRootIterationScopeCleanup(scopeStack, top); | ||
| } | ||
| top.close(); | ||
| scopeStack.cleanup(); | ||
| AgentSpan span = top.span(); | ||
| if (finishSpan && span != null) { | ||
| span.finishWithEndToEnd(); | ||
| if (top != null) { | ||
| if (top.source() == ITERATION) { | ||
| if (iterationKeepAlive > 0) { // skip depth check because cancelling is cheap | ||
| cancelRootIterationScopeCleanup(scopeStack, top); | ||
| } | ||
| top.close(); | ||
| scopeStack.cleanup(); | ||
| AgentSpan span = top.span(); | ||
| if (finishSpan && span != null) { | ||
| span.finishWithEndToEnd(); | ||
| } | ||
| } else { | ||
| log.debug( | ||
| SEND_TELEMETRY, | ||
| "Scope found at top of stack has source {} when we expect {}. Current span at the top of the stack {}.", | ||
| top, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of the source, it will output the scope and context. Did you mean to write "top.source()" instead? |
||
| ITERATION, | ||
| top.span()); | ||
| } | ||
| } | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
To minimize the change scope, you could keep this as is and add
else if (top!=null)instead.