UNPKG

@aws/aws-distro-opentelemetry-node-autoinstrumentation

Version:

This package provides Amazon Web Services distribution of the OpenTelemetry Node Instrumentation, which allows for auto-instrumentation of NodeJS applications.

32 lines 1.37 kB
"use strict"; // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.StepFunctionsServiceExtension = void 0; const api_1 = require("@opentelemetry/api"); const aws_attribute_keys_1 = require("../../../aws-attribute-keys"); class StepFunctionsServiceExtension { requestPreSpanHook(request, _config) { var _a, _b; const stateMachineArn = (_a = request.commandInput) === null || _a === void 0 ? void 0 : _a.stateMachineArn; const activityArn = (_b = request.commandInput) === null || _b === void 0 ? void 0 : _b.activityArn; const spanKind = api_1.SpanKind.CLIENT; let spanName; const spanAttributes = {}; if (stateMachineArn) { spanAttributes[aws_attribute_keys_1.AWS_ATTRIBUTE_KEYS.AWS_STEPFUNCTIONS_STATEMACHINE_ARN] = stateMachineArn; } if (activityArn) { spanAttributes[aws_attribute_keys_1.AWS_ATTRIBUTE_KEYS.AWS_STEPFUNCTIONS_ACTIVITY_ARN] = activityArn; } const isIncoming = false; return { isIncoming, spanAttributes, spanKind, spanName, }; } } exports.StepFunctionsServiceExtension = StepFunctionsServiceExtension; //# sourceMappingURL=step-functions.js.map