-
Notifications
You must be signed in to change notification settings - Fork 621
Description
What version of OpenTelemetry are you using?
@opentelemetry/instrumentation-aws-sdk: "0.64.0",
What version of Node are you using?
v20.19.5
What did you do?
Due to new updates related to smithy (https://github.com/smithy-lang/smithy-typescript/releases/tag/%40smithy%2Fcore%403.18.0), dynamoDB, S3, etc, will throw error of :
Exception: Cannot read properties of undefined (reading '0')
TypeError: Cannot read properties of undefined (reading '0')
at NormalizedSchema.getSchema (/opt/nodejs/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js:323:15)
at NormalizedSchema.isListSchema (/opt/nodejs/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js:340:25)
at schemaLogFilter (/opt/nodejs/node_modules/@smithy/smithy-client/dist-cjs/index.js:121:10)
at (/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js:25:20)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
it causes no supports for @AWS-SDK > version 3.927
What did you expect to see?
Successful DynamoDB/S3 calls with correct OpenTelemetry spans, exactly as it worked before the AWS SDK upgrade.
What did you see instead?
All instrumented AWS SDK v3 calls fail with a cryptic Smithy TypeError originating from schemaLogFilter.
Reproduce:
import { DynamoDBClient, PutItemCommand } from "@aws-sdk/client-dynamodb";
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
import { AwsSdkInstrumentation } from "@opentelemetry/instrumentation-aws-sdk";
const provider = new NodeTracerProvider();
provider.register();
new AwsSdkInstrumentation().setTracerProvider(provider); // ← enabling this breaks everything
const client = new DynamoDBClient({});
await client.send(new PutItemCommand({
TableName: "test",
Item: { pk: { S: "123" }, data: { S: "hello" } }
}));