Skip to content

instrumentation-aws-sdk: instrumentation not applying patch #3219

@wpessers

Description

@wpessers

What version of OpenTelemetry are you using?

@opentelemetry/instrumentation-aws-sdk: 0.62.0

What version of Node are you using?

22

What did you do?

We upgraded the @opentelemetry/instrumentation-aws-sdk to version 0.62.0 before the latest release of the opentelemetry-lambda nodejs layer.

What did you expect to see?

The aws sdk being patched and aws-sdk spans still being exported like before.

This is an example of DEBUG logs observed when using the lambda layer with the previous version 0.61.2 of the aws-sdk instrumentation:

OpenTelemetry wrapper init completed in 179 ms
OpenTelemetry loader init completed in 18 ms
DEBUG @opentelemetry/instrumentation-aws-sdk Applying instrumentation patch for module on require hook { module: '@smithy/middleware-stack', version: '4.1.1', baseDir: '/var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-stack' }
DEBUG @opentelemetry/instrumentation-aws-sdk propwrapping aws-sdk v3 constructStack
DEBUG @opentelemetry/instrumentation-aws-sdk Applying instrumentation patch for module on require hook { module: '@smithy/smithy-client', version: '4.6.4', baseDir: '/var/runtime/node_modules/@aws-sdk/node_modules/@smithy/smithy-client' }
WARN Failed extracting version /var/task/lambdas
DEBUG @opentelemetry/instrumentation-aws-lambda Applying instrumentation patch for nodejs module file on require hook { module: '/var/task/lambdas/controlMissionLambda.js', version: undefined, fileName: 'controlMissionLambda', baseDir: '/var/task/lambdas' }
DEBUG patch handler function

What did you see instead?

The aws sdk is no longer being patched and aws-sdk spans are no longer exported.

Logs for any version starting from 0.62.0 of the aws-sdk instrumentation are looking like this:

OpenTelemetry wrapper init completed in 150 ms
OpenTelemetry loader init completed in 9 ms
WARN Failed extracting version /var/task/lambdas
DEBUG @opentelemetry/instrumentation-aws-lambda Applying instrumentation patch for nodejs module file on require hook { module: '/var/task/lambdas/controlMissionLambda.js', version: undefined, fileName: 'controlMissionLambda', baseDir: '/var/task/lambdas' }
DEBUG patch handler function

Additional context

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpkg:instrumentation-aws-sdkpriority:p2Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions