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.
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(agent): Add AWS Lambda Relationship #1023
base: dev
Are you sure you want to change the base?
feat(agent): Add AWS Lambda Relationship #1023
Changes from 13 commits
b51fbad
b106a2d
f078838
ffd9ca2
e6143db
18425ad
338cfb6
0b7efec
5c45a0e
b78c3bd
25475ef
65b607a
d25f773
b72ebc1
b4b8d4f
ad9005b
50aaa3c
fbf408f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 an empty string acceptable, or should this be checking for a valid, nonempty string instead with
nr_php_is_zval_non_empty_string
?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.
If it is empty, there is no harm in attaching it to the external params, but also no gain. added a check in b72ebc1
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.
instead of
if (nr_php_is_zval_valid_string(uri) && !nr_strempty(Z_STRVAL_P(uri)))
Just use
nr_php_is_zval_non_empty_string
which does both of those things.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.
changed in 50aaa3c
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.
Why isn't the
NR_PHP_USER_FN_THIS
macro used here?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.
This was leftover from testing about #1023 (comment). Using NR_PHP_USER_FN_THIS() in fbf408f
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 an empty string acceptable, or should this be checking for a valid, nonempty string instead with
nr_php_is_zval_non_empty_string
?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.
If it is empty, the regex will fail to capture anything and the function will return exit at that point.
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.
True, but looks like we get to at least here, which could be skipped if we used nr_php_is_zval_non_empty_string to check for both valid and not empty string instead of just valid string.
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.
changed in 50aaa3c
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 construct correct? Take a look at this example. The first argument to
nr_php_get_zval_object_property_with_class
is the object to extract the property from, and the second argument is the class entry for the context from which the property should be extracted. What is this code trying to do?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.
LambdaClient
extendsAwsClient
.region
exists on theAwsClient
, not theLambdaClient
. So if we wish to extractregion
fromthis
(which is aLambdaClient
), we must indicate the base class.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.
If the intent is to look for the
"region"
property either inthis
(which isAws\Lambda\LambdaClient
) and then fall back to looking for it inthis
's base class (which isAws\AwsClient
), then wouldn't it be safer to get thebase_class
like this:base_class = nr_php_find_class("aws\\awsclient");
?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 best strategy to ensure that the agent will be able to retrieve the region is to call
getRegion
method onthis
like this:region = nr_php_call(this, "getRegion");
It doesn't rely on any assumptions but rather on publicly available API of AWS SDK for PHP.