Repository navigation
feat(aws-lambda): Detect Lambda triggers - #8222
Draft
sentry-junior[bot] wants to merge 4 commits into
Draft
sentry-junior[bot] wants to merge 4 commits into
sentry-junior[bot] wants to merge 4 commits into
Conversation
Classify the delivered event into faas.trigger: http (API Gateway, function URLs, ALB, CloudFront, AppSync), pubsub (SQS, SNS, Kinesis, Kafka, MQ, SES, EventBridge), datasource (S3, DynamoDB Streams, DocumentDB), timer (EventBridge schedules) or other. The trigger is read from the event envelope, never from its payload. messaging.batch.message_count is now only set for messaging deliveries, with the number of delivered messages. Co-Authored-By: Johannes Daxböck <114897+dingsdax@users.noreply.github.com>
Contributor
Coverage Results 📊✅ 57699 passed | ⏭️ 2979 skipped | Total: 60678 | Pass Rate: 95.09% | Execution Time: 158m 16s 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 26.47% (9 of 34 changed executable lines covered; target 80%). Changed files with executable lines (3)
Coverage diff@@ Coverage Diff @@
## master #8222 +/-##
==========================================
- Coverage 90.35% 90.09% -0.26%
==========================================
Files 203 199 -4
Tracked lines 26931 21425 -5506
Branches 10058 7422 -2636
==========================================
- Hits 24331 19301 -5030
+ Misses 2600 2124 -476
+ Partials 1517 1240 -277Generated by Coverage Action |
…a span Keep the count on messaging spans only (boto3 receive and batch-send spans, and queue.process for SQS/SNS triggers), as in the OTel messaging conventions and the JS SDK. This drops the batch counting for Kafka, MQ and RabbitMQ deliveries, and matches #8219 so both PRs change these lines the same way. Co-Authored-By: johdax <114897+dingsdax@users.noreply.github.com>
…r/aws-lambda-trigger Co-Authored-By: Johannes Daxböck <114897+dingsdax@users.noreply.github.com>
Each case is a SAM invoke. The removed cases only checked other keys of the same lookup table. Co-Authored-By: Johannes Daxböck <114897+dingsdax@users.noreply.github.com>
This branch has not been deployed
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
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.
Description
Sets
faas.triggeron the Lambda span based on the shape of the delivered event:http: API Gateway REST/HTTP, function URLs, ALB, CloudFront, AppSyncpubsub: SQS, SNS, Kinesis, Kafka, MQ, SES, EventBridgedatasource: S3, DynamoDB Streams, DocumentDBtimer: EventBridge schedulesother: anything elseThe trigger is read from the event envelope, never from its payload.
test_triggerhas one case per code path. Other event sources use the same lookup table, so they have no extra cases.messaging.batch.message_countis removed from the Lambda span, the same way as in #8229. The count stays on messaging spans only: boto3 receive and batch-send spans, andqueue.processfor SQS/SNS triggers (#8223). This repeats #8229's change because this stack is based on #8117, not on #8229. Once #8229 lands, the repeated lines merge cleanly or can be dropped.This is Pablo's code from
pablo/aws-lambda-trigger, without his batch counting for the invocation span. It's the second of three stacked drafts (#8221 → this →queue.process).Issues
faas.triggerpart; the per-source attributes in the issue aren't in this PR)via @dingsdax.
--
View Session [Sentry]