Socket
Socket
Sign inDemoInstall

@opentelemetry/instrumentation-aws-sdk

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-aws-sdk - npm Package Compare versions

Comparing version 0.40.0 to 0.41.0

4

build/src/aws-sdk.d.ts
import { AwsSdkInstrumentationConfig } from './types';
import { InstrumentationBase, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation';
export declare class AwsInstrumentation extends InstrumentationBase<any> {
export declare class AwsInstrumentation extends InstrumentationBase {
static readonly component = "aws-sdk";

@@ -9,3 +9,3 @@ protected _config: AwsSdkInstrumentationConfig;

setConfig(config?: AwsSdkInstrumentationConfig): void;
protected init(): InstrumentationModuleDefinition<any>[];
protected init(): InstrumentationModuleDefinition[];
protected patchV3ConstructStack(moduleExports: any, moduleVersion?: string): any;

@@ -12,0 +12,0 @@ protected unpatchV3ConstructStack(moduleExports: any): any;

@@ -44,6 +44,3 @@ "use strict";

// so we are patching the MiddlewareStack.js file directly to get around it.
const v3MiddlewareStack = new instrumentation_1.InstrumentationNodeModuleDefinition('@aws-sdk/middleware-stack', ['^3.1.0'], undefined, undefined, [
v3MiddlewareStackFileOldVersions,
v3MiddlewareStackFileNewVersions,
]);
const v3MiddlewareStack = new instrumentation_1.InstrumentationNodeModuleDefinition('@aws-sdk/middleware-stack', ['^3.1.0'], undefined, undefined, [v3MiddlewareStackFileOldVersions, v3MiddlewareStackFileNewVersions]);
// Patch for @smithy/middleware-stack for @aws-sdk/* packages v3.363.0+.

@@ -74,3 +71,2 @@ // As of @smithy/middleware-stack@2.1.0 `constructStack` is only available

patchV3ConstructStack(moduleExports, moduleVersion) {
api_1.diag.debug('aws-sdk instrumentation: applying patch to aws-sdk v3 constructStack');
this._wrap(moduleExports, 'constructStack', this._getV3ConstructStackPatch.bind(this, moduleVersion));

@@ -80,3 +76,2 @@ return moduleExports;

unpatchV3ConstructStack(moduleExports) {
api_1.diag.debug('aws-sdk instrumentation: applying unpatch to aws-sdk v3 constructStack');
this._unwrap(moduleExports, 'constructStack');

@@ -86,3 +81,2 @@ return moduleExports;

patchV3SmithyClient(moduleExports) {
api_1.diag.debug('aws-sdk instrumentation: applying patch to aws-sdk v3 client send');
this._wrap(moduleExports.Client.prototype, 'send', this._getV3SmithyClientSendPatch.bind(this));

@@ -92,3 +86,2 @@ return moduleExports;

unpatchV3SmithyClient(moduleExports) {
api_1.diag.debug('aws-sdk instrumentation: applying patch to aws-sdk v3 constructStack');
this._unwrap(moduleExports.Client.prototype, 'send');

@@ -98,3 +91,2 @@ return moduleExports;

patchV2(moduleExports, moduleVersion) {
api_1.diag.debug(`aws-sdk instrumentation: applying patch to ${AwsInstrumentation.component}`);
this.unpatchV2(moduleExports);

@@ -186,3 +178,3 @@ this._wrap(moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Request.prototype, 'send', this._getRequestSendPatch.bind(this, moduleVersion));

if (httpStatusCode) {
span.setAttribute(semantic_conventions_1.SemanticAttributes.HTTP_STATUS_CODE, httpStatusCode);
span.setAttribute(semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE, httpStatusCode);
}

@@ -264,3 +256,3 @@ span.end();

if (httpStatusCode) {
span.setAttribute(semantic_conventions_1.SemanticAttributes.HTTP_STATUS_CODE, httpStatusCode);
span.setAttribute(semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE, httpStatusCode);
}

@@ -267,0 +259,0 @@ const extendedRequestId = (_f = (_e = response.output) === null || _e === void 0 ? void 0 : _e.$metadata) === null || _f === void 0 ? void 0 : _f.extendedRequestId;

@@ -32,5 +32,5 @@ "use strict";

const spanAttributes = {
[semantic_conventions_1.SemanticAttributes.DB_SYSTEM]: semantic_conventions_1.DbSystemValues.DYNAMODB,
[semantic_conventions_1.SemanticAttributes.DB_NAME]: (_a = normalizedRequest.commandInput) === null || _a === void 0 ? void 0 : _a.TableName,
[semantic_conventions_1.SemanticAttributes.DB_OPERATION]: operation,
[semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_DYNAMODB,
[semantic_conventions_1.SEMATTRS_DB_NAME]: (_a = normalizedRequest.commandInput) === null || _a === void 0 ? void 0 : _a.TableName,
[semantic_conventions_1.SEMATTRS_DB_OPERATION]: operation,
};

@@ -41,3 +41,3 @@ if (config.dynamoDBStatementSerializer) {

if (typeof sanitizedStatement === 'string') {
spanAttributes[semantic_conventions_1.SemanticAttributes.DB_STATEMENT] = sanitizedStatement;
spanAttributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = sanitizedStatement;
}

@@ -54,3 +54,3 @@ }

// single table name returned for operations like CreateTable
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_TABLE_NAMES] = [
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES] = [
normalizedRequest.commandInput.TableName,

@@ -60,3 +60,3 @@ ];

else if ((_c = normalizedRequest.commandInput) === null || _c === void 0 ? void 0 : _c.RequestItems) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_TABLE_NAMES] = Object.keys(normalizedRequest.commandInput.RequestItems);
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES] = Object.keys(normalizedRequest.commandInput.RequestItems);
}

@@ -66,5 +66,5 @@ if (operation === 'CreateTable' || operation === 'UpdateTable') {

if ((_d = normalizedRequest.commandInput) === null || _d === void 0 ? void 0 : _d.ProvisionedThroughput) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_PROVISIONED_READ_CAPACITY] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY] =
normalizedRequest.commandInput.ProvisionedThroughput.ReadCapacityUnits;
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY] =
normalizedRequest.commandInput.ProvisionedThroughput.WriteCapacityUnits;

@@ -77,3 +77,3 @@ }

if ((_e = normalizedRequest.commandInput) === null || _e === void 0 ? void 0 : _e.ConsistentRead) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_CONSISTENT_READ] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ] =
normalizedRequest.commandInput.ConsistentRead;

