-
Notifications
You must be signed in to change notification settings - Fork 69
feat(agent): Add RabbitMQ instrumentation using the php-amqplib library #1009
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
Conversation
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
Initial commit does the following: * Detect library via magic file * Detect package and version information. * Basic unit tests
|
Initial commit does the following: * Detect library via magic file * Detect package and version information. * Basic unit tests
2df782f
to
0b184ca
Compare
…ewrelic-php-agent into feat/rabbitmq_instrumentation
mfulb
reviewed
Jan 23, 2025
mfulb
reviewed
Jan 23, 2025
mfulb
reviewed
Jan 23, 2025
Test version detection when class exists but version const doesn't. Fixed typos.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1009 +/- ##
==========================================
- Coverage 78.03% 77.40% -0.64%
==========================================
Files 197 198 +1
Lines 27411 27715 +304
==========================================
+ Hits 21391 21453 +62
- Misses 6020 6262 +242
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
* Creates message segment on basic_publish call.
* While the RabbitMQ tutorial for using with the dockerized RabbitMQ setup * correctly and loads the PhpAmqpLib\\Channel\\AMQPChannel class in time for * the agent to wrap the instrumented functions, there are AWS MQ_BROKER * specific but valid scenarios where the PhpAmqpLib\\Channel\\AMQPChannel class * file does not explicitly load or does not load in time, and the instrumented * functions are NEVER wrapped regardless of how many times they are called in * one txn. Specifically, this centered around the very slight but impactful * differences when using the PhpAmqpLib\Connection\AMQPStreamConnection which * causes an explicit load of the AMQPChannel class/file and * PhpAmqpLib\Connection\AMQPSSLConnection which does NOT cause an explicit load * of the AMQPChannelclass/file. The following method is thus the only way to * ensure the class is loaded in time for the functions to be wrapped.
mfulb
reviewed
Jan 30, 2025
mfulb
reviewed
Jan 30, 2025
mfulb
reviewed
Jan 30, 2025
mfulb
reviewed
Jan 30, 2025
mfulb
reviewed
Jan 30, 2025
mfulb
reviewed
Jan 30, 2025
mfulb
reviewed
Jan 30, 2025
05422ea
to
ba45e6c
Compare
…ewrelic-php-agent into feat/rabbitmq_instrumentation
reverting a portion of previous PR feedback. It's okay if version remains null, the package function will then set it to library known, version unknown.
lavarou
reviewed
Feb 11, 2025
lavarou
previously approved these changes
Feb 11, 2025
mfulb
previously approved these changes
Feb 12, 2025
Co-authored-by: Michal Nowacki <[email protected]>
lavarou
approved these changes
Feb 12, 2025
mfulb
approved these changes
Feb 13, 2025
This was referenced Mar 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Most of the PR is basic instrumentation, retrieval of values and setting attributes or creating metrics and is very similar to patterns we've established in other instrumentation.
The DT header insertion logic is the trickiest bit since we are modifying the headers in flight. (look to drupal and laravel for similar logic).
Note: the DT header insertion logic, while trickiest, is something that can be turned off anytime by the user by setting newrelic.distributed_tracing_exclude_newrelic_header to true.
Initial commit does the following:
Subsequent commits:
Remaining: