@opentelemetry/instrumentation-aws-sdk 0.47.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![NPM Published Version][npm-img]][npm-url]
4
4
  [![Apache License][license-image]][license-image]
5
5
 
6
- [component owners](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/component_owners.yml): @blumamir @jj22ee
6
+ [component owners](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/component_owners.yml): @blumamir @jj22ee @trivikr
7
7
 
8
8
  This module provides automatic instrumentation for the [`aws-sdk` v2](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/) and [`@aws-sdk` v3](https://github.com/aws/aws-sdk-js-v3) modules, which may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle.
9
9
 
@@ -61,7 +61,7 @@ class SnsServiceExtension {
61
61
  if (topicArn || targetArn) {
62
62
  const arn = topicArn !== null && topicArn !== void 0 ? topicArn : targetArn;
63
63
  try {
64
- return arn.substr(arn.lastIndexOf(':') + 1);
64
+ return arn.substring(arn.lastIndexOf(':') + 1);
65
65
  }
66
66
  catch (err) {
67
67
  return arn;
@@ -1 +1 @@
1
- {"version":3,"file":"sns.js","sourceRoot":"","sources":["../../../src/services/sns.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAAwE;AACxE,8EAK6C;AAM7C,2DAA+D;AAG/D,MAAa,mBAAmB;IAC9B,kBAAkB,CAChB,OAA0B,EAC1B,OAAoC;QAEpC,IAAI,QAAQ,GAAa,cAAQ,CAAC,MAAM,CAAC;QACzC,IAAI,QAAQ,GAAG,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC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,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,SAAS,CAAC;YAClC,IAAI;gBACF,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;aAC7C;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,GAAG,CAAC;aACZ;SACF;aAAM,IAAI,WAAW,EAAE;YACtB,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;IACH,CAAC;CACF;AA3ED,kDA2EC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Span, Tracer, SpanKind, Attributes } from '@opentelemetry/api';\nimport {\n MESSAGINGDESTINATIONKINDVALUES_TOPIC,\n SEMATTRS_MESSAGING_DESTINATION,\n SEMATTRS_MESSAGING_DESTINATION_KIND,\n SEMATTRS_MESSAGING_SYSTEM,\n} from '@opentelemetry/semantic-conventions';\nimport {\n NormalizedRequest,\n NormalizedResponse,\n AwsSdkInstrumentationConfig,\n} from '../types';\nimport { injectPropagationContext } from './MessageAttributes';\nimport { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nexport class SnsServiceExtension implements ServiceExtension {\n requestPreSpanHook(\n request: NormalizedRequest,\n _config: AwsSdkInstrumentationConfig\n ): RequestMetadata {\n let spanKind: SpanKind = SpanKind.CLIENT;\n let spanName = `SNS ${request.commandName}`;\n const spanAttributes: Attributes = {\n [SEMATTRS_MESSAGING_SYSTEM]: 'aws.sns',\n };\n\n if (request.commandName === 'Publish') {\n spanKind = SpanKind.PRODUCER;\n\n spanAttributes[SEMATTRS_MESSAGING_DESTINATION_KIND] =\n MESSAGINGDESTINATIONKINDVALUES_TOPIC;\n const { TopicArn, TargetArn, PhoneNumber } = request.commandInput;\n spanAttributes[SEMATTRS_MESSAGING_DESTINATION] =\n this.extractDestinationName(TopicArn, TargetArn, PhoneNumber);\n // ToDO: Use SEMATTRS_MESSAGING_DESTINATION_NAME when implemented\n spanAttributes['messaging.destination.name'] =\n TopicArn || TargetArn || PhoneNumber || 'unknown';\n\n spanName = `${\n PhoneNumber\n ? 'phone_number'\n : spanAttributes[SEMATTRS_MESSAGING_DESTINATION]\n } send`;\n }\n\n return {\n isIncoming: false,\n spanAttributes,\n spanKind,\n spanName,\n };\n }\n\n requestPostSpanHook(request: NormalizedRequest): void {\n if (request.commandName === 'Publish') {\n const origMessageAttributes =\n request.commandInput['MessageAttributes'] ?? {};\n if (origMessageAttributes) {\n request.commandInput['MessageAttributes'] = injectPropagationContext(\n origMessageAttributes\n );\n }\n }\n }\n\n responseHook(\n response: NormalizedResponse,\n span: Span,\n tracer: Tracer,\n config: AwsSdkInstrumentationConfig\n ): void {}\n\n extractDestinationName(\n topicArn: string,\n targetArn: string,\n phoneNumber: string\n ): string {\n if (topicArn || targetArn) {\n const arn = topicArn ?? targetArn;\n try {\n return arn.substr(arn.lastIndexOf(':') + 1);\n } catch (err) {\n return arn;\n }\n } else if (phoneNumber) {\n return phoneNumber;\n } else {\n return 'unknown';\n }\n }\n}\n"]}
1
+ {"version":3,"file":"sns.js","sourceRoot":"","sources":["../../../src/services/sns.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAAwE;AACxE,8EAK6C;AAM7C,2DAA+D;AAG/D,MAAa,mBAAmB;IAC9B,kBAAkB,CAChB,OAA0B,EAC1B,OAAoC;QAEpC,IAAI,QAAQ,GAAa,cAAQ,CAAC,MAAM,CAAC;QACzC,IAAI,QAAQ,GAAG,OAAO,OAAO,CAAC,WAAW,EAAE,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GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,SAAS,CAAC;YAClC,IAAI;gBACF,OAAO,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;aAChD;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,GAAG,CAAC;aACZ;SACF;aAAM,IAAI,WAAW,EAAE;YACtB,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;IACH,CAAC;CACF;AA3ED,kDA2EC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Span, Tracer, SpanKind, Attributes } from '@opentelemetry/api';\nimport {\n MESSAGINGDESTINATIONKINDVALUES_TOPIC,\n SEMATTRS_MESSAGING_DESTINATION,\n SEMATTRS_MESSAGING_DESTINATION_KIND,\n SEMATTRS_MESSAGING_SYSTEM,\n} from '@opentelemetry/semantic-conventions';\nimport {\n NormalizedRequest,\n NormalizedResponse,\n AwsSdkInstrumentationConfig,\n} from '../types';\nimport { injectPropagationContext } from './MessageAttributes';\nimport { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nexport class SnsServiceExtension implements ServiceExtension {\n requestPreSpanHook(\n request: NormalizedRequest,\n _config: AwsSdkInstrumentationConfig\n ): RequestMetadata {\n let spanKind: SpanKind = SpanKind.CLIENT;\n let spanName = `SNS ${request.commandName}`;\n const spanAttributes: Attributes = {\n [SEMATTRS_MESSAGING_SYSTEM]: 'aws.sns',\n };\n\n if (request.commandName === 'Publish') {\n spanKind = SpanKind.PRODUCER;\n\n spanAttributes[SEMATTRS_MESSAGING_DESTINATION_KIND] =\n MESSAGINGDESTINATIONKINDVALUES_TOPIC;\n const { TopicArn, TargetArn, PhoneNumber } = request.commandInput;\n spanAttributes[SEMATTRS_MESSAGING_DESTINATION] =\n this.extractDestinationName(TopicArn, TargetArn, PhoneNumber);\n // ToDO: Use SEMATTRS_MESSAGING_DESTINATION_NAME when implemented\n spanAttributes['messaging.destination.name'] =\n TopicArn || TargetArn || PhoneNumber || 'unknown';\n\n spanName = `${\n PhoneNumber\n ? 'phone_number'\n : spanAttributes[SEMATTRS_MESSAGING_DESTINATION]\n } send`;\n }\n\n return {\n isIncoming: false,\n spanAttributes,\n spanKind,\n spanName,\n };\n }\n\n requestPostSpanHook(request: NormalizedRequest): void {\n if (request.commandName === 'Publish') {\n const origMessageAttributes =\n request.commandInput['MessageAttributes'] ?? {};\n if (origMessageAttributes) {\n request.commandInput['MessageAttributes'] = injectPropagationContext(\n origMessageAttributes\n );\n }\n }\n }\n\n responseHook(\n response: NormalizedResponse,\n span: Span,\n tracer: Tracer,\n config: AwsSdkInstrumentationConfig\n ): void {}\n\n extractDestinationName(\n topicArn: string,\n targetArn: string,\n phoneNumber: string\n ): string {\n if (topicArn || targetArn) {\n const arn = topicArn ?? targetArn;\n try {\n return arn.substring(arn.lastIndexOf(':') + 1);\n } catch (err) {\n return arn;\n }\n } else if (phoneNumber) {\n return phoneNumber;\n } else {\n return 'unknown';\n }\n }\n}\n"]}
@@ -1,3 +1,3 @@
1
- export declare const PACKAGE_VERSION = "0.47.0";
1
+ export declare const PACKAGE_VERSION = "0.49.0";
2
2
  export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-aws-sdk";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -17,6 +17,6 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0;
19
19
  // this is autogenerated file, see scripts/version-update.js
20
- exports.PACKAGE_VERSION = '0.47.0';
20
+ exports.PACKAGE_VERSION = '0.49.0';
21
21
  exports.PACKAGE_NAME = '@opentelemetry/instrumentation-aws-sdk';
22
22
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,YAAY,GAAG,wCAAwC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.47.0';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-aws-sdk';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,YAAY,GAAG,wCAAwC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.49.0';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-aws-sdk';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/instrumentation-aws-sdk",
3
- "version": "0.47.0",
3
+ "version": "0.49.0",
4
4
  "description": "OpenTelemetry instrumentation for `aws-sdk` and `@aws-sdk/client-*` clients for various AWS services",
5
5
  "keywords": [
6
6
  "aws",
@@ -45,8 +45,8 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@opentelemetry/core": "^1.8.0",
48
- "@opentelemetry/instrumentation": "^0.55.0",
49
- "@opentelemetry/propagation-utils": "^0.30.13",
48
+ "@opentelemetry/instrumentation": "^0.57.0",
49
+ "@opentelemetry/propagation-utils": "^0.30.15",
50
50
  "@opentelemetry/semantic-conventions": "^1.27.0"
51
51
  },
52
52
  "devDependencies": {
@@ -58,7 +58,7 @@
58
58
  "@aws-sdk/client-sqs": "3.85.0",
59
59
  "@aws-sdk/types": "3.78.0",
60
60
  "@opentelemetry/api": "^1.3.0",
61
- "@opentelemetry/contrib-test-utils": "^0.43.0",
61
+ "@opentelemetry/contrib-test-utils": "^0.45.0",
62
62
  "@opentelemetry/sdk-trace-base": "^1.8.0",
63
63
  "@smithy/node-http-handler": "2.4.0",
64
64
  "@types/mocha": "8.2.3",
@@ -77,5 +77,5 @@
77
77
  "engines": {
78
78
  "node": ">=14"
79
79
  },
80
- "gitHead": "d0fb13557fac651424b095b0a48a5116407875b1"
80
+ "gitHead": "3ef5205e5353010184c69ff7b9f0f4830f0932de"
81
81
  }