@@ -84,3 +84,3 @@ }

if ((_f = normalizedRequest.commandInput) === null || _f === void 0 ? void 0 : _f.ProjectionExpression) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_PROJECTION] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_PROJECTION] =
normalizedRequest.commandInput.ProjectionExpression;

@@ -91,6 +91,8 @@ }

if ((_g = normalizedRequest.commandInput) === null || _g === void 0 ? void 0 : _g.GlobalSecondaryIndexes) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES] = this.toArray(normalizedRequest.commandInput.GlobalSecondaryIndexes).map((x) => JSON.stringify(x));
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES] =
this.toArray(normalizedRequest.commandInput.GlobalSecondaryIndexes).map((x) => JSON.stringify(x));
}
if ((_h = normalizedRequest.commandInput) === null || _h === void 0 ? void 0 : _h.LocalSecondaryIndexes) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES] = this.toArray(normalizedRequest.commandInput.LocalSecondaryIndexes).map((x) => JSON.stringify(x));
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES] =
this.toArray(normalizedRequest.commandInput.LocalSecondaryIndexes).map((x) => JSON.stringify(x));
}

@@ -102,3 +104,3 @@ }

if ((_j = normalizedRequest.commandInput) === null || _j === void 0 ? void 0 : _j.Limit) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_LIMIT] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_LIMIT] =
normalizedRequest.commandInput.Limit;

@@ -109,3 +111,3 @@ }

