Repository navigation
feat(aws-lambda): Add Lambda runtime resource attributes - #7941
pabloDeputter wants to merge 9 commits into
Conversation
abe3bfa to
f1f8c35
Compare
Coverage Results 📊✅ 56199 passed | ⏭️ 2872 skipped | Total: 59071 | Pass Rate: 95.14% | Execution Time: 155m 37s 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 25.00% (6 of 24 changed executable lines covered; target 80%). Changed files with executable lines (2)
Coverage diff@@ Coverage Diff @@
## master #7941 +/-##
==========================================
- Coverage 90.25% 90.00% -0.25%
==========================================
Files 202 197 -5
Tracked lines 26660 20983 -5677
Branches 9926 7208 -2718
==========================================
- Hits 24062 18885 -5177
+ Misses 2598 2098 -500
+ Partials 1510 1234 -276Generated by Coverage Action |
2060499 to
d5b8521
Compare
d5b8521 to
c191469
Compare
| return _lambda_metadata_cache[1] | ||
|
|
||
| # bearer token is required to prevent SSRF. | ||
| response = _lambda_metadata_http.request( |
There was a problem hiding this comment.
We can't make requests from the SDK. We need to only work with what we can intercept from the natural execution of a user's program without creating side effects like network or DB traffic that are not necessary for making the SDK work (e.g. sending events to Sentry).
Can we get this info from elsewhere? If not, let's not add it.
There was a problem hiding this comment.
ok yeah makes sense, didn't think about this.
It's not really available anywhere else, so I'll remove it.
f7d4930 to
295d5c3
Compare
Description
Expand aws-lambda instrumentation with extra resource identity and runtime metadata following OTel (https://opentelemetry.io/docs/specs/semconv/faas/aws-lambda/).
Changes:
sentry.kind=server.cloud.account.id, extracted from the invoked function ARN.cloud.resource_idis now normalized from the invoked function ARN; keep the original value inaws.lambda.invoked_arnand replace an alias with the resolved published version when the function is not$LATEST.cloud.regionis now extracted fromAWS_REGIONenv. var;faas.namefromAWS_LAMBDA_FUNCTION_NAME;faas.versionfromAWS_LAMBDA_FUNCTION_VERSIONfollowing OTel (https://opentelemetry.io/docs/specs/semconv/faas/aws-lambda/#resource-detector).sentry_sdkon every test setup (for easier local testing so runs don’t reuse old behavior from earlier implementation).capture_internal_exceptions()around attribute extraction so that a single failure does not affect the other instrumentation.Issues
Resolves #7931