Skip to content

feat(server-utils): Port SQS, SNS and Lambda aws-sdk extensions with trace propagation - #22165

Merged
andreiborza merged 3 commits into
ab/aws-sdk-servicesfrom
ab/aws-sdk-messaging
Jul 16, 2026
Merged

feat(server-utils): Port SQS, SNS and Lambda aws-sdk extensions with trace propagation#22165
andreiborza merged 3 commits into
ab/aws-sdk-servicesfrom
ab/aws-sdk-messaging

Conversation

@andreiborza

@andreiborzaandreiborza commented Jul 9, 2026

Copy link
Copy Markdown
Member

Ports the messaging service extensions from the OTel aws-sdk integration to the orchestrion channel integration and registers them in the service registry:

  • SQS: producer/consumer span kinds and names, messaging.* attributes, trace propagation into outgoing MessageAttributes (single and batch), and span links from received messages via the propagated headers
  • SNS: producer span kind/name for Publish, messaging.* and topic ARN attributes, trace propagation into MessageAttributes
  • Lambda: faas.* attributes for Invoke, trace propagation into the base64 ClientContext (respecting the 3583 byte cap)

Propagation writes Sentry-native sentry-trace/baggage headers derived from the request span instead of OTel propagation.inject, and the SQS receive side reads them back with propagationContextFromHeaders.

Part of #20946

@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from 5069f36 to 6abbb22CompareJuly 9, 2026 21:35
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from 6abbb22 to 1964abfCompareJuly 9, 2026 21:44
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from 1964abf to f024586CompareJuly 9, 2026 21:48
@github-actions

github-actionsBot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

PathSize% ChangeChange
@sentry/browser27.74 kB--
@sentry/browser - with treeshaking flags26.19 kB--
@sentry/browser (incl. Tracing)46.57 kB--
@sentry/browser (incl. Tracing + Span Streaming)48.36 kB--
@sentry/browser (incl. Tracing, Profiling)51.34 kB--
@sentry/browser (incl. Tracing, Replay)85.83 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags75.46 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)90.55 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)103.18 kB--
@sentry/browser (incl. Feedback)44.92 kB--
@sentry/browser (incl. sendFeedback)32.54 kB--
@sentry/browser (incl. FeedbackAsync)37.67 kB--
@sentry/browser (incl. Metrics)28.84 kB--
@sentry/browser (incl. Logs)29.07 kB--
@sentry/browser (incl. Metrics & Logs)29.76 kB--
@sentry/react29.54 kB--
@sentry/react (incl. Tracing)48.82 kB--
@sentry/vue33.17 kB--
@sentry/vue (incl. Tracing)48.55 kB--
@sentry/svelte27.77 kB--
CDN Bundle30.14 kB--
CDN Bundle (incl. Tracing)48.52 kB--
CDN Bundle (incl. Logs, Metrics)31.72 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)49.83 kB--
CDN Bundle (incl. Replay, Logs, Metrics)70.97 kB--
CDN Bundle (incl. Tracing, Replay)86.04 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)87.33 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)91.82 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)93.09 kB--
CDN Bundle - uncompressed89.85 kB--
CDN Bundle (incl. Tracing) - uncompressed146.66 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed94.56 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed150.64 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed219.28 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed265.86 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed269.82 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed279.56 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed283.52 kB--
@sentry/nextjs (client)51.38 kB--
@sentry/sveltekit (client)47 kB--
@sentry/core/server78.71 kB--
@sentry/core/browser65.08 kB--
@sentry/node-core63.21 kB+0.01%+1 B 🔺
@sentry/node125.45 kB--
@sentry/node (incl. diagnostics channel injection)145.67 kB+2.15%+3.07 kB 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection)70.03 kB-0.01%-2 B 🔽
@sentry/node/light51.33 kB+0.01%+1 B 🔺
@sentry/node - without tracing74.7 kB-0.01%-2 B 🔽
@sentry/aws-serverless83.92 kB--
@sentry/cloudflare (withSentry) - minified182.1 kB--
@sentry/cloudflare (withSentry)450.9 kB--

View base workflow run

@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from f024586 to 430affdCompareJuly 9, 2026 22:11
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from 430affd to d26e97fCompareJuly 9, 2026 22:13
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from d26e97f to 711b9bdCompareJuly 9, 2026 22:31
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch 2 times, most recently from 3f1cf4a to c43b14cCompareJuly 9, 2026 22:55
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from c43b14c to d993b9eCompareJuly 9, 2026 23:02
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from d993b9e to c2cad25CompareJuly 10, 2026 07:40
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from c2cad25 to 786f10cCompareJuly 10, 2026 12:14
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from 7671eef to 6f95d7cCompareJuly 15, 2026 13:21
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from 6f95d7c to 511baf5CompareJuly 15, 2026 13:37
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from 511baf5 to a528fedCompareJuly 15, 2026 13:40
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from a528fed to 511baf5CompareJuly 15, 2026 13:54
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from 511baf5 to 879987dCompareJuly 15, 2026 14:18
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch 2 times, most recently from 511baf5 to d9ae35dCompareJuly 15, 2026 15:18
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from d9ae35d to 0d5ff66CompareJuly 15, 2026 17:03
@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch 2 times, most recently from 7e8a838 to fe3ca8eCompareJuly 15, 2026 18:18
let spanAttributes: Record<string, unknown> = {};
let spanName: string | undefined;

switch (request.commandName) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: this looks a bit weird to me, why use a switch with a single case?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, this has been in the vendored otel instrumentation like this but I'll update to an if

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in d8bd9cf

span.setAttribute(MESSAGING_BATCH_MESSAGE_COUNT, messages.length);

for (const message of messages) {
const headers = extractPropagationHeaders(message);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: maybe this is a bit easier to read if we refactor the treatment of one message into a function?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in d8bd9cf

/** DynamoDB `db.system` value (an attribute value, not a key, so not covered by conventions). */
export const DB_SYSTEM_VALUE_DYNAMODB = 'dynamodb';

// Messaging (obsolete OTel convention with no `@sentry/conventions` export, kept for parity)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: will this change in v11 or do we keep as is?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can update this in v11, I'll add a todo/task.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added todo in d8bd9cf

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d8bd9cf. Configure here.

@andreiborza
andreiborzaforce-pushed the ab/aws-sdk-messaging branch from d8bd9cf to d5c1dc0CompareJuly 16, 2026 19:09
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@andreiborza@nicohrubec