if ((_k = normalizedRequest.commandInput) === null || _k === void 0 ? void 0 : _k.ExclusiveStartTableName) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_EXCLUSIVE_START_TABLE] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE] =
normalizedRequest.commandInput.ExclusiveStartTableName;

@@ -116,11 +118,11 @@ }

if ((_l = normalizedRequest.commandInput) === null || _l === void 0 ? void 0 : _l.ScanIndexForward) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_SCAN_FORWARD] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD] =
normalizedRequest.commandInput.ScanIndexForward;
}
if ((_m = normalizedRequest.commandInput) === null || _m === void 0 ? void 0 : _m.IndexName) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_INDEX_NAME] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_INDEX_NAME] =
normalizedRequest.commandInput.IndexName;
}
if ((_o = normalizedRequest.commandInput) === null || _o === void 0 ? void 0 : _o.Select) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_SELECT] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_SELECT] =
normalizedRequest.commandInput.Select;

@@ -131,15 +133,15 @@ }

if ((_p = normalizedRequest.commandInput) === null || _p === void 0 ? void 0 : _p.Segment) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_SEGMENT] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_SEGMENT] =
(_q = normalizedRequest.commandInput) === null || _q === void 0 ? void 0 : _q.Segment;
}
if ((_r = normalizedRequest.commandInput) === null || _r === void 0 ? void 0 : _r.TotalSegments) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_TOTAL_SEGMENTS] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS] =
(_s = normalizedRequest.commandInput) === null || _s === void 0 ? void 0 : _s.TotalSegments;
}
if ((_t = normalizedRequest.commandInput) === null || _t === void 0 ? void 0 : _t.IndexName) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_INDEX_NAME] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_INDEX_NAME] =
normalizedRequest.commandInput.IndexName;
}
if ((_u = normalizedRequest.commandInput) === null || _u === void 0 ? void 0 : _u.Select) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_SELECT] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_SELECT] =
normalizedRequest.commandInput.Select;

@@ -150,7 +152,8 @@ }

if ((_v = normalizedRequest.commandInput) === null || _v === void 0 ? void 0 : _v.AttributeDefinitions) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS] =
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS] =
this.toArray(normalizedRequest.commandInput.AttributeDefinitions).map((x) => JSON.stringify(x));
}
if ((_w = normalizedRequest.commandInput) === null || _w === void 0 ? void 0 : _w.GlobalSecondaryIndexUpdates) {
spanAttributes[semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES] = this.toArray(normalizedRequest.commandInput.GlobalSecondaryIndexUpdates).map((x) => JSON.stringify(x));
spanAttributes[semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES] =
this.toArray(normalizedRequest.commandInput.GlobalSecondaryIndexUpdates).map((x) => JSON.stringify(x));
}

@@ -168,15 +171,15 @@ }

if ((_a = response.data) === null || _a === void 0 ? void 0 : _a.ConsumedCapacity) {
span.setAttribute(semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_CONSUMED_CAPACITY, toArray(response.data.ConsumedCapacity).map((x) => JSON.stringify(x)));
span.setAttribute(semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY, toArray(response.data.ConsumedCapacity).map((x) => JSON.stringify(x)));
}
if ((_b = response.data) === null || _b === void 0 ? void 0 : _b.ItemCollectionMetrics) {
span.setAttribute(semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_ITEM_COLLECTION_METRICS, this.toArray(response.data.ItemCollectionMetrics).map((x) => JSON.stringify(x)));
span.setAttribute(semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, this.toArray(response.data.ItemCollectionMetrics).map((x) => JSON.stringify(x)));
}
if ((_c = response.data) === null || _c === void 0 ? void 0 : _c.TableNames) {
span.setAttribute(semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_TABLE_COUNT, (_d = response.data) === null || _d === void 0 ? void 0 : _d.TableNames.length);
span.setAttribute(semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT, (_d = response.data) === null || _d === void 0 ? void 0 : _d.TableNames.length);
}
if ((_e = response.data) === null || _e === void 0 ? void 0 : _e.Count) {
span.setAttribute(semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_COUNT, (_f = response.data) === null || _f === void 0 ? void 0 : _f.Count);
span.setAttribute(semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_COUNT, (_f = response.data) === null || _f === void 0 ? void 0 : _f.Count);
}
if ((_g = response.data) === null || _g === void 0 ? void 0 : _g.ScannedCount) {
span.setAttribute(semantic_conventions_1.SemanticAttributes.AWS_DYNAMODB_SCANNED_COUNT, (_h = response.data) === null || _h === void 0 ? void 0 : _h.ScannedCount);
span.setAttribute(semantic_conventions_1.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT, (_h = response.data) === null || _h === void 0 ? void 0 : _h.ScannedCount);
}

