Skip to content

Commit 783f36b

Browse files
committed
Document that the channel-injection helper appends the full channel set
1 parent 677ea4c commit 783f36b

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

packages/aws-serverless/src/init.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ function shouldDisableLayerExtensionForProxy(): boolean {
5555
// If at some point we need to filter a node integration out for good, we need to make sure to also filter it out there.
5656
export function getDefaultIntegrations(options: Options): Integration[] {
5757
const integrations = [...getDefaultIntegrationsWithoutPerformance(), awsIntegration(), awsLambdaIntegration()];
58-
// If the app opted into diagnostics-channel injection, swap the OTel `Aws` integration for its
59-
// channel-based equivalent (registered in `@sentry/server-utils`). No-op otherwise.
58+
// If the app opted into diagnostics-channel injection, the OTel `Aws` integration is swapped for
59+
// its channel-based equivalent AND the full channel-integration set is appended (mysql, postgres,
60+
// express, ...), giving opted-in apps performance coverage this SDK's defaults otherwise omit.
61+
// No-op otherwise.
6062
return applyDiagnosticsChannelInjectionIntegrations(integrations, options);
6163
}
6264

packages/node/src/sdk/index.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ export function getDefaultIntegrations(options: Options): Integration[] {
4444

4545
/**
4646
* When the app opted into diagnostics-channel injection (via
47-
* `experimentalUseDiagnosticsChannelInjection()`) AND span recording is enabled, swap the
48-
* channel-based integrations in place of their OTel equivalents so the two don't both instrument the
49-
* same library. Otherwise returns `integrations` unchanged.
47+
* `experimentalUseDiagnosticsChannelInjection()`) AND span recording is enabled, drop the OTel
48+
* integrations that have a channel-based replacement and append the FULL channel-integration set,
49+
* so the two never both instrument the same library. Otherwise returns `integrations` unchanged.
5050
*
51-
* Every channel-based integration we ship today is a 1:1 replacement for an OTel performance/tracing
52-
* integration and produces nothing but spans, so this is gated on span recording. Exported so SDKs
53-
* that build their own default-integration set (e.g. `@sentry/aws-serverless`) can apply the same
54-
* swap instead of duplicating this logic.
51+
* Note the asymmetry: appended channel integrations are not limited to ones whose OTel counterpart
52+
* was in `integrations`. For `@sentry/node` that makes no difference (the incoming list carries the
53+
* whole OTel performance set), but a caller with a narrower list (e.g. `@sentry/aws-serverless`)
54+
* gains channel coverage for libraries it never shipped OTel integrations for. Channel integrations
55+
* produce nothing but spans, so this is gated on span recording. Exported so SDKs that build their
56+
* own default-integration set can apply the same logic instead of duplicating it.
5557
*/
5658
export function applyDiagnosticsChannelInjectionIntegrations(
5759
integrations: Integration[],

0 commit comments

Comments
 (0)