Skip to content

Commit 468222b

Browse files
authored
chore(aws): replace deprecated substr with substring (#2551)
1 parent d5215f3 commit 468222b

File tree

2 files changed

+5
-2
lines changed
  • plugins/node

2 files changed

+5
-2
lines changed

plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ export class AwsLambdaInstrumentation extends InstrumentationBase<AwsLambdaInstr
9090
}
9191

9292
const handler = path.basename(handlerDef);
93-
const moduleRoot = handlerDef.substr(0, handlerDef.length - handler.length);
93+
const moduleRoot = handlerDef.substring(
94+
0,
95+
handlerDef.length - handler.length
96+
);
9497

9598
const [module, functionName] = handler.split('.', 2);
9699

plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class SnsServiceExtension implements ServiceExtension {
9393
if (topicArn || targetArn) {
9494
const arn = topicArn ?? targetArn;
9595
try {
96-
return arn.substr(arn.lastIndexOf(':') + 1);
96+
return arn.substring(arn.lastIndexOf(':') + 1);
9797
} catch (err) {
9898
return arn;
9999
}

0 commit comments

Comments
 (0)