@opentelemetry/instrumentation-aws-sdk
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -48,26 +48,37 @@ "use strict"; | ||
this.responseHook = (response, span, tracer, config) => { | ||
var _a; | ||
const messages = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.Messages; | ||
if (messages) { | ||
const queueUrl = this.extractQueueUrl(response.request.commandInput); | ||
const queueName = this.extractQueueNameFromUrl(queueUrl); | ||
propagation_utils_1.pubsubPropagation.patchMessagesArrayToStartProcessSpans({ | ||
messages, | ||
parentContext: api_1.trace.setSpan(api_1.context.active(), span), | ||
tracer, | ||
messageToSpanDetails: (message) => ({ | ||
name: queueName !== null && queueName !== void 0 ? queueName : 'unknown', | ||
parentContext: api_1.propagation.extract(api_1.ROOT_CONTEXT, MessageAttributes_1.extractPropagationContext(message, config.sqsExtractContextPropagationFromPayload), MessageAttributes_1.contextGetter), | ||
attributes: { | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_SYSTEM]: 'aws.sqs', | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION]: queueName, | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MessagingDestinationKindValues.QUEUE, | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_MESSAGE_ID]: message.MessageId, | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_URL]: queueUrl, | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_OPERATION]: semantic_conventions_1.MessagingOperationValues.PROCESS, | ||
}, | ||
}), | ||
processHook: (span, message) => { var _a; return (_a = config.sqsProcessHook) === null || _a === void 0 ? void 0 : _a.call(config, span, { message }); }, | ||
}); | ||
propagation_utils_1.pubsubPropagation.patchArrayForProcessSpans(messages, tracer, api_1.context.active()); | ||
var _a, _b; | ||
switch (response.request.commandName) { | ||
case 'SendMessage': | ||
span.setAttribute(semantic_conventions_1.SemanticAttributes.MESSAGING_MESSAGE_ID, (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.MessageId); | ||
break; | ||
case 'SendMessageBatch': | ||
// TODO: How should this be handled? | ||
break; | ||
case 'ReceiveMessage': { | ||
const messages = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.Messages; | ||
if (messages) { | ||
const queueUrl = this.extractQueueUrl(response.request.commandInput); | ||
const queueName = this.extractQueueNameFromUrl(queueUrl); | ||
propagation_utils_1.pubsubPropagation.patchMessagesArrayToStartProcessSpans({ | ||
messages, | ||
parentContext: api_1.trace.setSpan(api_1.context.active(), span), | ||
tracer, | ||
messageToSpanDetails: (message) => ({ | ||
name: queueName !== null && queueName !== void 0 ? queueName : 'unknown', | ||
parentContext: api_1.propagation.extract(api_1.ROOT_CONTEXT, MessageAttributes_1.extractPropagationContext(message, config.sqsExtractContextPropagationFromPayload), MessageAttributes_1.contextGetter), | ||
attributes: { | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_SYSTEM]: 'aws.sqs', | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION]: queueName, | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MessagingDestinationKindValues.QUEUE, | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_MESSAGE_ID]: message.MessageId, | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_URL]: queueUrl, | ||
[semantic_conventions_1.SemanticAttributes.MESSAGING_OPERATION]: semantic_conventions_1.MessagingOperationValues.PROCESS, | ||
}, | ||
}), | ||
processHook: (span, message) => { var _a; return (_a = config.sqsProcessHook) === null || _a === void 0 ? void 0 : _a.call(config, span, { message }); }, | ||
}); | ||
propagation_utils_1.pubsubPropagation.patchArrayForProcessSpans(messages, tracer, api_1.context.active()); | ||
} | ||
break; | ||
} | ||
} | ||
@@ -74,0 +85,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.6.0"; | ||
export declare const VERSION = "0.7.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.6.0'; | ||
exports.VERSION = '0.7.0'; | ||
//# sourceMappingURL=version.js.map |
# Changelog | ||
## [0.7.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-aws-sdk-v0.6.0...instrumentation-aws-sdk-v0.7.0) (2022-05-14) | ||
### Features | ||
* add supported node versions for all packages ([#973](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/973)) ([baaacbd](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/baaacbdd35ca4baab0afae64647aa8c0380ee4b7)) | ||
* use Otel SDK 1.2/0.28 ([#984](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/984)) ([098c2ed](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/098c2ed6f9c5ab7bd865685018c0777245aab3b7)) | ||
### Bug Fixes | ||
* **instrumentation-aws-sdk:** sqs message id missing on send command ([#968](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/968)) ([8b36fe1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/8b36fe16abca0a6326d48e5a22fd9302f2936609)) | ||
* **sns-publish-test-v3:** add test for sns.publish for aws sdk v3 ([#1015](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1015)) ([0293d89](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/0293d897f789bdeb7b843f673be2c2dc62e16010)) | ||
### Dependencies | ||
* The following workspace dependencies were updated | ||
* dependencies | ||
* @opentelemetry/propagation-utils bumped from 0.27.0 to ^0.28.0 | ||
* devDependencies | ||
* @opentelemetry/contrib-test-utils bumped from 0.29.0 to ^0.30.0 | ||
## [0.6.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-aws-sdk-v0.5.1...instrumentation-aws-sdk-v0.6.0) (2022-03-14) | ||
@@ -4,0 +27,0 @@ |
{ | ||
"name": "@opentelemetry/instrumentation-aws-sdk", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "OpenTelemetry automatic instrumentation for the `aws-sdk` package", | ||
@@ -46,19 +46,20 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@opentelemetry/api": "^1.0.1" | ||
"@opentelemetry/api": "^1.0.0" | ||
}, | ||
"dependencies": { | ||
"@opentelemetry/core": "^1.0.0", | ||
"@opentelemetry/instrumentation": "^0.27.0", | ||
"@opentelemetry/propagation-utils": "^0.27.0", | ||
"@opentelemetry/instrumentation": "^0.28.0", | ||
"@opentelemetry/propagation-utils": "^0.28.0", | ||
"@opentelemetry/semantic-conventions": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@aws-sdk/client-dynamodb": "3.37.0", | ||
"@aws-sdk/client-lambda": "3.37.0", | ||
"@aws-sdk/client-s3": "3.37.0", | ||
"@aws-sdk/client-sqs": "3.37.0", | ||
"@aws-sdk/types": "3.37.0", | ||
"@opentelemetry/api": "1.0.1", | ||
"@opentelemetry/contrib-test-utils": "^0.29.0", | ||
"@opentelemetry/sdk-trace-base": "1.0.1", | ||
"@aws-sdk/client-dynamodb": "3.85.0", | ||
"@aws-sdk/client-lambda": "3.85.0", | ||
"@aws-sdk/client-s3": "3.85.0", | ||
"@aws-sdk/client-sns": "3.85.0", | ||
"@aws-sdk/client-sqs": "3.85.0", | ||
"@aws-sdk/types": "3.78.0", | ||
"@opentelemetry/api": "^1.0.0", | ||
"@opentelemetry/contrib-test-utils": "^0.30.0", | ||
"@opentelemetry/sdk-trace-base": "1.2.0", | ||
"@types/mocha": "8.2.3", | ||
@@ -81,5 +82,5 @@ "@types/node": "16.11.21", | ||
"engines": { | ||
"node": ">=8.5.0" | ||
"node": ">=12.0.0" | ||
}, | ||
"gitHead": "491588f7245e48268bea438cc475e87ae1ed8ad6" | ||
"gitHead": "f89da7d080d2aaecacd8728d647e8eff4c9248a9" | ||
} |
# OpenTelemetry aws-sdk Instrumentation for Node.js | ||
[![NPM Published Version][npm-img]][npm-url] | ||
[![dependencies][dependencies-image]][dependencies-url] | ||
[![devDependencies][devdependencies-image]][devdependencies-url] | ||
[![Apache License][license-image]][license-image] | ||
@@ -20,3 +18,3 @@ | ||
For further automatic instrumentation instruction see the [@opentelemetry/instrumentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation) package. | ||
For further automatic instrumentation instruction see the [@opentelemetry/instrumentation](https://www.npmjs.com/package/@opentelemetry/instrumentation) package. | ||
@@ -134,6 +132,3 @@ ```js | ||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat | ||
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=plugins%2Fnode%2Fopentelemetry-instrumentation-aws-sdk | ||
[devdependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-contrib.svg?path=plugins%2Fnode%2Fopentelemetry-instrumentation-aws-sdk&type=dev | ||
[devdependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=plugins%2Fnode%2Fopentelemetry-instrumentation-aws-sdk&type=dev | ||
[npm-url]: https://www.npmjs.com/package/@opentelemetry/instrumentation-aws-sdk | ||
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-aws-sdk.svg |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126396
1175
24
133
+ Added@opentelemetry/api-metrics@0.28.0(transitive)
+ Added@opentelemetry/instrumentation@0.28.0(transitive)
+ Added@opentelemetry/propagation-utils@0.28.0(transitive)
- Removed@opentelemetry/api-metrics@0.27.0(transitive)
- Removed@opentelemetry/instrumentation@0.27.0(transitive)
- Removed@opentelemetry/propagation-utils@0.27.0(transitive)