@@ -183,0 +186,0 @@ }

@@ -49,8 +49,7 @@ "use strict";

spanAttributes = {
[semantic_conventions_1.SemanticAttributes.FAAS_INVOKED_NAME]: functionName,
[semantic_conventions_1.SemanticAttributes.FAAS_INVOKED_PROVIDER]: 'aws',
[semantic_conventions_1.SEMATTRS_FAAS_INVOKED_NAME]: functionName,
[semantic_conventions_1.SEMATTRS_FAAS_INVOKED_PROVIDER]: 'aws',
};
if (request.region) {
spanAttributes[semantic_conventions_1.SemanticAttributes.FAAS_INVOKED_REGION] =
request.region;
spanAttributes[semantic_conventions_1.SEMATTRS_FAAS_INVOKED_REGION] = request.region;
}

@@ -71,3 +70,3 @@ spanName = `${functionName} ${LambdaCommands.Invoke}`;

{
span.setAttribute(semantic_conventions_1.SemanticAttributes.FAAS_EXECUTION, response.requestId);
span.setAttribute(semantic_conventions_1.SEMATTRS_FAAS_EXECUTION, response.requestId);
}

@@ -74,0 +73,0 @@ break;

@@ -27,12 +27,12 @@ "use strict";

const spanAttributes = {
[semantic_conventions_1.SemanticAttributes.MESSAGING_SYSTEM]: 'aws.sns',
[semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: 'aws.sns',
};
if (request.commandName === 'Publish') {
spanKind = api_1.SpanKind.PRODUCER;
spanAttributes[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION_KIND] =
semantic_conventions_1.MessagingDestinationKindValues.TOPIC;
spanAttributes[semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND] =
semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_TOPIC;
const { TopicArn, TargetArn, PhoneNumber } = request.commandInput;
spanAttributes[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION] =
spanAttributes[semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION] =
this.extractDestinationName(TopicArn, TargetArn, PhoneNumber);
// ToDO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when implemented
// ToDO: Use SEMATTRS_MESSAGING_DESTINATION_NAME when implemented
spanAttributes['messaging.destination.name'] =

@@ -42,3 +42,3 @@ TopicArn || TargetArn || PhoneNumber || 'unknown';

? 'phone_number'
: spanAttributes[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION]} send`;
: spanAttributes[semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]} send`;
}

