-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add attrs for aws lambda entity #1227
base: main
Are you sure you want to change the base?
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1227 +/- ##
==========================================
+ Coverage 81.15% 81.18% +0.02%
==========================================
Files 200 200
Lines 21953 21969 +16
Branches 3479 3482 +3
==========================================
+ Hits 17816 17835 +19
+ Misses 2986 2983 -3
Partials 1151 1151 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
306924c
to
52e28fb
Compare
52e28fb
to
d0946b4
Compare
d0946b4
to
9033706
Compare
f9aa807
to
61c9ebb
Compare
…c-python-agent into support-lambda-entities
|
||
bound_args = bind_args(wrapped, args, kwargs) | ||
arn = bound_args["kwargs"].get("FunctionName") | ||
if arn and hasattr(instance, "meta") and hasattr(instance.meta, "events"): |
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 is just an object that I found that is also available inside the make_request. It's possible there is something better to attach this to but it was hard to find something that was accessible in both spots. I didn't want to attach it to the transaction as I thought there might be a conflict with that in async cases.
lambda_arn = getattr(instance._event_emitter, "_nr_lambda_arn", None) | ||
if lambda_arn: | ||
trace._add_agent_attribute("cloud.platform", "aws_lambda") | ||
trace._add_agent_attribute("cloud.resource_id", lambda_arn) |
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.
Are we confident this object isn't reused for future requests?
return iam.create_role( | ||
RoleName="my-role", | ||
AssumeRolePolicyDocument="some policy", | ||
Path="/my-path/", | ||
)[ | ||
"Role" | ||
]["Arn"] |
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.
return iam.create_role( | |
RoleName="my-role", | |
AssumeRolePolicyDocument="some policy", | |
Path="/my-path/", | |
)[ | |
"Role" | |
]["Arn"] | |
role = iam.create_role( | |
RoleName="my-role", | |
AssumeRolePolicyDocument="some policy", | |
Path="/my-path/", | |
) | |
return role["Role"]["Arn"] |
Maybe do this to make the formatter less insufferable
@@ -303,6 +303,7 @@ deps = | |||
external_botocore-botocore128: botocore<1.29 | |||
external_botocore-botocore0125: botocore<1.26 | |||
external_botocore: moto | |||
external_botocore: docker |
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.
What's the docker dependency for? Lambda/moto?
Overview
Add attrs for aws lambda entity linking.
The agent spec says: