Skip to content

feat(server-utils): Add orchestrion aws-sdk channel integration core#22142

Draft
andreiborza wants to merge 11 commits into
developfrom
ab/aws-sdk-server-utils
Draft

feat(server-utils): Add orchestrion aws-sdk channel integration core#22142
andreiborza wants to merge 11 commits into
developfrom
ab/aws-sdk-server-utils

Conversation

@andreiborza

@andreiborza andreiborza commented Jul 9, 2026

Copy link
Copy Markdown
Member

The integration subscribes to the orchestrion:<smithy-pkg>:send channels the transform injects into the smithy Client.prototype.send (@smithy/core, @smithy/smithy-client, @aws-sdk/smithy-client) and emits a client rpc span per command (rpc.system/rpc.method/rpc.service, cloud.region, request id metadata), with a distinct auto.aws.orchestrion.aws_sdk origin.

The per-service extension registry (span names, messaging/db/gen_ai attributes, trace propagation) starts empty and mirrors the OTel integration's ServiceExtension contract; the services are ported one group at a time in the follow-up PRs of this stack.

The OTel instrumentation was only added to the @sentry/aws-serverless SDK, but it is useable in other SDKS so the orchestrion version lives in server-utils now.

User-facing differences to the vendored OTel instrumentation

  • span origin is auto.aws.orchestrion.aws_sdk instead of auto.otel.aws
  • spans started after SQS ReceiveMessage parent to the surrounding span instead of the receive span; receive-to-consumer linkage uses span links (messaging PR)
  • outgoing SQS/SNS/Lambda trace propagation uses sentry-trace/baggage message attributes instead of W3C headers (messaging PR)
  • errored spans may carry aws.request.id/aws.request.extended_id where the OTel path missed them ($metadata fallback)

Part of #20946

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.6 kB - -
@sentry/browser - with treeshaking flags 26.04 kB - -
@sentry/browser (incl. Tracing) 46.35 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.14 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.13 kB - -
@sentry/browser (incl. Tracing, Replay) 85.62 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.26 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.33 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.99 kB - -
@sentry/browser (incl. Feedback) 44.78 kB - -
@sentry/browser (incl. sendFeedback) 32.4 kB - -
@sentry/browser (incl. FeedbackAsync) 37.53 kB - -
@sentry/browser (incl. Metrics) 28.68 kB - -
@sentry/browser (incl. Logs) 28.93 kB - -
@sentry/browser (incl. Metrics & Logs) 29.61 kB - -
@sentry/react 29.39 kB - -
@sentry/react (incl. Tracing) 48.62 kB - -
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.33 kB - -
@sentry/svelte 27.63 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.33 kB - -
CDN Bundle (incl. Logs, Metrics) 31.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.65 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.82 kB - -
CDN Bundle (incl. Tracing, Replay) 85.84 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.16 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.64 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.92 kB - -
CDN Bundle - uncompressed 89.33 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.07 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.03 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.05 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.76 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.24 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.98 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.93 kB - -
@sentry/nextjs (client) 51.17 kB - -
@sentry/sveltekit (client) 46.8 kB - -
@sentry/core/server 78.42 kB - -
@sentry/core/browser 64.77 kB - -
@sentry/node-core 62.73 kB +0.01% +2 B 🔺
@sentry/node 125.35 kB +0.01% +1 B 🔺
@sentry/node (incl. diagnostics channel injection) 140.57 kB +0.68% +940 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.73 kB -0.01% -1 B 🔽
@sentry/node - without tracing 74.04 kB -0.01% -1 B 🔽
@sentry/aws-serverless 83.26 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 181.47 kB - -
@sentry/cloudflare (withSentry) 448.98 kB - -

View base workflow run

@andreiborza andreiborza force-pushed the ab/aws-sdk-server-utils branch from 6b85478 to ca51438 Compare July 9, 2026 21:22
@andreiborza andreiborza changed the title feat(server-utils): Add orchestrion aws-sdk channel integration feat(server-utils): Add orchestrion aws-sdk channel integration core Jul 9, 2026
Comment thread packages/server-utils/src/integrations/tracing-channel/aws-sdk/index.ts Outdated
Comment thread packages/server-utils/src/integrations/tracing-channel/aws-sdk/constants.ts Outdated
Comment thread packages/server-utils/src/integrations/tracing-channel/aws-sdk/index.ts Outdated

@cursor cursor Bot 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.

Reviewed by Cursor Bugbot for commit 47a0d74. Configure here.

andreiborza and others added 11 commits July 10, 2026 14:11
Adds the core of an OTel-free, orchestrion diagnostics-channel implementation of
the aws-sdk (v3) instrumentation to `@sentry/server-utils`.

The integration subscribes to the `orchestrion:<smithy-pkg>:send` channels the
transform injects into the smithy `Client.prototype.send` (`@smithy/core`,
`@smithy/smithy-client`, `@aws-sdk/smithy-client`) and emits a client rpc span
per command (`rpc.system`/`rpc.method`/`rpc.service`, `cloud.region`, request id
metadata), with a distinct `auto.aws.orchestrion.aws-sdk` origin.

The per-service extension registry (span names, messaging/db/gen_ai attributes,
trace propagation) starts empty; the services are ported one group at a time in
follow-up PRs, mirroring the OTel integration's ServiceExtension contract.

Registered in `channelIntegrations`, so it is reachable via `@sentry/node`'s
`experimentalUseDiagnosticsChannelInjection()`. The `@sentry/aws-serverless`
swap follows at the top of the stack.

Part of #20946

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Peer channel integrations (mysql, ioredis, anthropic) set the op at span start.
Default to rpc, matching what the exporter infers from rpc.service, and let
service extensions override it via RequestMetadata.spanOp where inference
yields a different op.
The return-value override from the vendored OTel path cannot work through a
tracing channel: subscribers cannot replace the value the caller's promise
resolves with, so the subscriber rightly ignores any return value. Type
responseHook as void and document that response changes (e.g. wrapping a
stream) must mutate response.data in place, which is what the extensions do.
The region provider resolves asynchronously while send proceeds; when send
settled first (e.g. an early failure) the fire-and-forget backfill hit an
already-ended span and cloud.region was lost. deferSpanEnd now keeps the span
open until the region promise settles. In the common path the SDK awaits the
region internally before sending, so the promise is long settled and nothing
changes.
Span origins only allow letters, digits, underscores, and dots per segment;
matches the auto.ai.orchestrion.google_genai precedent.
The span is already started at that point; a sync throw bubbling into the
enclosing safe wrapper would discard the span without ending it, leaking an
open span for that AWS call.
Commands with all-optional members can be constructed without an input (e.g.
new ListBucketsCommand()); the OTel path traces those, so default the command
input to an empty object instead of skipping the span. All service extensions
already read the input defensively.
@andreiborza andreiborza force-pushed the ab/aws-sdk-server-utils branch from 52e07f6 to 69d0289 Compare July 10, 2026 12:14
Sign up for free to 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.

1 participant