@@ -45,0 +45,0 @@ return {

@@ -54,3 +54,3 @@ "use strict";

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);
span.setAttribute(semantic_conventions_1.SEMATTRS_MESSAGING_MESSAGE_ID, (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.MessageId);
break;

@@ -73,8 +73,8 @@ case 'SendMessageBatch':

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,
[semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: 'aws.sqs',
[semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: queueName,
[semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_QUEUE,
[semantic_conventions_1.SEMATTRS_MESSAGING_MESSAGE_ID]: message.MessageId,
[semantic_conventions_1.SEMATTRS_MESSAGING_URL]: queueUrl,
[semantic_conventions_1.SEMATTRS_MESSAGING_OPERATION]: semantic_conventions_1.MESSAGINGOPERATIONVALUES_PROCESS,
},

@@ -108,6 +108,6 @@ }),

const spanAttributes = {
[semantic_conventions_1.SemanticAttributes.MESSAGING_SYSTEM]: 'aws.sqs',
[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MessagingDestinationKindValues.QUEUE,
[semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION]: queueName,
[semantic_conventions_1.SemanticAttributes.MESSAGING_URL]: queueUrl,
[semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: 'aws.sqs',
[semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_QUEUE,
[semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: queueName,
[semantic_conventions_1.SEMATTRS_MESSAGING_URL]: queueUrl,
};

@@ -121,4 +121,4 @@ let isIncoming = false;

spanName = `${queueName} receive`;
spanAttributes[semantic_conventions_1.SemanticAttributes.MESSAGING_OPERATION] =
semantic_conventions_1.MessagingOperationValues.RECEIVE;
spanAttributes[semantic_conventions_1.SEMATTRS_MESSAGING_OPERATION] =
semantic_conventions_1.MESSAGINGOPERATIONVALUES_RECEIVE;
request.commandInput.MessageAttributeNames =

@@ -125,0 +125,0 @@ (0, MessageAttributes_1.addPropagationFieldsToAttributeNames)(request.commandInput.MessageAttributeNames, api_1.propagation.fields());

import { NormalizedRequest } from './types';
import { Context, SpanAttributes } from '@opentelemetry/api';
import { Attributes, Context } from '@opentelemetry/api';
export declare const removeSuffixFromStringIfExists: (str: string, suffixToRemove: string) => string;
export declare const normalizeV2Request: (awsV2Request: any) => NormalizedRequest;
export declare const normalizeV3Request: (serviceName: string, commandNameWithSuffix: string, commandInput: Record<string, any>, region: string | undefined) => NormalizedRequest;
export declare const extractAttributesFromNormalizedRequest: (normalizedRequest: NormalizedRequest) => SpanAttributes;
export declare const extractAttributesFromNormalizedRequest: (normalizedRequest: NormalizedRequest) => Attributes;
export declare const bindPromise: <T = unknown>(target: Promise<T>, contextForCallbacks: Context, rebindCount?: number) => Promise<T>;
//# sourceMappingURL=utils.d.ts.map

@@ -37,5 +37,5 @@ "use strict";

return {
[semantic_conventions_1.SemanticAttributes.RPC_SYSTEM]: 'aws-api',
[semantic_conventions_1.SemanticAttributes.RPC_METHOD]: normalizedRequest.commandName,
[semantic_conventions_1.SemanticAttributes.RPC_SERVICE]: normalizedRequest.serviceName,
[semantic_conventions_1.SEMATTRS_RPC_SYSTEM]: 'aws-api',
[semantic_conventions_1.SEMATTRS_RPC_METHOD]: normalizedRequest.commandName,
[semantic_conventions_1.SEMATTRS_RPC_SERVICE]: normalizedRequest.serviceName,
[enums_1.AttributeNames.AWS_REGION]: normalizedRequest.region,

@@ -42,0 +42,0 @@ };

@@ -1,2 +0,2 @@

export declare const VERSION = "0.40.0";
export declare const VERSION = "0.41.0";
//# sourceMappingURL=version.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.40.0';
exports.VERSION = '0.41.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/instrumentation-aws-sdk",
"version": "0.40.0",
"version": "0.41.0",
"description": "OpenTelemetry automatic instrumentation for the `aws-sdk` package",

@@ -48,5 +48,5 @@ "keywords": [

"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/propagation-utils": "^0.30.8",
"@opentelemetry/semantic-conventions": "^1.0.0"
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/propagation-utils": "^0.30.9",
"@opentelemetry/semantic-conventions": "^1.22.0"
},

@@ -61,3 +61,3 @@ "devDependencies": {

"@opentelemetry/api": "^1.3.0",
"@opentelemetry/contrib-test-utils": "^0.38.0",
"@opentelemetry/contrib-test-utils": "^0.39.0",
"@opentelemetry/sdk-trace-base": "^1.8.0",

@@ -82,3 +82,3 @@ "@types/mocha": "8.2.3",

},
"gitHead": "17a0bc1da3baa472ba9b867eee3c60730cc130fb"
"gitHead": "96a87b48934f0afcf1fe637eed6704f35bd8e973"
}

@@ -120,2 +120,50 @@ # OpenTelemetry aws-sdk Instrumentation for Node.js

## Semantic Conventions
This package uses `@opentelemetry/semantic-conventions` version `1.22+`, which implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md)
Attributes collected:
| Attribute | Short Description | Service |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------- | -------- |
| `http.status_code` | (aws-sdk) HTTP response status code. | |
| `rpc.method` | The name of the (logical) method being called. | |
| `rpc.service` | The full (logical) name of the service being called. | |
| `rpc.system` | A string identifying the remoting system. | |
| `aws.dynamodb.attribute_definitions` | The JSON-serialized value of each item in the `AttributeDefinitions` request field. | dynamodb |
| `aws.dynamodb.consistent_read` | The value of the `ConsistentRead` request parameter. | dynamodb |
| `aws.dynamodb.consumed_capacity` | The JSON-serialized value of each item in the `ConsumedCapacity` response field. | dynamodb |
| `aws.dynamodb.count` | The value of the `Count` response parameter. | dynamodb |
| `aws.dynamodb.exclusive_start_table` | The value of the `ExclusiveStartTableName` request parameter. | dynamodb |
| `aws.dynamodb.global_secondary_index_updates` | The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. | dynamodb |
| `aws.dynamodb.global_secondary_indexes` | The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. | dynamodb |
| `aws.dynamodb.index_name` | The value of the `IndexName` request parameter. | dynamodb |
| `aws.dynamodb.item_collection_metrics` | The JSON-serialized value of the `ItemCollectionMetrics` response field. | dynamodb |
| `aws.dynamodb.limit` | The value of the `Limit` request parameter. | dynamodb |
| `aws.dynamodb.local_secondary_indexes` | The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. | dynamodb |
| `aws.dynamodb.projection` | The value of the `ProjectionExpression` request parameter. | dynamodb |
| `aws.dynamodb.provisioned_read_capacity` | The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. | dynamodb |
| `aws.dynamodb.provisioned_write_capacity` | The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. | dynamodb |
| `aws.dynamodb.scan_forward` | The value of the `ScanIndexForward` request parameter. | dynamodb |
| `aws.dynamodb.scanned_count` | The value of the `ScannedCount` response parameter. | dynamodb |
| `aws.dynamodb.segment` | The value of the `Segment` request parameter. | dynamodb |
| `aws.dynamodb.select` | The value of the `Select` request parameter. | dynamodb |
| `aws.dynamodb.table_count` | The number of items in the `TableNames` response parameter. | dynamodb |
| `aws.dynamodb.table_names` | The keys in the `RequestItems` object field. | dynamodb |
| `aws.dynamodb.total_segments` | The value of the `TotalSegments` request parameter. | dynamodb |
| `db.name` | The name of the database being accessed. | dynamodb |
| `db.operation` | The name of the operation being executed. | dynamodb |
| `db.statement` | The database statement being executed. | dynamodb |
| `db.system` | An identifier for the database management system (DBMS) product being used. | dynamodb |
| `faas.execution` | The execution ID of the current function execution. | lambda |
| `faas.invoked_name` | The name of the invoked function. | lambda |
| `faas.invoked_provider` | The cloud provider of the invoked function. | lambda |
| `faas.invoked_region` | The cloud region of the invoked function. | lambda |
| `messaging.destination` | The message destination name. | sns, sqs |
| `messaging.destination_kind` | The kind of message destination. | sns, sqs |
| `messaging.system` | A string identifying the messaging system. | sns, sqs |
| `messaging.operation` | A string identifying the kind of message consumption. | sqs |
| `messaging.message_id` | A value used by the messaging system as an identifier for the message. | sqs |
| `messaging.url` | The connection string. | sqs |
## Useful links

@@ -122,0 +170,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc