-
Notifications
You must be signed in to change notification settings - Fork 70
refactor(agent): cleanup guzzle instrumentation #498
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
base: dev
Are you sure you want to change the base?
Changes from 1 commit
d04bf87
4c98d5a
ca5c948
a20c93d
4b45445
734784e
48f8e9e
6ac5c13
d4dea40
566b26e
6a879ff
6222a51
29f4551
8065805
40ab8cf
f3ac653
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,16 +31,13 @@ extern char* nr_guzzle_create_async_context_name(const char* prefix, | |
| extern int nr_guzzle_in_call_stack(TSRMLS_D); | ||
|
|
||
| /* | ||
| * Purpose : Checks if the given object implements | ||
| * GuzzleHttp\Event\HasEmitterInterface. For a Client object, this | ||
| * indicates that the object is from Guzzle 4 or 5. | ||
| * Purpose: This function checks which guzzle version is being used by the object | ||
| * | ||
| * Params : 1. The object to check. | ||
| * | ||
| * Returns : Non-zero if the object does implement the interface; zero | ||
| * otherwise. | ||
| * | ||
| * Returns : A string indicating the guzzle version being used | ||
|
||
| */ | ||
| extern int nr_guzzle_does_zval_implement_has_emitter(zval* obj TSRMLS_DC); | ||
| extern char* nr_guzzle_version(zval* obj TSRMLS_DC); | ||
|
|
||
| /* | ||
| * Purpose : Adds a Guzzle Request object to the hashmap containing all active | ||
|
|
||
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.
Is this function still needed? If Guzzle library version is determined by a file name in
nr_execute_handle_library, and correctnr_guzzleX_enableis used to enable instrumentation, then why version specificnr_guzzleX_enablecalls the dispatch instrumentation (nr_guzzle_client_construct) instead of version specific instrumentationnr_guzzleX_client_construct?I know that this function existed before this PR but maybe this PR could improve our codebase and eliminate unnecessary code complexity.
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.
Great point Michal! This is performing an unnecessary extra step because we have already identified the correct version by determining the correct file name in nr_execute_handle_library and can instead call the specific guzzle instrumentation in nr_guzzleX_enable
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 have removed this function and now directly call the correct guzzle instrumentation inside of nr_guzzle_enable! 6a879ff