-
Notifications
You must be signed in to change notification settings - Fork 544
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
feat: Add the ability to use span links when consuming a message amqp plugin #1972
Merged
JamieDanielson
merged 30 commits into
open-telemetry:main
from
McSick:feature/config-links-amqp-plugin
Jul 11, 2024
+724
−11
Merged
Changes from 20 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
21bf544
Add the ability to use span links in AMQP plugin
McSick 875e987
Remove console messages
McSick 5720402
Spelling fix
McSick 7e90336
add default behavior
McSick 8bbc88d
Merge branch 'main' into feature/config-links-amqp-plugin
McSick adcac3c
Merge branch 'main' into feature/config-links-amqp-plugin
McSick e8dece9
Merge branch 'main' into feature/config-links-amqp-plugin
McSick 16908aa
Add in tests for useLinks option
McSick f8ced07
Lint fix
McSick 0bd1f7f
Adding in extra info for future testers
McSick 96db167
Merge branch 'main' into feature/config-links-amqp-plugin
McSick 468f1dd
Merge branch 'main' into feature/config-links-amqp-plugin
McSick bce0bee
Merge branch 'main' into feature/config-links-amqp-plugin
McSick 19e123d
Merge branch 'main' into feature/config-links-amqp-plugin
McSick 94b6e2a
Merge branch 'main' into feature/config-links-amqp-plugin
McSick 3504de9
Merge branch 'main' into feature/config-links-amqp-plugin
McSick e388cf2
better code so not duplicate
McSick b6470a3
Merge remote-tracking branch 'upstream/main' into feature/config-link…
McSick 80dbd23
Updating tests to correct Semantic attributes
McSick 69ef4f6
Merge branch 'main' into feature/config-links-amqp-plugin
McSick e2e0160
Merge remote-tracking branch 'upstream/main' into feature/config-link…
McSick aeac819
Update based on suggestion
McSick e5e7d93
update suggestion
McSick b33b4bc
Merge branch 'main' into feature/config-links-amqp-plugin
McSick 39068db
Merge branch 'main' into feature/config-links-amqp-plugin
McSick eaf88f8
Merge branch 'main' into feature/config-links-amqp-plugin
McSick fc5139a
Update plugins/node/instrumentation-amqplib/README.md
JamieDanielson 1fca93a
appease linter
JamieDanielson c5300b7
Merge branch 'main' into feature/config-links-amqp-plugin
JamieDanielson 9184cc3
Merge branch 'main' into feature/config-links-amqp-plugin
JamieDanielson 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 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 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 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 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
Oops, something went wrong.
Oops, something went wrong.
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.
the 2 cases in the if-else contains some duplication.
WDYT about preparing the
links
array only once (with 0 or 1 elements) and theparent
based on the instrumentation configuration, then just invokingself.tracer.startSpan
once with these values? or at least calculate theattributes
once, outside the if-elseThere 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.
Would a null parent be fine in this instance? Because with the config option, the parentcontext should not exists. If that's fine, then I can make those changes.
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.
undefined
is fine. It's the default anywayThere 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'd do something like this
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.
@McSick looks like you ended up making the change for this, albeit a bit more verbose. I think it achieves the same thing though. As a nit I tend to lean toward the more succinct version but non blocking.
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 had to change it a little as parentContext was used deeper in the code so I wanted to explicitly make it undefined in this instance so the trace was not continued.