@opentelemetry/instrumentation-aws-sdk 0.69.0 → 0.71.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.
Files changed (45) hide show
  1. package/build/src/aws-sdk.js +1 -12
  2. package/build/src/aws-sdk.js.map +1 -1
  3. package/build/src/aws-sdk.types.js +1 -12
  4. package/build/src/aws-sdk.types.js.map +1 -1
  5. package/build/src/enums.js +1 -12
  6. package/build/src/enums.js.map +1 -1
  7. package/build/src/index.js +1 -12
  8. package/build/src/index.js.map +1 -1
  9. package/build/src/propwrap.js +1 -12
  10. package/build/src/propwrap.js.map +1 -1
  11. package/build/src/semconv-obsolete.js +1 -12
  12. package/build/src/semconv-obsolete.js.map +1 -1
  13. package/build/src/semconv.js +1 -12
  14. package/build/src/semconv.js.map +1 -1
  15. package/build/src/services/MessageAttributes.js +1 -12
  16. package/build/src/services/MessageAttributes.js.map +1 -1
  17. package/build/src/services/ServiceExtension.js.map +1 -1
  18. package/build/src/services/ServicesExtensions.js.map +1 -1
  19. package/build/src/services/bedrock-runtime.js +1 -12
  20. package/build/src/services/bedrock-runtime.js.map +1 -1
  21. package/build/src/services/dynamodb.js +1 -12
  22. package/build/src/services/dynamodb.js.map +1 -1
  23. package/build/src/services/index.js +1 -12
  24. package/build/src/services/index.js.map +1 -1
  25. package/build/src/services/kinesis.js +1 -12
  26. package/build/src/services/kinesis.js.map +1 -1
  27. package/build/src/services/lambda.js +1 -12
  28. package/build/src/services/lambda.js.map +1 -1
  29. package/build/src/services/s3.js +1 -12
  30. package/build/src/services/s3.js.map +1 -1
  31. package/build/src/services/secretsmanager.js +1 -12
  32. package/build/src/services/secretsmanager.js.map +1 -1
  33. package/build/src/services/sns.js +1 -12
  34. package/build/src/services/sns.js.map +1 -1
  35. package/build/src/services/sqs.js +1 -12
  36. package/build/src/services/sqs.js.map +1 -1
  37. package/build/src/services/stepfunctions.js +1 -12
  38. package/build/src/services/stepfunctions.js.map +1 -1
  39. package/build/src/types.js.map +1 -1
  40. package/build/src/utils.js +1 -12
  41. package/build/src/utils.js.map +1 -1
  42. package/build/src/version.d.ts +1 -1
  43. package/build/src/version.js +2 -13
  44. package/build/src/version.js.map +1 -1
  45. package/package.json +4 -4
@@ -3,18 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AwsInstrumentation = void 0;
4
4
  /*
5
5
  * Copyright The OpenTelemetry Authors
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * https://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
6
+ * SPDX-License-Identifier: Apache-2.0
18
7
  */
19
8
  const api_1 = require("@opentelemetry/api");
20
9
  const core_1 = require("@opentelemetry/core");
@@ -1 +1 @@
1
- {"version":3,"file":"aws-sdk.js","sourceRoot":"","sources":["../../src/aws-sdk.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAO4B;AAC5B,8CAA8D;AAC9D,mCAAyC;AACzC,yCAAgD;AAQhD,kBAAkB;AAClB,uCAA0D;AAC1D,oEASwC;AAQxC,mCAKiB;AACjB,yCAAsC;AAEtC,uCAAkD;AAClD,8EAAqF;AAErF,MAAM,oBAAoB,GAAG,MAAM,CACjC,qDAAqD,CACtD,CAAC;AAKF,MAAa,kBAAmB,SAAQ,qCAAgD;IACtF,MAAM,CAAU,SAAS,GAAG,SAAS,CAAC;IAI9B,qBAAqB,CAAmB;IACxC,mBAAmB,CAAmB;IAE9C,YAAY,SAAsC,EAAE;QAClD,KAAK,CAAC,sBAAY,EAAE,yBAAe,EAAE,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,qBAAqB,GAAG,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AkB,EAAE;YAC5B,IAAI,CAAC,kBAAkB,GAAG,IAAI,6BAAkB,EAAE,CAAC;SACpD;QACD,IAAI,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9D,CAAC;;AAjdU,gDAAkB","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 {\n Span,\n SpanKind,\n context,\n trace,\n diag,\n SpanStatusCode,\n} from '@opentelemetry/api';\nimport { hrTime, suppressTracing } from '@opentelemetry/core';\nimport { AttributeNames } from './enums';\nimport { ServicesExtensions } from './services';\nimport {\n AwsSdkInstrumentationConfig,\n AwsSdkRequestHookInformation,\n AwsSdkResponseHookInformation,\n NormalizedRequest,\n NormalizedResponse,\n} from './types';\n/** @knipignore */\nimport { PACKAGE_NAME, PACKAGE_VERSION } from './version';\nimport {\n InstrumentationBase,\n InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n isWrapped,\n safeExecuteInTheMiddle,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport type {\n MiddlewareStack,\n HandlerExecutionContext,\n Command as AwsV3Command,\n Handler as AwsV3MiddlewareHandler,\n InitializeHandlerArguments,\n} from '@aws-sdk/types';\nimport {\n bindPromise,\n extractAttributesFromNormalizedRequest,\n normalizeV3Request,\n removeSuffixFromStringIfExists,\n} from './utils';\nimport { propwrap } from './propwrap';\nimport { RequestMetadata } from './services/ServiceExtension';\nimport { ATTR_HTTP_STATUS_CODE } from './semconv';\nimport { ATTR_HTTP_RESPONSE_STATUS_CODE } from '@opentelemetry/semantic-conventions';\n\nconst V3_CLIENT_CONFIG_KEY = Symbol(\n 'opentelemetry.instrumentation.aws-sdk.client.config'\n);\ntype V3PluginCommand = AwsV3Command<any, any, any, any, any> & {\n [V3_CLIENT_CONFIG_KEY]?: any;\n};\n\nexport class AwsInstrumentation extends InstrumentationBase<AwsSdkInstrumentationConfig> {\n static readonly component = 'aws-sdk';\n // need declare since initialized in callbacks from super constructor\n declare private servicesExtensions: ServicesExtensions;\n\n private _httpSemconvStability: SemconvStability;\n private _dbSemconvStability: SemconvStability;\n\n constructor(config: AwsSdkInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this._httpSemconvStability = semconvStabilityFromStr(\n 'http',\n process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n );\n this._dbSemconvStability = semconvStabilityFromStr(\n 'database',\n process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n );\n }\n\n protected init(): InstrumentationModuleDefinition[] {\n const v3MiddlewareStackFileOldVersions = new InstrumentationNodeModuleFile(\n '@aws-sdk/middleware-stack/dist/cjs/MiddlewareStack.js',\n ['>=3.1.0 <3.35.0'],\n this.patchV3ConstructStack.bind(this),\n this.unpatchV3ConstructStack.bind(this)\n );\n const v3MiddlewareStackFileNewVersions = new InstrumentationNodeModuleFile(\n '@aws-sdk/middleware-stack/dist-cjs/MiddlewareStack.js',\n ['>=3.35.0'],\n this.patchV3ConstructStack.bind(this),\n this.unpatchV3ConstructStack.bind(this)\n );\n\n // as for aws-sdk v3.13.1, constructStack is exported from @aws-sdk/middleware-stack as\n // getter instead of function, which fails shimmer.\n // so we are patching the MiddlewareStack.js file directly to get around it.\n const v3MiddlewareStack = new InstrumentationNodeModuleDefinition(\n '@aws-sdk/middleware-stack',\n ['^3.1.0'],\n undefined,\n undefined,\n [v3MiddlewareStackFileOldVersions, v3MiddlewareStackFileNewVersions]\n );\n\n // Patch for @smithy/middleware-stack for @aws-sdk/* packages v3.363.0+.\n // As of @smithy/middleware-stack@2.1.0 `constructStack` is only available\n // as a getter, so we cannot use `this._wrap()`.\n const self = this;\n const v3SmithyMiddlewareStack = new InstrumentationNodeModuleDefinition(\n '@smithy/middleware-stack',\n ['>=2.0.0'],\n (moduleExports, moduleVersion) => {\n const newExports = propwrap(\n moduleExports,\n 'constructStack',\n (orig: any) => {\n self._diag.debug('propwrapping aws-sdk v3 constructStack');\n return self._getV3ConstructStackPatch(moduleVersion, orig);\n }\n );\n return newExports;\n }\n );\n\n const v3SmithyClient = new InstrumentationNodeModuleDefinition(\n '@aws-sdk/smithy-client',\n ['^3.1.0'],\n this.patchV3SmithyClient.bind(this),\n this.unpatchV3SmithyClient.bind(this)\n );\n\n // patch for new @smithy/smithy-client for aws-sdk packages v3.363.0+\n const v3NewSmithyClient = new InstrumentationNodeModuleDefinition(\n '@smithy/smithy-client',\n ['>=1.0.3'],\n this.patchV3SmithyClient.bind(this),\n this.unpatchV3SmithyClient.bind(this)\n );\n\n return [\n v3MiddlewareStack,\n v3SmithyMiddlewareStack,\n v3SmithyClient,\n v3NewSmithyClient,\n ];\n }\n\n protected patchV3ConstructStack(moduleExports: any, moduleVersion?: string) {\n this._wrap(\n moduleExports,\n 'constructStack',\n this._getV3ConstructStackPatch.bind(this, moduleVersion)\n );\n return moduleExports;\n }\n\n protected unpatchV3ConstructStack(moduleExports: any) {\n this._unwrap(moduleExports, 'constructStack');\n return moduleExports;\n }\n\n protected patchV3SmithyClient(moduleExports: any) {\n this._wrap(\n moduleExports.Client.prototype,\n 'send',\n this._getV3SmithyClientSendPatch.bind(this)\n );\n return moduleExports;\n }\n\n protected unpatchV3SmithyClient(moduleExports: any) {\n this._unwrap(moduleExports.Client.prototype, 'send');\n return moduleExports;\n }\n\n private _startAwsV3Span(\n normalizedRequest: NormalizedRequest,\n metadata: RequestMetadata\n ): Span {\n const name =\n metadata.spanName ??\n `${normalizedRequest.serviceName}.${normalizedRequest.commandName}`;\n const newSpan = this.tracer.startSpan(name, {\n kind: metadata.spanKind ?? SpanKind.CLIENT,\n attributes: {\n ...extractAttributesFromNormalizedRequest(normalizedRequest),\n ...metadata.spanAttributes,\n },\n });\n\n return newSpan;\n }\n\n private _callUserPreRequestHook(\n span: Span,\n request: NormalizedRequest,\n moduleVersion: string | undefined\n ) {\n const { preRequestHook } = this.getConfig();\n if (preRequestHook) {\n const requestInfo: AwsSdkRequestHookInformation = {\n moduleVersion,\n request,\n };\n safeExecuteInTheMiddle(\n () => preRequestHook(span, requestInfo),\n (e: Error | undefined) => {\n if (e)\n diag.error(\n `${AwsInstrumentation.component} instrumentation: preRequestHook error`,\n e\n );\n },\n true\n );\n }\n }\n\n private _callUserResponseHook(span: Span, response: NormalizedResponse) {\n const { responseHook } = this.getConfig();\n if (!responseHook) return;\n\n const responseInfo: AwsSdkResponseHookInformation = {\n response,\n };\n safeExecuteInTheMiddle(\n () => responseHook(span, responseInfo),\n (e: Error | undefined) => {\n if (e)\n diag.error(\n `${AwsInstrumentation.component} instrumentation: responseHook error`,\n e\n );\n },\n true\n );\n }\n\n private _callUserExceptionResponseHook(\n span: Span,\n request: NormalizedRequest,\n err: any\n ) {\n const { exceptionHook } = this.getConfig();\n if (!exceptionHook) return;\n const requestInfo: AwsSdkRequestHookInformation = {\n request,\n };\n\n safeExecuteInTheMiddle(\n () => exceptionHook(span, requestInfo, err),\n (e: Error | undefined) => {\n if (e)\n diag.error(\n `${AwsInstrumentation.component} instrumentation: exceptionHook error`,\n e\n );\n },\n true\n );\n }\n\n private _getV3ConstructStackPatch(\n moduleVersion: string | undefined,\n original: (...args: unknown[]) => MiddlewareStack<any, any>\n ) {\n const self = this;\n return function constructStack(\n this: any,\n ...args: unknown[]\n ): MiddlewareStack<any, any> {\n const stack: MiddlewareStack<any, any> = original.apply(this, args);\n self.patchV3MiddlewareStack(moduleVersion, stack);\n return stack;\n };\n }\n\n private _getV3SmithyClientSendPatch(\n original: (...args: unknown[]) => Promise<any>\n ) {\n return function send(\n this: any,\n command: V3PluginCommand,\n ...args: unknown[]\n ): Promise<any> {\n command[V3_CLIENT_CONFIG_KEY] = this.config;\n return original.apply(this, [command, ...args]);\n };\n }\n\n private patchV3MiddlewareStack(\n moduleVersion: string | undefined,\n middlewareStackToPatch: MiddlewareStack<any, any>\n ) {\n if (!isWrapped(middlewareStackToPatch.resolve)) {\n this._wrap(\n middlewareStackToPatch,\n 'resolve',\n this._getV3MiddlewareStackResolvePatch.bind(this, moduleVersion)\n );\n }\n\n // 'clone' and 'concat' functions are internally calling 'constructStack' which is in same\n // module, thus not patched, and we need to take care of it specifically.\n this._wrap(\n middlewareStackToPatch,\n 'clone',\n this._getV3MiddlewareStackClonePatch.bind(this, moduleVersion)\n );\n this._wrap(\n middlewareStackToPatch,\n 'concat',\n this._getV3MiddlewareStackClonePatch.bind(this, moduleVersion)\n );\n }\n\n private _getV3MiddlewareStackClonePatch(\n moduleVersion: string | undefined,\n original: (...args: any[]) => MiddlewareStack<any, any>\n ) {\n const self = this;\n return function (this: any, ...args: any[]) {\n const newStack = original.apply(this, args);\n self.patchV3MiddlewareStack(moduleVersion, newStack);\n return newStack;\n };\n }\n\n private _getV3MiddlewareStackResolvePatch(\n moduleVersion: string | undefined,\n original: (\n _handler: any,\n context: HandlerExecutionContext\n ) => AwsV3MiddlewareHandler<any, any>\n ) {\n const self = this;\n return function (\n this: any,\n _handler: any,\n awsExecutionContext: HandlerExecutionContext\n ): AwsV3MiddlewareHandler<any, any> {\n const origHandler = original.call(this, _handler, awsExecutionContext);\n const patchedHandler = function (\n this: any,\n command: InitializeHandlerArguments<any> & {\n [V3_CLIENT_CONFIG_KEY]?: any;\n }\n ): Promise<any> {\n const clientConfig = command[V3_CLIENT_CONFIG_KEY];\n const regionPromise = clientConfig?.region?.();\n const serviceName =\n clientConfig?.serviceId ??\n removeSuffixFromStringIfExists(\n // Use 'AWS' as a fallback serviceName to match type definition.\n // In practice, `clientName` should always be set.\n awsExecutionContext.clientName || 'AWS',\n 'Client'\n );\n const commandName =\n awsExecutionContext.commandName ?? command.constructor?.name;\n const normalizedRequest = normalizeV3Request(\n serviceName,\n commandName,\n command.input,\n undefined\n );\n const requestMetadata = self.servicesExtensions.requestPreSpanHook(\n normalizedRequest,\n self.getConfig(),\n self._diag,\n self._dbSemconvStability\n );\n const startTime = hrTime();\n const span = self._startAwsV3Span(normalizedRequest, requestMetadata);\n const activeContextWithSpan = trace.setSpan(context.active(), span);\n\n const handlerPromise = new Promise((resolve, reject) => {\n Promise.resolve(regionPromise)\n .then(resolvedRegion => {\n normalizedRequest.region = resolvedRegion;\n span.setAttribute(AttributeNames.CLOUD_REGION, resolvedRegion);\n })\n .catch(e => {\n // there is nothing much we can do in this case.\n // we'll just continue without region\n diag.debug(\n `${AwsInstrumentation.component} instrumentation: failed to extract region from async function`,\n e\n );\n })\n .finally(() => {\n self._callUserPreRequestHook(\n span,\n normalizedRequest,\n moduleVersion\n );\n const resultPromise = context.with(activeContextWithSpan, () => {\n self.servicesExtensions.requestPostSpanHook(normalizedRequest);\n return self._callOriginalFunction(() =>\n origHandler.call(this, command)\n );\n });\n const promiseWithResponseLogic = resultPromise\n .then(response => {\n const requestId = response.output?.$metadata?.requestId;\n if (requestId) {\n span.setAttribute(AttributeNames.AWS_REQUEST_ID, requestId);\n }\n\n const httpStatusCode =\n response.output?.$metadata?.httpStatusCode;\n if (httpStatusCode) {\n if (self._httpSemconvStability & SemconvStability.OLD) {\n span.setAttribute(ATTR_HTTP_STATUS_CODE, httpStatusCode);\n }\n if (self._httpSemconvStability & SemconvStability.STABLE) {\n span.setAttribute(\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n httpStatusCode\n );\n }\n }\n\n const extendedRequestId =\n response.output?.$metadata?.extendedRequestId;\n if (extendedRequestId) {\n span.setAttribute(\n AttributeNames.AWS_REQUEST_EXTENDED_ID,\n extendedRequestId\n );\n }\n\n const normalizedResponse: NormalizedResponse = {\n data: response.output,\n request: normalizedRequest,\n requestId: requestId,\n };\n const override = self.servicesExtensions.responseHook(\n normalizedResponse,\n span,\n self.tracer,\n self.getConfig(),\n startTime\n );\n if (override) {\n response.output = override;\n normalizedResponse.data = override;\n }\n self._callUserResponseHook(span, normalizedResponse);\n return response;\n })\n .catch(err => {\n const requestId = err?.RequestId;\n if (requestId) {\n span.setAttribute(AttributeNames.AWS_REQUEST_ID, requestId);\n }\n\n const httpStatusCode = err?.$metadata?.httpStatusCode;\n if (httpStatusCode) {\n if (self._httpSemconvStability & SemconvStability.OLD) {\n span.setAttribute(ATTR_HTTP_STATUS_CODE, httpStatusCode);\n }\n if (self._httpSemconvStability & SemconvStability.STABLE) {\n span.setAttribute(\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n httpStatusCode\n );\n }\n }\n\n const extendedRequestId = err?.extendedRequestId;\n if (extendedRequestId) {\n span.setAttribute(\n AttributeNames.AWS_REQUEST_EXTENDED_ID,\n extendedRequestId\n );\n }\n\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n span.recordException(err);\n self._callUserExceptionResponseHook(\n span,\n normalizedRequest,\n err\n );\n throw err;\n })\n .finally(() => {\n if (!requestMetadata.isStream) {\n span.end();\n }\n });\n promiseWithResponseLogic\n .then(res => {\n resolve(res);\n })\n .catch(err => reject(err));\n });\n });\n\n return requestMetadata.isIncoming\n ? bindPromise(handlerPromise, activeContextWithSpan, 2)\n : handlerPromise;\n };\n return patchedHandler;\n };\n }\n\n private _callOriginalFunction<T>(originalFunction: (...args: any[]) => T): T {\n if (this.getConfig().suppressInternalInstrumentation) {\n return context.with(suppressTracing(context.active()), originalFunction);\n } else {\n return originalFunction();\n }\n }\n\n override _updateMetricInstruments() {\n if (!this.servicesExtensions) {\n this.servicesExtensions = new ServicesExtensions();\n }\n this.servicesExtensions.updateMetricInstruments(this.meter);\n }\n}\n"]}
1
+ {"version":3,"file":"aws-sdk.js","sourceRoot":"","sources":["../../src/aws-sdk.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,4CAO4B;AAC5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AAc,EAAE,qBAAqB,EAAE,CAAC,CAAC;oBACvD,CAAC,CAAC,cAAc,CAAC;YACrB,CAAC,CAAC;YACF,OAAO,cAAc,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC;IAEO,qBAAqB,CAAI,gBAAuC;QACtE,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,+BAA+B,EAAE;YACpD,OAAO,aAAO,CAAC,IAAI,CAAC,IAAA,sBAAe,EAAC,aAAO,CAAC,MAAM,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC;SAC1E;aAAM;YACL,OAAO,gBAAgB,EAAE,CAAC;SAC3B;IACH,CAAC;IAEQ,wBAAwB;QAC/B,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC5B,IAAI,CAAC,kBAAkB,GAAG,IAAI,6BAAkB,EAAE,CAAC;SACpD;QACD,IAAI,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9D,CAAC;;AAjdU,gDAAkB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n Span,\n SpanKind,\n context,\n trace,\n diag,\n SpanStatusCode,\n} from '@opentelemetry/api';\nimport { hrTime, suppressTracing } from '@opentelemetry/core';\nimport { AttributeNames } from './enums';\nimport { ServicesExtensions } from './services';\nimport {\n AwsSdkInstrumentationConfig,\n AwsSdkRequestHookInformation,\n AwsSdkResponseHookInformation,\n NormalizedRequest,\n NormalizedResponse,\n} from './types';\n/** @knipignore */\nimport { PACKAGE_NAME, PACKAGE_VERSION } from './version';\nimport {\n InstrumentationBase,\n InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n isWrapped,\n safeExecuteInTheMiddle,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport type {\n MiddlewareStack,\n HandlerExecutionContext,\n Command as AwsV3Command,\n Handler as AwsV3MiddlewareHandler,\n InitializeHandlerArguments,\n} from '@aws-sdk/types';\nimport {\n bindPromise,\n extractAttributesFromNormalizedRequest,\n normalizeV3Request,\n removeSuffixFromStringIfExists,\n} from './utils';\nimport { propwrap } from './propwrap';\nimport { RequestMetadata } from './services/ServiceExtension';\nimport { ATTR_HTTP_STATUS_CODE } from './semconv';\nimport { ATTR_HTTP_RESPONSE_STATUS_CODE } from '@opentelemetry/semantic-conventions';\n\nconst V3_CLIENT_CONFIG_KEY = Symbol(\n 'opentelemetry.instrumentation.aws-sdk.client.config'\n);\ntype V3PluginCommand = AwsV3Command<any, any, any, any, any> & {\n [V3_CLIENT_CONFIG_KEY]?: any;\n};\n\nexport class AwsInstrumentation extends InstrumentationBase<AwsSdkInstrumentationConfig> {\n static readonly component = 'aws-sdk';\n // need declare since initialized in callbacks from super constructor\n declare private servicesExtensions: ServicesExtensions;\n\n private _httpSemconvStability: SemconvStability;\n private _dbSemconvStability: SemconvStability;\n\n constructor(config: AwsSdkInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this._httpSemconvStability = semconvStabilityFromStr(\n 'http',\n process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n );\n this._dbSemconvStability = semconvStabilityFromStr(\n 'database',\n process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n );\n }\n\n protected init(): InstrumentationModuleDefinition[] {\n const v3MiddlewareStackFileOldVersions = new InstrumentationNodeModuleFile(\n '@aws-sdk/middleware-stack/dist/cjs/MiddlewareStack.js',\n ['>=3.1.0 <3.35.0'],\n this.patchV3ConstructStack.bind(this),\n this.unpatchV3ConstructStack.bind(this)\n );\n const v3MiddlewareStackFileNewVersions = new InstrumentationNodeModuleFile(\n '@aws-sdk/middleware-stack/dist-cjs/MiddlewareStack.js',\n ['>=3.35.0'],\n this.patchV3ConstructStack.bind(this),\n this.unpatchV3ConstructStack.bind(this)\n );\n\n // as for aws-sdk v3.13.1, constructStack is exported from @aws-sdk/middleware-stack as\n // getter instead of function, which fails shimmer.\n // so we are patching the MiddlewareStack.js file directly to get around it.\n const v3MiddlewareStack = new InstrumentationNodeModuleDefinition(\n '@aws-sdk/middleware-stack',\n ['^3.1.0'],\n undefined,\n undefined,\n [v3MiddlewareStackFileOldVersions, v3MiddlewareStackFileNewVersions]\n );\n\n // Patch for @smithy/middleware-stack for @aws-sdk/* packages v3.363.0+.\n // As of @smithy/middleware-stack@2.1.0 `constructStack` is only available\n // as a getter, so we cannot use `this._wrap()`.\n const self = this;\n const v3SmithyMiddlewareStack = new InstrumentationNodeModuleDefinition(\n '@smithy/middleware-stack',\n ['>=2.0.0'],\n (moduleExports, moduleVersion) => {\n const newExports = propwrap(\n moduleExports,\n 'constructStack',\n (orig: any) => {\n self._diag.debug('propwrapping aws-sdk v3 constructStack');\n return self._getV3ConstructStackPatch(moduleVersion, orig);\n }\n );\n return newExports;\n }\n );\n\n const v3SmithyClient = new InstrumentationNodeModuleDefinition(\n '@aws-sdk/smithy-client',\n ['^3.1.0'],\n this.patchV3SmithyClient.bind(this),\n this.unpatchV3SmithyClient.bind(this)\n );\n\n // patch for new @smithy/smithy-client for aws-sdk packages v3.363.0+\n const v3NewSmithyClient = new InstrumentationNodeModuleDefinition(\n '@smithy/smithy-client',\n ['>=1.0.3'],\n this.patchV3SmithyClient.bind(this),\n this.unpatchV3SmithyClient.bind(this)\n );\n\n return [\n v3MiddlewareStack,\n v3SmithyMiddlewareStack,\n v3SmithyClient,\n v3NewSmithyClient,\n ];\n }\n\n protected patchV3ConstructStack(moduleExports: any, moduleVersion?: string) {\n this._wrap(\n moduleExports,\n 'constructStack',\n this._getV3ConstructStackPatch.bind(this, moduleVersion)\n );\n return moduleExports;\n }\n\n protected unpatchV3ConstructStack(moduleExports: any) {\n this._unwrap(moduleExports, 'constructStack');\n return moduleExports;\n }\n\n protected patchV3SmithyClient(moduleExports: any) {\n this._wrap(\n moduleExports.Client.prototype,\n 'send',\n this._getV3SmithyClientSendPatch.bind(this)\n );\n return moduleExports;\n }\n\n protected unpatchV3SmithyClient(moduleExports: any) {\n this._unwrap(moduleExports.Client.prototype, 'send');\n return moduleExports;\n }\n\n private _startAwsV3Span(\n normalizedRequest: NormalizedRequest,\n metadata: RequestMetadata\n ): Span {\n const name =\n metadata.spanName ??\n `${normalizedRequest.serviceName}.${normalizedRequest.commandName}`;\n const newSpan = this.tracer.startSpan(name, {\n kind: metadata.spanKind ?? SpanKind.CLIENT,\n attributes: {\n ...extractAttributesFromNormalizedRequest(normalizedRequest),\n ...metadata.spanAttributes,\n },\n });\n\n return newSpan;\n }\n\n private _callUserPreRequestHook(\n span: Span,\n request: NormalizedRequest,\n moduleVersion: string | undefined\n ) {\n const { preRequestHook } = this.getConfig();\n if (preRequestHook) {\n const requestInfo: AwsSdkRequestHookInformation = {\n moduleVersion,\n request,\n };\n safeExecuteInTheMiddle(\n () => preRequestHook(span, requestInfo),\n (e: Error | undefined) => {\n if (e)\n diag.error(\n `${AwsInstrumentation.component} instrumentation: preRequestHook error`,\n e\n );\n },\n true\n );\n }\n }\n\n private _callUserResponseHook(span: Span, response: NormalizedResponse) {\n const { responseHook } = this.getConfig();\n if (!responseHook) return;\n\n const responseInfo: AwsSdkResponseHookInformation = {\n response,\n };\n safeExecuteInTheMiddle(\n () => responseHook(span, responseInfo),\n (e: Error | undefined) => {\n if (e)\n diag.error(\n `${AwsInstrumentation.component} instrumentation: responseHook error`,\n e\n );\n },\n true\n );\n }\n\n private _callUserExceptionResponseHook(\n span: Span,\n request: NormalizedRequest,\n err: any\n ) {\n const { exceptionHook } = this.getConfig();\n if (!exceptionHook) return;\n const requestInfo: AwsSdkRequestHookInformation = {\n request,\n };\n\n safeExecuteInTheMiddle(\n () => exceptionHook(span, requestInfo, err),\n (e: Error | undefined) => {\n if (e)\n diag.error(\n `${AwsInstrumentation.component} instrumentation: exceptionHook error`,\n e\n );\n },\n true\n );\n }\n\n private _getV3ConstructStackPatch(\n moduleVersion: string | undefined,\n original: (...args: unknown[]) => MiddlewareStack<any, any>\n ) {\n const self = this;\n return function constructStack(\n this: any,\n ...args: unknown[]\n ): MiddlewareStack<any, any> {\n const stack: MiddlewareStack<any, any> = original.apply(this, args);\n self.patchV3MiddlewareStack(moduleVersion, stack);\n return stack;\n };\n }\n\n private _getV3SmithyClientSendPatch(\n original: (...args: unknown[]) => Promise<any>\n ) {\n return function send(\n this: any,\n command: V3PluginCommand,\n ...args: unknown[]\n ): Promise<any> {\n command[V3_CLIENT_CONFIG_KEY] = this.config;\n return original.apply(this, [command, ...args]);\n };\n }\n\n private patchV3MiddlewareStack(\n moduleVersion: string | undefined,\n middlewareStackToPatch: MiddlewareStack<any, any>\n ) {\n if (!isWrapped(middlewareStackToPatch.resolve)) {\n this._wrap(\n middlewareStackToPatch,\n 'resolve',\n this._getV3MiddlewareStackResolvePatch.bind(this, moduleVersion)\n );\n }\n\n // 'clone' and 'concat' functions are internally calling 'constructStack' which is in same\n // module, thus not patched, and we need to take care of it specifically.\n this._wrap(\n middlewareStackToPatch,\n 'clone',\n this._getV3MiddlewareStackClonePatch.bind(this, moduleVersion)\n );\n this._wrap(\n middlewareStackToPatch,\n 'concat',\n this._getV3MiddlewareStackClonePatch.bind(this, moduleVersion)\n );\n }\n\n private _getV3MiddlewareStackClonePatch(\n moduleVersion: string | undefined,\n original: (...args: any[]) => MiddlewareStack<any, any>\n ) {\n const self = this;\n return function (this: any, ...args: any[]) {\n const newStack = original.apply(this, args);\n self.patchV3MiddlewareStack(moduleVersion, newStack);\n return newStack;\n };\n }\n\n private _getV3MiddlewareStackResolvePatch(\n moduleVersion: string | undefined,\n original: (\n _handler: any,\n context: HandlerExecutionContext\n ) => AwsV3MiddlewareHandler<any, any>\n ) {\n const self = this;\n return function (\n this: any,\n _handler: any,\n awsExecutionContext: HandlerExecutionContext\n ): AwsV3MiddlewareHandler<any, any> {\n const origHandler = original.call(this, _handler, awsExecutionContext);\n const patchedHandler = function (\n this: any,\n command: InitializeHandlerArguments<any> & {\n [V3_CLIENT_CONFIG_KEY]?: any;\n }\n ): Promise<any> {\n const clientConfig = command[V3_CLIENT_CONFIG_KEY];\n const regionPromise = clientConfig?.region?.();\n const serviceName =\n clientConfig?.serviceId ??\n removeSuffixFromStringIfExists(\n // Use 'AWS' as a fallback serviceName to match type definition.\n // In practice, `clientName` should always be set.\n awsExecutionContext.clientName || 'AWS',\n 'Client'\n );\n const commandName =\n awsExecutionContext.commandName ?? command.constructor?.name;\n const normalizedRequest = normalizeV3Request(\n serviceName,\n commandName,\n command.input,\n undefined\n );\n const requestMetadata = self.servicesExtensions.requestPreSpanHook(\n normalizedRequest,\n self.getConfig(),\n self._diag,\n self._dbSemconvStability\n );\n const startTime = hrTime();\n const span = self._startAwsV3Span(normalizedRequest, requestMetadata);\n const activeContextWithSpan = trace.setSpan(context.active(), span);\n\n const handlerPromise = new Promise((resolve, reject) => {\n Promise.resolve(regionPromise)\n .then(resolvedRegion => {\n normalizedRequest.region = resolvedRegion;\n span.setAttribute(AttributeNames.CLOUD_REGION, resolvedRegion);\n })\n .catch(e => {\n // there is nothing much we can do in this case.\n // we'll just continue without region\n diag.debug(\n `${AwsInstrumentation.component} instrumentation: failed to extract region from async function`,\n e\n );\n })\n .finally(() => {\n self._callUserPreRequestHook(\n span,\n normalizedRequest,\n moduleVersion\n );\n const resultPromise = context.with(activeContextWithSpan, () => {\n self.servicesExtensions.requestPostSpanHook(normalizedRequest);\n return self._callOriginalFunction(() =>\n origHandler.call(this, command)\n );\n });\n const promiseWithResponseLogic = resultPromise\n .then(response => {\n const requestId = response.output?.$metadata?.requestId;\n if (requestId) {\n span.setAttribute(AttributeNames.AWS_REQUEST_ID, requestId);\n }\n\n const httpStatusCode =\n response.output?.$metadata?.httpStatusCode;\n if (httpStatusCode) {\n if (self._httpSemconvStability & SemconvStability.OLD) {\n span.setAttribute(ATTR_HTTP_STATUS_CODE, httpStatusCode);\n }\n if (self._httpSemconvStability & SemconvStability.STABLE) {\n span.setAttribute(\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n httpStatusCode\n );\n }\n }\n\n const extendedRequestId =\n response.output?.$metadata?.extendedRequestId;\n if (extendedRequestId) {\n span.setAttribute(\n AttributeNames.AWS_REQUEST_EXTENDED_ID,\n extendedRequestId\n );\n }\n\n const normalizedResponse: NormalizedResponse = {\n data: response.output,\n request: normalizedRequest,\n requestId: requestId,\n };\n const override = self.servicesExtensions.responseHook(\n normalizedResponse,\n span,\n self.tracer,\n self.getConfig(),\n startTime\n );\n if (override) {\n response.output = override;\n normalizedResponse.data = override;\n }\n self._callUserResponseHook(span, normalizedResponse);\n return response;\n })\n .catch(err => {\n const requestId = err?.RequestId;\n if (requestId) {\n span.setAttribute(AttributeNames.AWS_REQUEST_ID, requestId);\n }\n\n const httpStatusCode = err?.$metadata?.httpStatusCode;\n if (httpStatusCode) {\n if (self._httpSemconvStability & SemconvStability.OLD) {\n span.setAttribute(ATTR_HTTP_STATUS_CODE, httpStatusCode);\n }\n if (self._httpSemconvStability & SemconvStability.STABLE) {\n span.setAttribute(\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n httpStatusCode\n );\n }\n }\n\n const extendedRequestId = err?.extendedRequestId;\n if (extendedRequestId) {\n span.setAttribute(\n AttributeNames.AWS_REQUEST_EXTENDED_ID,\n extendedRequestId\n );\n }\n\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n span.recordException(err);\n self._callUserExceptionResponseHook(\n span,\n normalizedRequest,\n err\n );\n throw err;\n })\n .finally(() => {\n if (!requestMetadata.isStream) {\n span.end();\n }\n });\n promiseWithResponseLogic\n .then(res => {\n resolve(res);\n })\n .catch(err => reject(err));\n });\n });\n\n return requestMetadata.isIncoming\n ? bindPromise(handlerPromise, activeContextWithSpan, 2)\n : handlerPromise;\n };\n return patchedHandler;\n };\n }\n\n private _callOriginalFunction<T>(originalFunction: (...args: any[]) => T): T {\n if (this.getConfig().suppressInternalInstrumentation) {\n return context.with(suppressTracing(context.active()), originalFunction);\n } else {\n return originalFunction();\n }\n }\n\n override _updateMetricInstruments() {\n if (!this.servicesExtensions) {\n this.servicesExtensions = new ServicesExtensions();\n }\n this.servicesExtensions.updateMetricInstruments(this.meter);\n }\n}\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  //# sourceMappingURL=aws-sdk.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aws-sdk.types.js","sourceRoot":"","sources":["../../src/aws-sdk.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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/*\n * AWS SDK for JavaScript\n * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * This product includes software developed at\n * Amazon Web Services, Inc. (http://aws.amazon.com/).\n */\n\n/*\n These are slightly modified and simplified versions of the actual SQS types included\n in the official distribution:\n https://github.com/aws/aws-sdk-js/blob/master/clients/sqs.d.ts\n These are brought here to avoid having users install the `aws-sdk` whenever they\n require this instrumentation.\n*/\n\ninterface Blob {}\ntype Binary = Buffer | Uint8Array | Blob | string;\n\n// eslint-disable-next-line @typescript-eslint/no-namespace -- Prefer to contain the types copied over in one location\nexport namespace SNS {\n interface MessageAttributeValue {\n /**\n * Amazon SNS supports the following logical data types: String, String.Array, Number, and Binary. For more information, see Message Attribute Data Types.\n */\n DataType: string;\n /**\n * Strings are Unicode with UTF8 binary encoding. For a list of code values, see ASCII Printable Characters.\n */\n StringValue?: string;\n /**\n * Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.\n */\n BinaryValue?: Binary;\n }\n\n export type MessageAttributeMap = { [key: string]: MessageAttributeValue };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace -- Prefer to contain the types copied over in one location\nexport namespace SQS {\n type StringList = string[];\n type BinaryList = Binary[];\n interface MessageAttributeValue {\n /**\n * Strings are Unicode with UTF-8 binary encoding. For a list of code values, see ASCII Printable Characters.\n */\n StringValue?: string;\n /**\n * Binary type attributes can store any binary data, such as compressed data, encrypted data, or images.\n */\n BinaryValue?: Binary;\n /**\n * Not implemented. Reserved for future use.\n */\n StringListValues?: StringList;\n /**\n * Not implemented. Reserved for future use.\n */\n BinaryListValues?: BinaryList;\n /**\n * Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue. You can also append custom labels. For more information, see Amazon SQS Message Attributes in the Amazon SQS Developer Guide.\n */\n DataType: string;\n }\n\n export type MessageBodyAttributeMap = {\n [key: string]: MessageAttributeValue;\n };\n\n type MessageSystemAttributeMap = { [key: string]: string };\n\n export interface Message {\n /**\n * A unique identifier for the message. A MessageId is considered unique across all accounts for an extended period of time.\n */\n MessageId?: string;\n /**\n * An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.\n */\n ReceiptHandle?: string;\n /**\n * An MD5 digest of the non-URL-encoded message body string.\n */\n MD5OfBody?: string;\n /**\n * The message's contents (not URL-encoded).\n */\n Body?: string;\n /**\n * A map of the attributes requested in ReceiveMessage to their respective values. Supported attributes: ApproximateReceiveCount ApproximateFirstReceiveTimestamp MessageDeduplicationId MessageGroupId SenderId SentTimestamp SequenceNumber ApproximateFirstReceiveTimestamp and SentTimestamp are each returned as an integer representing the epoch time in milliseconds.\n */\n Attributes?: MessageSystemAttributeMap;\n /**\n * An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see RFC1321.\n */\n MD5OfMessageAttributes?: string;\n /**\n * Each message attribute consists of a Name, Type, and Value. For more information, see Amazon SQS message attributes in the Amazon SQS Developer Guide.\n */\n MessageAttributes?: MessageBodyAttributeMap;\n }\n}\n"]}
1
+ {"version":3,"file":"aws-sdk.types.js","sourceRoot":"","sources":["../../src/aws-sdk.types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * AWS SDK for JavaScript\n * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * This product includes software developed at\n * Amazon Web Services, Inc. (http://aws.amazon.com/).\n */\n\n/*\n These are slightly modified and simplified versions of the actual SQS types included\n in the official distribution:\n https://github.com/aws/aws-sdk-js/blob/master/clients/sqs.d.ts\n These are brought here to avoid having users install the `aws-sdk` whenever they\n require this instrumentation.\n*/\n\ninterface Blob {}\ntype Binary = Buffer | Uint8Array | Blob | string;\n\n// eslint-disable-next-line @typescript-eslint/no-namespace -- Prefer to contain the types copied over in one location\nexport namespace SNS {\n interface MessageAttributeValue {\n /**\n * Amazon SNS supports the following logical data types: String, String.Array, Number, and Binary. For more information, see Message Attribute Data Types.\n */\n DataType: string;\n /**\n * Strings are Unicode with UTF8 binary encoding. For a list of code values, see ASCII Printable Characters.\n */\n StringValue?: string;\n /**\n * Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.\n */\n BinaryValue?: Binary;\n }\n\n export type MessageAttributeMap = { [key: string]: MessageAttributeValue };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace -- Prefer to contain the types copied over in one location\nexport namespace SQS {\n type StringList = string[];\n type BinaryList = Binary[];\n interface MessageAttributeValue {\n /**\n * Strings are Unicode with UTF-8 binary encoding. For a list of code values, see ASCII Printable Characters.\n */\n StringValue?: string;\n /**\n * Binary type attributes can store any binary data, such as compressed data, encrypted data, or images.\n */\n BinaryValue?: Binary;\n /**\n * Not implemented. Reserved for future use.\n */\n StringListValues?: StringList;\n /**\n * Not implemented. Reserved for future use.\n */\n BinaryListValues?: BinaryList;\n /**\n * Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue. You can also append custom labels. For more information, see Amazon SQS Message Attributes in the Amazon SQS Developer Guide.\n */\n DataType: string;\n }\n\n export type MessageBodyAttributeMap = {\n [key: string]: MessageAttributeValue;\n };\n\n type MessageSystemAttributeMap = { [key: string]: string };\n\n export interface Message {\n /**\n * A unique identifier for the message. A MessageId is considered unique across all accounts for an extended period of time.\n */\n MessageId?: string;\n /**\n * An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.\n */\n ReceiptHandle?: string;\n /**\n * An MD5 digest of the non-URL-encoded message body string.\n */\n MD5OfBody?: string;\n /**\n * The message's contents (not URL-encoded).\n */\n Body?: string;\n /**\n * A map of the attributes requested in ReceiveMessage to their respective values. Supported attributes: ApproximateReceiveCount ApproximateFirstReceiveTimestamp MessageDeduplicationId MessageGroupId SenderId SentTimestamp SequenceNumber ApproximateFirstReceiveTimestamp and SentTimestamp are each returned as an integer representing the epoch time in milliseconds.\n */\n Attributes?: MessageSystemAttributeMap;\n /**\n * An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see RFC1321.\n */\n MD5OfMessageAttributes?: string;\n /**\n * Each message attribute consists of a Name, Type, and Value. For more information, see Amazon SQS message attributes in the Amazon SQS Developer Guide.\n */\n MessageAttributes?: MessageBodyAttributeMap;\n }\n}\n"]}
@@ -3,18 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AttributeNames = void 0;
4
4
  /*
5
5
  * Copyright The OpenTelemetry Authors
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * https://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
6
+ * SPDX-License-Identifier: Apache-2.0
18
7
  */
19
8
  var AttributeNames;
20
9
  (function (AttributeNames) {
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,IAAY,cAeX;AAfD,WAAY,cAAc;IACxB,iDAA+B,CAAA;IAC/B,+CAA6B,CAAA;IAC7B,qDAAmC,CAAA;IACnC,uDAAqC,CAAA;IACrC,mEAAiD,CAAA;IACjD,mDAAiC,CAAA;IACjC,qEAAmD,CAAA;IACnD,iEAA+C,CAAA;IAE/C,0CAA0C;IAC1C,6IAA6I;IAC7I,uHAAuH;IACvH,iDAA+B,CAAA;IAC/B,qEAAmD,CAAA;AACrD,CAAC,EAfW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAezB","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 */\nexport enum AttributeNames {\n AWS_OPERATION = 'aws.operation',\n CLOUD_REGION = 'cloud.region',\n AWS_SERVICE_API = 'aws.service.api',\n AWS_SERVICE_NAME = 'aws.service.name',\n AWS_SERVICE_IDENTIFIER = 'aws.service.identifier',\n AWS_REQUEST_ID = 'aws.request.id',\n AWS_REQUEST_EXTENDED_ID = 'aws.request.extended_id',\n AWS_SIGNATURE_VERSION = 'aws.signature.version',\n\n // TODO: Add these semantic attributes to:\n // - https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts\n // For S3, see specification: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/object-stores/s3.md\n AWS_S3_BUCKET = 'aws.s3.bucket',\n AWS_KINESIS_STREAM_NAME = 'aws.kinesis.stream.name',\n}\n"]}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,cAeX;AAfD,WAAY,cAAc;IACxB,iDAA+B,CAAA;IAC/B,+CAA6B,CAAA;IAC7B,qDAAmC,CAAA;IACnC,uDAAqC,CAAA;IACrC,mEAAiD,CAAA;IACjD,mDAAiC,CAAA;IACjC,qEAAmD,CAAA;IACnD,iEAA+C,CAAA;IAE/C,0CAA0C;IAC1C,6IAA6I;IAC7I,uHAAuH;IACvH,iDAA+B,CAAA;IAC/B,qEAAmD,CAAA;AACrD,CAAC,EAfW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAezB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport enum AttributeNames {\n AWS_OPERATION = 'aws.operation',\n CLOUD_REGION = 'cloud.region',\n AWS_SERVICE_API = 'aws.service.api',\n AWS_SERVICE_NAME = 'aws.service.name',\n AWS_SERVICE_IDENTIFIER = 'aws.service.identifier',\n AWS_REQUEST_ID = 'aws.request.id',\n AWS_REQUEST_EXTENDED_ID = 'aws.request.extended_id',\n AWS_SIGNATURE_VERSION = 'aws.signature.version',\n\n // TODO: Add these semantic attributes to:\n // - https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts\n // For S3, see specification: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/object-stores/s3.md\n AWS_S3_BUCKET = 'aws.s3.bucket',\n AWS_KINESIS_STREAM_NAME = 'aws.kinesis.stream.name',\n}\n"]}
@@ -3,18 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AwsInstrumentation = void 0;
4
4
  /*
5
5
  * Copyright The OpenTelemetry Authors
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * https://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
6
+ * SPDX-License-Identifier: Apache-2.0
18
7
  */
19
8
  var aws_sdk_1 = require("./aws-sdk");
20
9
  Object.defineProperty(exports, "AwsInstrumentation", { enumerable: true, get: function () { return aws_sdk_1.AwsInstrumentation; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,qCAA+C;AAAtC,6GAAA,kBAAkB,OAAA","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 */\nexport { AwsInstrumentation } from './aws-sdk';\nexport type {\n AwsSdkDynamoDBStatementSerializer,\n AwsSdkInstrumentationConfig,\n AwsSdkRequestCustomAttributeFunction,\n AwsSdkRequestHookInformation,\n AwsSdkResponseCustomAttributeFunction,\n AwsSdkResponseHookInformation,\n CommandInput,\n NormalizedRequest,\n NormalizedResponse,\n} from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,qCAA+C;AAAtC,6GAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport { AwsInstrumentation } from './aws-sdk';\nexport type {\n AwsSdkDynamoDBStatementSerializer,\n AwsSdkInstrumentationConfig,\n AwsSdkRequestCustomAttributeFunction,\n AwsSdkRequestHookInformation,\n AwsSdkResponseCustomAttributeFunction,\n AwsSdkResponseHookInformation,\n CommandInput,\n NormalizedRequest,\n NormalizedResponse,\n} from './types';\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.propwrap = void 0;
@@ -1 +1 @@
1
-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IAAI,CAAC,CAAC;SACrB;aAAM;YACL,GAAG,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACzB;QACD,MAAM,IAAI,GAAG,gBAAgB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAC9C,MAAM,gBAAgB,GAAG,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE;YAC1C,KAAK,EAAE,GAAG;YACV,UAAU,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU;SACrC,CAAC,CAAC;QACH,WAAW,CAAC,gBAAgB,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QAC9C,UAAU,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC;KAClC;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC,CAAC;AApDW,QAAA,QAAQ,YAoDnB","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/*\n * This block is derived from esbuild's bundling support.\n * https://github.com/evanw/esbuild/blob/v0.14.42/internal/runtime/runtime.go#L22\n *\n * License:\n * MIT License\n *\n * Copyright (c) 2020 Evan Wallace\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nconst __defProp = Object.defineProperty;\nconst __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nconst __hasOwnProp = Object.prototype.hasOwnProperty;\nconst __getOwnPropNames = Object.getOwnPropertyNames;\nconst __copyProps = (\n to: any,\n from: any,\n except: string,\n desc?: PropertyDescriptor | undefined\n) => {\n if ((from && typeof from === 'object') || typeof from === 'function') {\n for (const key of __getOwnPropNames(from)) {\n if (!__hasOwnProp.call(to, key) && key !== except) {\n __defProp(to, key, {\n get: () => from[key] as any,\n enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,\n });\n }\n }\n }\n return to;\n};\n\n/**\n * Return a new object that is a copy of `obj`, with its `subpath` property\n * replaced with the return value of `wrapper(original)`.\n *\n * This is similar to shimmer (i.e. `InstrumentationBase.prototype._wrap`).\n * However, it uses a different technique to support wrapping properties that\n * are only available via a getter (i.e. their property descriptor is `.writable\n * === false`).\n *\n * For example:\n * var os = propwrap(require('os'), 'platform', (orig) => {\n * return function wrappedPlatform () {\n * return orig().toUpperCase()\n * }\n * })\n * console.log(os.platform()) // => DARWIN\n *\n * The subpath can indicate a nested property. Each property in that subpath,\n * except the last, must identify an *Object*.\n *\n * Limitations:\n * - This doesn't handle possible Symbol properties on the copied object(s).\n * - This cannot wrap a property of a function, because we cannot create a\n * copy of the function.\n *\n * @param {object} obj\n * @param {string} subpath - The property subpath on `obj` to wrap. This may\n * point to a nested property by using a '.' to separate levels. For example:\n * var fs = wrap(fs, 'promises.sync', (orig) => { ... })\n * @param {Function} wrapper - A function of the form `function (orig)`, where\n * `orig` is the original property value. This must synchronously return the\n * new property value.\n * @returns {object} A new object with the wrapped property.\n * @throws {TypeError} if the subpath points to a non-existent property, or if\n * any but the last subpath part points to a non-Object.\n */\nexport const propwrap = (obj: any, subpath: string, wrapper: Function): any => {\n const parts = subpath.split('.');\n const namespaces = [obj];\n let namespace = obj;\n let key;\n let val;\n\n // 1. Traverse the subpath parts to sanity check and get references to the\n // Objects that we will be copying.\n for (let i = 0; i < parts.length; i++) {\n key = parts[i];\n val = namespace[key];\n if (!val) {\n throw new TypeError(\n `cannot wrap \"${subpath}\": \"<obj>.${parts\n .slice(0, i)\n .join('.')}\" is ${typeof val}`\n );\n } else if (i < parts.length - 1) {\n if (typeof val !== 'object') {\n throw new TypeError(\n `cannot wrap \"${subpath}\": \"<obj>.${parts\n .slice(0, i)\n .join('.')}\" is not an Object`\n );\n }\n namespace = val;\n namespaces.push(namespace);\n }\n }\n\n // 2. Now work backwards, wrapping each namespace with a new object that has a\n // copy of all the properties, except the one that we've wrapped.\n for (let i = parts.length - 1; i >= 0; i--) {\n key = parts[i];\n namespace = namespaces[i];\n if (i === parts.length - 1) {\n const orig = namespace[key];\n val = wrapper(orig);\n } else {\n val = namespaces[i + 1];\n }\n const desc = __getOwnPropDesc(namespace, key);\n const wrappedNamespace = __defProp({}, key, {\n value: val,\n enumerable: !desc || desc.enumerable,\n });\n __copyProps(wrappedNamespace, namespace, key);\n namespaces[i] = wrappedNamespace;\n }\n\n return namespaces[0];\n};\n"]}
1
+ {"version":3,"file":"propwrap.js","sourceRoot":"","sources":["../../src/propwrap.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACxC,MAAM,gBAAgB,GAAG,MAAM,CAAC,wBAAwB,CAAC;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,EAAE,GAAG;YACV,UAAU,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU;SACrC,CAAC,CAAC;QACH,WAAW,CAAC,gBAAgB,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QAC9C,UAAU,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC;KAClC;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC,CAAC;AApDW,QAAA,QAAQ,YAoDnB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This block is derived from esbuild's bundling support.\n * https://github.com/evanw/esbuild/blob/v0.14.42/internal/runtime/runtime.go#L22\n *\n * License:\n * MIT License\n *\n * Copyright (c) 2020 Evan Wallace\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nconst __defProp = Object.defineProperty;\nconst __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nconst __hasOwnProp = Object.prototype.hasOwnProperty;\nconst __getOwnPropNames = Object.getOwnPropertyNames;\nconst __copyProps = (\n to: any,\n from: any,\n except: string,\n desc?: PropertyDescriptor | undefined\n) => {\n if ((from && typeof from === 'object') || typeof from === 'function') {\n for (const key of __getOwnPropNames(from)) {\n if (!__hasOwnProp.call(to, key) && key !== except) {\n __defProp(to, key, {\n get: () => from[key] as any,\n enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,\n });\n }\n }\n }\n return to;\n};\n\n/**\n * Return a new object that is a copy of `obj`, with its `subpath` property\n * replaced with the return value of `wrapper(original)`.\n *\n * This is similar to shimmer (i.e. `InstrumentationBase.prototype._wrap`).\n * However, it uses a different technique to support wrapping properties that\n * are only available via a getter (i.e. their property descriptor is `.writable\n * === false`).\n *\n * For example:\n * var os = propwrap(require('os'), 'platform', (orig) => {\n * return function wrappedPlatform () {\n * return orig().toUpperCase()\n * }\n * })\n * console.log(os.platform()) // => DARWIN\n *\n * The subpath can indicate a nested property. Each property in that subpath,\n * except the last, must identify an *Object*.\n *\n * Limitations:\n * - This doesn't handle possible Symbol properties on the copied object(s).\n * - This cannot wrap a property of a function, because we cannot create a\n * copy of the function.\n *\n * @param {object} obj\n * @param {string} subpath - The property subpath on `obj` to wrap. This may\n * point to a nested property by using a '.' to separate levels. For example:\n * var fs = wrap(fs, 'promises.sync', (orig) => { ... })\n * @param {Function} wrapper - A function of the form `function (orig)`, where\n * `orig` is the original property value. This must synchronously return the\n * new property value.\n * @returns {object} A new object with the wrapped property.\n * @throws {TypeError} if the subpath points to a non-existent property, or if\n * any but the last subpath part points to a non-Object.\n */\nexport const propwrap = (obj: any, subpath: string, wrapper: Function): any => {\n const parts = subpath.split('.');\n const namespaces = [obj];\n let namespace = obj;\n let key;\n let val;\n\n // 1. Traverse the subpath parts to sanity check and get references to the\n // Objects that we will be copying.\n for (let i = 0; i < parts.length; i++) {\n key = parts[i];\n val = namespace[key];\n if (!val) {\n throw new TypeError(\n `cannot wrap \"${subpath}\": \"<obj>.${parts\n .slice(0, i)\n .join('.')}\" is ${typeof val}`\n );\n } else if (i < parts.length - 1) {\n if (typeof val !== 'object') {\n throw new TypeError(\n `cannot wrap \"${subpath}\": \"<obj>.${parts\n .slice(0, i)\n .join('.')}\" is not an Object`\n );\n }\n namespace = val;\n namespaces.push(namespace);\n }\n }\n\n // 2. Now work backwards, wrapping each namespace with a new object that has a\n // copy of all the properties, except the one that we've wrapped.\n for (let i = parts.length - 1; i >= 0; i--) {\n key = parts[i];\n namespace = namespaces[i];\n if (i === parts.length - 1) {\n const orig = namespace[key];\n val = wrapper(orig);\n } else {\n val = namespaces[i + 1];\n }\n const desc = __getOwnPropDesc(namespace, key);\n const wrappedNamespace = __defProp({}, key, {\n value: val,\n enumerable: !desc || desc.enumerable,\n });\n __copyProps(wrappedNamespace, namespace, key);\n namespaces[i] = wrappedNamespace;\n }\n\n return namespaces[0];\n};\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.MESSAGING_OPERATION_VALUE_RECEIVE = exports.MESSAGING_DESTINATION_KIND_VALUE_TOPIC = exports.ATTR_MESSAGING_DESTINATION_KIND = exports.ATTR_MESSAGING_DESTINATION = exports.ATTR_FAAS_EXECUTION = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"semconv-obsolete.js","sourceRoot":"","sources":["../../src/semconv-obsolete.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;;;;GAOG;AAEH;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,uBAAgC,CAAC;AAE3E;;;;GAIG;AACU,QAAA,+BAA+B,GAC1C,4BAAqC,CAAC;AAExC;;;;GAIG;AACU,QAAA,sCAAsC,GAAG,OAAgB,CAAC;AAEvE;;;;GAIG;AACU,QAAA,iCAAiC,GAAG,SAAkB,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/*\n * This file contains constants for values that where replaced/removed from\n * Semantic Conventions long enough ago that they do not have `ATTR_*`\n * constants in the `@opentelemetry/semantic-conventions` package. Eventually\n * it is expected that this instrumention will be updated to emit telemetry\n * using modern Semantic Conventions, dropping the need for the constants in\n * this file.\n */\n\n/**\n * The execution ID of the current function execution.\n *\n * @deprecated Use ATTR_FAAS_INVOCATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const ATTR_FAAS_EXECUTION = 'faas.execution' as const;\n\n/**\n * The message destination name. This might be equal to the span name but is required nevertheless.\n *\n * @deprecated Use ATTR_MESSAGING_DESTINATION_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const ATTR_MESSAGING_DESTINATION = 'messaging.destination' as const;\n\n/**\n * The kind of message destination.\n *\n * @deprecated Removed in semconv v1.20.0.\n */\nexport const ATTR_MESSAGING_DESTINATION_KIND =\n 'messaging.destination_kind' as const;\n\n/**\n * The kind of message destination.\n *\n * @deprecated Removed in semconv v1.20.0.\n */\nexport const MESSAGING_DESTINATION_KIND_VALUE_TOPIC = 'topic' as const;\n\n/**\n * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is &#34;send&#34;, this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.\n *\n * @deprecated Use MESSAGING_OPERATION_TYPE_VALUE_RECEIVE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const MESSAGING_OPERATION_VALUE_RECEIVE = 'receive' as const;\n"]}
1
+ {"version":3,"file":"semconv-obsolete.js","sourceRoot":"","sources":["../../src/semconv-obsolete.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;GAOG;AAEH;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,uBAAgC,CAAC;AAE3E;;;;GAIG;AACU,QAAA,+BAA+B,GAC1C,4BAAqC,CAAC;AAExC;;;;GAIG;AACU,QAAA,sCAAsC,GAAG,OAAgB,CAAC;AAEvE;;;;GAIG;AACU,QAAA,iCAAiC,GAAG,SAAkB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains constants for values that where replaced/removed from\n * Semantic Conventions long enough ago that they do not have `ATTR_*`\n * constants in the `@opentelemetry/semantic-conventions` package. Eventually\n * it is expected that this instrumention will be updated to emit telemetry\n * using modern Semantic Conventions, dropping the need for the constants in\n * this file.\n */\n\n/**\n * The execution ID of the current function execution.\n *\n * @deprecated Use ATTR_FAAS_INVOCATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const ATTR_FAAS_EXECUTION = 'faas.execution' as const;\n\n/**\n * The message destination name. This might be equal to the span name but is required nevertheless.\n *\n * @deprecated Use ATTR_MESSAGING_DESTINATION_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const ATTR_MESSAGING_DESTINATION = 'messaging.destination' as const;\n\n/**\n * The kind of message destination.\n *\n * @deprecated Removed in semconv v1.20.0.\n */\nexport const ATTR_MESSAGING_DESTINATION_KIND =\n 'messaging.destination_kind' as const;\n\n/**\n * The kind of message destination.\n *\n * @deprecated Removed in semconv v1.20.0.\n */\nexport const MESSAGING_DESTINATION_KIND_VALUE_TOPIC = 'topic' as const;\n\n/**\n * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is &#34;send&#34;, this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.\n *\n * @deprecated Use MESSAGING_OPERATION_TYPE_VALUE_RECEIVE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const MESSAGING_OPERATION_VALUE_RECEIVE = 'receive' as const;\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.ATTR_MESSAGING_SYSTEM = exports.ATTR_MESSAGING_OPERATION_TYPE = exports.ATTR_MESSAGING_OPERATION = exports.ATTR_MESSAGING_MESSAGE_ID = exports.ATTR_MESSAGING_DESTINATION_NAME = exports.ATTR_MESSAGING_BATCH_MESSAGE_COUNT = exports.ATTR_HTTP_STATUS_CODE = exports.ATTR_GEN_AI_USAGE_OUTPUT_TOKENS = exports.ATTR_GEN_AI_USAGE_INPUT_TOKENS = exports.ATTR_GEN_AI_TOKEN_TYPE = exports.ATTR_GEN_AI_SYSTEM = exports.ATTR_GEN_AI_RESPONSE_FINISH_REASONS = exports.ATTR_GEN_AI_REQUEST_TOP_P = exports.ATTR_GEN_AI_REQUEST_TEMPERATURE = exports.ATTR_GEN_AI_REQUEST_STOP_SEQUENCES = exports.ATTR_GEN_AI_REQUEST_MODEL = exports.ATTR_GEN_AI_REQUEST_MAX_TOKENS = exports.ATTR_GEN_AI_OPERATION_NAME = exports.ATTR_FAAS_INVOKED_REGION = exports.ATTR_FAAS_INVOKED_PROVIDER = exports.ATTR_FAAS_INVOKED_NAME = exports.ATTR_DB_SYSTEM = exports.ATTR_DB_STATEMENT = exports.ATTR_DB_OPERATION = exports.ATTR_DB_NAME = exports.ATTR_AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN = exports.ATTR_AWS_STEP_FUNCTIONS_ACTIVITY_ARN = exports.ATTR_AWS_SNS_TOPIC_ARN = exports.ATTR_AWS_SECRETSMANAGER_SECRET_ARN = exports.ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS = exports.ATTR_AWS_DYNAMODB_TABLE_NAMES = exports.ATTR_AWS_DYNAMODB_TABLE_COUNT = exports.ATTR_AWS_DYNAMODB_SELECT = exports.ATTR_AWS_DYNAMODB_SEGMENT = exports.ATTR_AWS_DYNAMODB_SCAN_FORWARD = exports.ATTR_AWS_DYNAMODB_SCANNED_COUNT = exports.ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = exports.ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = exports.ATTR_AWS_DYNAMODB_PROJECTION = exports.ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = exports.ATTR_AWS_DYNAMODB_LIMIT = exports.ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = exports.ATTR_AWS_DYNAMODB_INDEX_NAME = exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = exports.ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = exports.ATTR_AWS_DYNAMODB_COUNT = exports.ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY = exports.ATTR_AWS_DYNAMODB_CONSISTENT_READ = exports.ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AACU,QAAA,uCAAuC,GAClD,oCAA6C,CAAC;AAEhD;;;;GAIG;AACU,QAAA,iCAAiC,GAC5C,8BAAuC,CAAC;AAE1C;;;;;;GAMG;AACU,QAAA,mCAAmC,GAC9C,gCAAyC,CAAC;AAE5C;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,oBAA6B,CAAC;AAErE;;;;;;;GAOG;AACU,QAAA,uCAAuC,GAClD,oCAA6C,CAAC;AAEhD;;;;;;GAMG;AACU,QAAA,0CAA0C,GACrD,uCAAgD,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,gDAAgD,GAC3D,6CAAsD,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;GAMG;AACU,QAAA,yCAAyC,GACpD,sCAA+C,CAAC;AAElD;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,oBAA6B,CAAC;AAErE;;;;;;GAMG;AACU,QAAA,yCAAyC,GACpD,sCAA+C,CAAC;AAElD;;;;;;;;GAQG;AAC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AqB,CAAC;AAErD;;;;;;;;GAQG;AACU,QAAA,wBAAwB,GAAG,UAAmB,CAAC;AAE5D;;;;;;GAMG;AACU,QAAA,6BAA6B,GAAG,UAAmB,CAAC;AAEjE;;;;;;GAMG;AACU,QAAA,gCAAgC,GAAG,MAAe,CAAC;AAEhE;;;;;;GAMG;AACU,QAAA,+BAA+B,GAAG,aAAsB,CAAC;AAEtE;;;;;;GAMG;AACU,QAAA,6BAA6B,GAAG,OAAgB,CAAC;AAE9D;;;;;;GAMG;AACU,QAAA,8BAA8B,GAAG,QAAiB,CAAC;AAEhE;;;;GAIG;AACU,QAAA,uCAAuC,GAClD,kCAA2C,CAAC;AAE9C;;;;GAIG;AACU,QAAA,gCAAgC,GAC3C,2BAAoC,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/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The JSON-serialized value of each item in the `AttributeDefinitions` request field.\n *\n * @example [\"{ \"AttributeName\": \"string\", \"AttributeType\": \"string\" }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS =\n 'aws.dynamodb.attribute_definitions' as const;\n\n/**\n * The value of the `ConsistentRead` request parameter.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_CONSISTENT_READ =\n 'aws.dynamodb.consistent_read' as const;\n\n/**\n * The JSON-serialized value of each item in the `ConsumedCapacity` response field.\n *\n * @example [\"{ \"CapacityUnits\": number, \"GlobalSecondaryIndexes\": { \"string\" : { \"CapacityUnits\": number, \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number } }, \"LocalSecondaryIndexes\": { \"string\" : { \"CapacityUnits\": number, \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number } }, \"ReadCapacityUnits\": number, \"Table\": { \"CapacityUnits\": number, \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number }, \"TableName\": \"string\", \"WriteCapacityUnits\": number }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY =\n 'aws.dynamodb.consumed_capacity' as const;\n\n/**\n * The value of the `Count` response parameter.\n *\n * @example 10\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_COUNT = 'aws.dynamodb.count' as const;\n\n/**\n * The value of the `ExclusiveStartTableName` request parameter.\n *\n * @example Users\n * @example CatsTable\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE =\n 'aws.dynamodb.exclusive_start_table' as const;\n\n/**\n * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field\n *\n * @example [\"{ \"IndexName\": \"string\", \"KeySchema\": [ { \"AttributeName\": \"string\", \"KeyType\": \"string\" } ], \"Projection\": { \"NonKeyAttributes\": [ \"string\" ], \"ProjectionType\": \"string\" }, \"ProvisionedThroughput\": { \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number } }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES =\n 'aws.dynamodb.global_secondary_indexes' as const;\n\n/**\n * The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field.\n *\n * @example [\"{ \"Create\": { \"IndexName\": \"string\", \"KeySchema\": [ { \"AttributeName\": \"string\", \"KeyType\": \"string\" } ], \"Projection\": { \"NonKeyAttributes\": [ \"string\" ], \"ProjectionType\": \"string\" }, \"ProvisionedThroughput\": { \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number } }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES =\n 'aws.dynamodb.global_secondary_index_updates' as const;\n\n/**\n * The value of the `IndexName` request parameter.\n *\n * @example name_to_group\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name' as const;\n\n/**\n * The JSON-serialized value of the `ItemCollectionMetrics` response field.\n *\n * @example { \"string\" : [ { \"ItemCollectionKey\": { \"string\" : { \"B\": blob, \"BOOL\": boolean, \"BS\": [ blob ], \"L\": [ \"AttributeValue\" ], \"M\": { \"string\" : \"AttributeValue\" }, \"N\": \"string\", \"NS\": [ \"string\" ], \"NULL\": boolean, \"S\": \"string\", \"SS\": [ \"string\" ] } }, \"SizeEstimateRangeGB\": [ number ] } ] }\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS =\n 'aws.dynamodb.item_collection_metrics' as const;\n\n/**\n * The value of the `Limit` request parameter.\n *\n * @example 10\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit' as const;\n\n/**\n * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.\n *\n * @example [\"{ \"IndexArn\": \"string\", \"IndexName\": \"string\", \"IndexSizeBytes\": number, \"ItemCount\": number, \"KeySchema\": [ { \"AttributeName\": \"string\", \"KeyType\": \"string\" } ], \"Projection\": { \"NonKeyAttributes\": [ \"string\" ], \"ProjectionType\": \"string\" } }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES =\n 'aws.dynamodb.local_secondary_indexes' as const;\n\n/**\n * The value of the `ProjectionExpression` request parameter.\n *\n * @example Title\n * @example Title, Price, Color\n * @example Title, Description, RelatedItems, ProductReviews\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection' as const;\n\n/**\n * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.\n *\n * @example 1.0\n * @example 2.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY =\n 'aws.dynamodb.provisioned_read_capacity' as const;\n\n/**\n * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.\n *\n * @example 1.0\n * @example 2.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY =\n 'aws.dynamodb.provisioned_write_capacity' as const;\n\n/**\n * The value of the `ScannedCount` response parameter.\n *\n * @example 50\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_SCANNED_COUNT =\n 'aws.dynamodb.scanned_count' as const;\n\n/**\n * The value of the `ScanIndexForward` request parameter.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_SCAN_FORWARD =\n 'aws.dynamodb.scan_forward' as const;\n\n/**\n * The value of the `Segment` request parameter.\n *\n * @example 10\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment' as const;\n\n/**\n * The value of the `Select` request parameter.\n *\n * @example ALL_ATTRIBUTES\n * @example COUNT\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_SELECT = 'aws.dynamodb.select' as const;\n\n/**\n * The number of items in the `TableNames` response parameter.\n *\n * @example 20\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_TABLE_COUNT =\n 'aws.dynamodb.table_count' as const;\n\n/**\n * The keys in the `RequestItems` object field.\n *\n * @example [\"Users\", \"Cats\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_TABLE_NAMES =\n 'aws.dynamodb.table_names' as const;\n\n/**\n * The value of the `TotalSegments` request parameter.\n *\n * @example 100\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS =\n 'aws.dynamodb.total_segments' as const;\n\n/**\n * The ARN of the Secret stored in the Secrets Mangger\n *\n * @example arn:aws:secretsmanager:us-east-1:123456789012:secret:SecretName-6RandomCharacters\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_SECRETSMANAGER_SECRET_ARN =\n 'aws.secretsmanager.secret.arn' as const;\n\n/**\n * The ARN of the AWS SNS Topic. An Amazon SNS [topic](https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html) is a logical access point that acts as a communication channel.\n *\n * @example arn:aws:sns:us-east-1:123456789012:mystack-mytopic-NZJ5JSMVGFIE\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_SNS_TOPIC_ARN = 'aws.sns.topic.arn' as const;\n\n/**\n * The ARN of the AWS Step Functions Activity.\n *\n * @example arn:aws:states:us-east-1:123456789012:activity:get-greeting\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_STEP_FUNCTIONS_ACTIVITY_ARN =\n 'aws.step_functions.activity.arn' as const;\n\n/**\n * The ARN of the AWS Step Functions State Machine.\n *\n * @example arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN =\n 'aws.step_functions.state_machine.arn' as const;\n\n/**\n * Deprecated, use `db.namespace` instead.\n *\n * @example customers\n * @example main\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.namespace`.\n */\nexport const ATTR_DB_NAME = 'db.name' as const;\n\n/**\n * Deprecated, use `db.operation.name` instead.\n *\n * @example findAndModify\n * @example HMSET\n * @example SELECT\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.operation.name`.\n */\nexport const ATTR_DB_OPERATION = 'db.operation' as const;\n\n/**\n * The database statement being executed.\n *\n * @example SELECT * FROM wuser_table\n * @example SET mykey \"WuValue\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * The name of the invoked function.\n *\n * @example \"my-function\"\n *\n * @note **SHOULD** be equal to the `faas.name` resource attribute of the invoked function.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_INVOKED_NAME = 'faas.invoked_name' as const;\n\n/**\n * The cloud provider of the invoked function.\n *\n * @note **SHOULD** be equal to the `cloud.provider` resource attribute of the invoked function.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_INVOKED_PROVIDER = 'faas.invoked_provider' as const;\n\n/**\n * The cloud region of the invoked function.\n *\n * @example \"eu-central-1\"\n *\n * @note **SHOULD** be equal to the `cloud.region` resource attribute of the invoked function.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_INVOKED_REGION = 'faas.invoked_region' as const;\n\n/**\n * The name of the operation being performed.\n *\n * @note If one of the predefined values applies, but specific system uses a different name it's **RECOMMENDED** to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries **SHOULD** use applicable predefined value.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_OPERATION_NAME = 'gen_ai.operation.name' as const;\n\n/**\n * The maximum number of tokens the model generates for a request.\n *\n * @example 100\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_MAX_TOKENS =\n 'gen_ai.request.max_tokens' as const;\n\n/**\n * The name of the GenAI model a request is being made to.\n *\n * @example \"gpt-4\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_MODEL = 'gen_ai.request.model' as const;\n\n/**\n * List of sequences that the model will use to stop generating further tokens.\n *\n * @example [\"forest\", \"lived\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_STOP_SEQUENCES =\n 'gen_ai.request.stop_sequences' as const;\n\n/**\n * The temperature setting for the GenAI request.\n *\n * @example 0.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_TEMPERATURE =\n 'gen_ai.request.temperature' as const;\n\n/**\n * The top_p sampling setting for the GenAI request.\n *\n * @example 1.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_TOP_P = 'gen_ai.request.top_p' as const;\n\n/**\n * Array of reasons the model stopped generating tokens, corresponding to each generation received.\n *\n * @example [\"stop\"]\n * @example [\"stop\", \"length\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_RESPONSE_FINISH_REASONS =\n 'gen_ai.response.finish_reasons' as const;\n\n/**\n * Deprecated, use `gen_ai.provider.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `gen_ai.provider.name`.\n */\nexport const ATTR_GEN_AI_SYSTEM = 'gen_ai.system' as const;\n\n/**\n * The type of token being counted.\n *\n * @example input\n * @example output\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_TOKEN_TYPE = 'gen_ai.token.type' as const;\n\n/**\n * The number of tokens used in the GenAI input (prompt).\n *\n * @example 100\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_USAGE_INPUT_TOKENS =\n 'gen_ai.usage.input_tokens' as const;\n\n/**\n * The number of tokens used in the GenAI response (completion).\n *\n * @example 180\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_USAGE_OUTPUT_TOKENS =\n 'gen_ai.usage.output_tokens' as const;\n\n/**\n * Deprecated, use `http.response.status_code` instead.\n *\n * @example 200\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.response.status_code`.\n */\nexport const ATTR_HTTP_STATUS_CODE = 'http.status_code' as const;\n\n/**\n * The number of messages sent, received, or processed in the scope of the batching operation.\n *\n * @example 0\n * @example 1\n * @example 2\n *\n * @note Instrumentations **SHOULD NOT** set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations **SHOULD** use `messaging.batch.message_count` for batching APIs and **SHOULD NOT** use it for single-message APIs.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_BATCH_MESSAGE_COUNT =\n 'messaging.batch.message_count' as const;\n\n/**\n * The message destination name\n *\n * @example MyQueue\n * @example MyTopic\n *\n * @note Destination name **SHOULD** uniquely identify a specific queue, topic or other entity within the broker. If\n * the broker doesn't have such notion, the destination name **SHOULD** uniquely identify the broker.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_DESTINATION_NAME =\n 'messaging.destination.name' as const;\n\n/**\n * A value used by the messaging system as an identifier for the message, represented as a string.\n *\n * @example \"452a7c7c7c7048c2f887f61572b18fc2\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_MESSAGE_ID = 'messaging.message.id' as const;\n\n/**\n * Deprecated, use `messaging.operation.type` instead.\n *\n * @example publish\n * @example create\n * @example process\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `messaging.operation.type`.\n */\nexport const ATTR_MESSAGING_OPERATION = 'messaging.operation' as const;\n\n/**\n * A string identifying the type of the messaging operation.\n *\n * @note If a custom value is used, it **MUST** be of low cardinality.\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_OPERATION_TYPE =\n 'messaging.operation.type' as const;\n\n/**\n * The messaging system as identified by the client instrumentation.\n *\n * @note The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_SYSTEM = 'messaging.system' as const;\n\n/**\n * The name of the (logical) method being called, must be equal to the $method part in the span name.\n *\n * @example \"exampleMethod\"\n *\n * @note This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RPC_METHOD = 'rpc.method' as const;\n\n/**\n * The full (logical) name of the service being called, including its package name, if applicable.\n *\n * @example \"myservice.EchoService\"\n *\n * @note This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RPC_SERVICE = 'rpc.service' as const;\n\n/**\n * A string identifying the remoting system. See below for a list of well-known identifiers.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RPC_SYSTEM = 'rpc.system' as const;\n\n/**\n * Enum value \"dynamodb\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * Amazon DynamoDB\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `DB_SYSTEM_NAME_VALUE_DYNAMODB`.\n */\nexport const DB_SYSTEM_VALUE_DYNAMODB = 'dynamodb' as const;\n\n/**\n * Enum value \"dynamodb\" for attribute ATTR_DB_SYSTEM_NAME.\n *\n * Amazon DynamoDB\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_NAME_VALUE_DYNAMODB = 'dynamodb' as const;\n\n/**\n * Enum value \"chat\" for attribute {@link ATTR_GEN_AI_OPERATION_NAME}.\n *\n * Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat)\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const GEN_AI_OPERATION_NAME_VALUE_CHAT = 'chat' as const;\n\n/**\n * Enum value \"aws.bedrock\" for attribute {@link ATTR_GEN_AI_SYSTEM}.\n *\n * AWS Bedrock\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const GEN_AI_SYSTEM_VALUE_AWS_BEDROCK = 'aws.bedrock' as const;\n\n/**\n * Enum value \"input\" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}.\n *\n * Input tokens (prompt, input, etc.)\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const GEN_AI_TOKEN_TYPE_VALUE_INPUT = 'input' as const;\n\n/**\n * Enum value \"output\" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}.\n *\n * Output tokens (completion, response, etc.)\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const GEN_AI_TOKEN_TYPE_VALUE_OUTPUT = 'output' as const;\n\n/**\n * GenAI operation duration.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_GEN_AI_CLIENT_OPERATION_DURATION =\n 'gen_ai.client.operation.duration' as const;\n\n/**\n * Number of input and output tokens used.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_GEN_AI_CLIENT_TOKEN_USAGE =\n 'gen_ai.client.token.usage' as const;\n"]}
1
+ {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AACU,QAAA,uCAAuC,GAClD,oCAA6C,CAAC;AAEhD;;;;GAIG;AACU,QAAA,iCAAiC,GAC5C,8BAAuC,CAAC;AAE1C;;;;;;GAMG;AACU,QAAA,mCAAmC,GAC9C,gCAAyC,CAAC;AAE5C;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,oBAA6B,CAAC;AAErE;;;;;;;GAOG;AACU,QAAA,uCAAuC,GAClD,oCAA6C,CAAC;AAEhD;;;;;;GAMG;AACU,QAAA,0CAA0C,GACrD,uCAAgD,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,gDAAgD,GAC3D,6CAAsD,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,4BAA4B,GAA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tC;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACU,QAAA,eAAe,GAAG,YAAqB,CAAC;AAErD;;;;;;;;GAQG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;GAIG;AACU,QAAA,eAAe,GAAG,YAAqB,CAAC;AAErD;;;;;;;;GAQG;AACU,QAAA,wBAAwB,GAAG,UAAmB,CAAC;AAE5D;;;;;;GAMG;AACU,QAAA,6BAA6B,GAAG,UAAmB,CAAC;AAEjE;;;;;;GAMG;AACU,QAAA,gCAAgC,GAAG,MAAe,CAAC;AAEhE;;;;;;GAMG;AACU,QAAA,+BAA+B,GAAG,aAAsB,CAAC;AAEtE;;;;;;GAMG;AACU,QAAA,6BAA6B,GAAG,OAAgB,CAAC;AAE9D;;;;;;GAMG;AACU,QAAA,8BAA8B,GAAG,QAAiB,CAAC;AAEhE;;;;GAIG;AACU,QAAA,uCAAuC,GAClD,kCAA2C,CAAC;AAE9C;;;;GAIG;AACU,QAAA,gCAAgC,GAC3C,2BAAoC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The JSON-serialized value of each item in the `AttributeDefinitions` request field.\n *\n * @example [\"{ \"AttributeName\": \"string\", \"AttributeType\": \"string\" }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS =\n 'aws.dynamodb.attribute_definitions' as const;\n\n/**\n * The value of the `ConsistentRead` request parameter.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_CONSISTENT_READ =\n 'aws.dynamodb.consistent_read' as const;\n\n/**\n * The JSON-serialized value of each item in the `ConsumedCapacity` response field.\n *\n * @example [\"{ \"CapacityUnits\": number, \"GlobalSecondaryIndexes\": { \"string\" : { \"CapacityUnits\": number, \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number } }, \"LocalSecondaryIndexes\": { \"string\" : { \"CapacityUnits\": number, \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number } }, \"ReadCapacityUnits\": number, \"Table\": { \"CapacityUnits\": number, \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number }, \"TableName\": \"string\", \"WriteCapacityUnits\": number }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY =\n 'aws.dynamodb.consumed_capacity' as const;\n\n/**\n * The value of the `Count` response parameter.\n *\n * @example 10\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_COUNT = 'aws.dynamodb.count' as const;\n\n/**\n * The value of the `ExclusiveStartTableName` request parameter.\n *\n * @example Users\n * @example CatsTable\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE =\n 'aws.dynamodb.exclusive_start_table' as const;\n\n/**\n * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field\n *\n * @example [\"{ \"IndexName\": \"string\", \"KeySchema\": [ { \"AttributeName\": \"string\", \"KeyType\": \"string\" } ], \"Projection\": { \"NonKeyAttributes\": [ \"string\" ], \"ProjectionType\": \"string\" }, \"ProvisionedThroughput\": { \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number } }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES =\n 'aws.dynamodb.global_secondary_indexes' as const;\n\n/**\n * The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field.\n *\n * @example [\"{ \"Create\": { \"IndexName\": \"string\", \"KeySchema\": [ { \"AttributeName\": \"string\", \"KeyType\": \"string\" } ], \"Projection\": { \"NonKeyAttributes\": [ \"string\" ], \"ProjectionType\": \"string\" }, \"ProvisionedThroughput\": { \"ReadCapacityUnits\": number, \"WriteCapacityUnits\": number } }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES =\n 'aws.dynamodb.global_secondary_index_updates' as const;\n\n/**\n * The value of the `IndexName` request parameter.\n *\n * @example name_to_group\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name' as const;\n\n/**\n * The JSON-serialized value of the `ItemCollectionMetrics` response field.\n *\n * @example { \"string\" : [ { \"ItemCollectionKey\": { \"string\" : { \"B\": blob, \"BOOL\": boolean, \"BS\": [ blob ], \"L\": [ \"AttributeValue\" ], \"M\": { \"string\" : \"AttributeValue\" }, \"N\": \"string\", \"NS\": [ \"string\" ], \"NULL\": boolean, \"S\": \"string\", \"SS\": [ \"string\" ] } }, \"SizeEstimateRangeGB\": [ number ] } ] }\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS =\n 'aws.dynamodb.item_collection_metrics' as const;\n\n/**\n * The value of the `Limit` request parameter.\n *\n * @example 10\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit' as const;\n\n/**\n * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.\n *\n * @example [\"{ \"IndexArn\": \"string\", \"IndexName\": \"string\", \"IndexSizeBytes\": number, \"ItemCount\": number, \"KeySchema\": [ { \"AttributeName\": \"string\", \"KeyType\": \"string\" } ], \"Projection\": { \"NonKeyAttributes\": [ \"string\" ], \"ProjectionType\": \"string\" } }\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES =\n 'aws.dynamodb.local_secondary_indexes' as const;\n\n/**\n * The value of the `ProjectionExpression` request parameter.\n *\n * @example Title\n * @example Title, Price, Color\n * @example Title, Description, RelatedItems, ProductReviews\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection' as const;\n\n/**\n * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.\n *\n * @example 1.0\n * @example 2.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY =\n 'aws.dynamodb.provisioned_read_capacity' as const;\n\n/**\n * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.\n *\n * @example 1.0\n * @example 2.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY =\n 'aws.dynamodb.provisioned_write_capacity' as const;\n\n/**\n * The value of the `ScannedCount` response parameter.\n *\n * @example 50\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_SCANNED_COUNT =\n 'aws.dynamodb.scanned_count' as const;\n\n/**\n * The value of the `ScanIndexForward` request parameter.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_SCAN_FORWARD =\n 'aws.dynamodb.scan_forward' as const;\n\n/**\n * The value of the `Segment` request parameter.\n *\n * @example 10\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment' as const;\n\n/**\n * The value of the `Select` request parameter.\n *\n * @example ALL_ATTRIBUTES\n * @example COUNT\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_SELECT = 'aws.dynamodb.select' as const;\n\n/**\n * The number of items in the `TableNames` response parameter.\n *\n * @example 20\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_TABLE_COUNT =\n 'aws.dynamodb.table_count' as const;\n\n/**\n * The keys in the `RequestItems` object field.\n *\n * @example [\"Users\", \"Cats\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_TABLE_NAMES =\n 'aws.dynamodb.table_names' as const;\n\n/**\n * The value of the `TotalSegments` request parameter.\n *\n * @example 100\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS =\n 'aws.dynamodb.total_segments' as const;\n\n/**\n * The ARN of the Secret stored in the Secrets Mangger\n *\n * @example arn:aws:secretsmanager:us-east-1:123456789012:secret:SecretName-6RandomCharacters\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_SECRETSMANAGER_SECRET_ARN =\n 'aws.secretsmanager.secret.arn' as const;\n\n/**\n * The ARN of the AWS SNS Topic. An Amazon SNS [topic](https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html) is a logical access point that acts as a communication channel.\n *\n * @example arn:aws:sns:us-east-1:123456789012:mystack-mytopic-NZJ5JSMVGFIE\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_SNS_TOPIC_ARN = 'aws.sns.topic.arn' as const;\n\n/**\n * The ARN of the AWS Step Functions Activity.\n *\n * @example arn:aws:states:us-east-1:123456789012:activity:get-greeting\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_STEP_FUNCTIONS_ACTIVITY_ARN =\n 'aws.step_functions.activity.arn' as const;\n\n/**\n * The ARN of the AWS Step Functions State Machine.\n *\n * @example arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN =\n 'aws.step_functions.state_machine.arn' as const;\n\n/**\n * Deprecated, use `db.namespace` instead.\n *\n * @example customers\n * @example main\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.namespace`.\n */\nexport const ATTR_DB_NAME = 'db.name' as const;\n\n/**\n * Deprecated, use `db.operation.name` instead.\n *\n * @example findAndModify\n * @example HMSET\n * @example SELECT\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.operation.name`.\n */\nexport const ATTR_DB_OPERATION = 'db.operation' as const;\n\n/**\n * The database statement being executed.\n *\n * @example SELECT * FROM wuser_table\n * @example SET mykey \"WuValue\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * The name of the invoked function.\n *\n * @example \"my-function\"\n *\n * @note **SHOULD** be equal to the `faas.name` resource attribute of the invoked function.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_INVOKED_NAME = 'faas.invoked_name' as const;\n\n/**\n * The cloud provider of the invoked function.\n *\n * @note **SHOULD** be equal to the `cloud.provider` resource attribute of the invoked function.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_INVOKED_PROVIDER = 'faas.invoked_provider' as const;\n\n/**\n * The cloud region of the invoked function.\n *\n * @example \"eu-central-1\"\n *\n * @note **SHOULD** be equal to the `cloud.region` resource attribute of the invoked function.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_INVOKED_REGION = 'faas.invoked_region' as const;\n\n/**\n * The name of the operation being performed.\n *\n * @note If one of the predefined values applies, but specific system uses a different name it's **RECOMMENDED** to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries **SHOULD** use applicable predefined value.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_OPERATION_NAME = 'gen_ai.operation.name' as const;\n\n/**\n * The maximum number of tokens the model generates for a request.\n *\n * @example 100\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_MAX_TOKENS =\n 'gen_ai.request.max_tokens' as const;\n\n/**\n * The name of the GenAI model a request is being made to.\n *\n * @example \"gpt-4\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_MODEL = 'gen_ai.request.model' as const;\n\n/**\n * List of sequences that the model will use to stop generating further tokens.\n *\n * @example [\"forest\", \"lived\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_STOP_SEQUENCES =\n 'gen_ai.request.stop_sequences' as const;\n\n/**\n * The temperature setting for the GenAI request.\n *\n * @example 0.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_TEMPERATURE =\n 'gen_ai.request.temperature' as const;\n\n/**\n * The top_p sampling setting for the GenAI request.\n *\n * @example 1.0\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_REQUEST_TOP_P = 'gen_ai.request.top_p' as const;\n\n/**\n * Array of reasons the model stopped generating tokens, corresponding to each generation received.\n *\n * @example [\"stop\"]\n * @example [\"stop\", \"length\"]\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_RESPONSE_FINISH_REASONS =\n 'gen_ai.response.finish_reasons' as const;\n\n/**\n * Deprecated, use `gen_ai.provider.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `gen_ai.provider.name`.\n */\nexport const ATTR_GEN_AI_SYSTEM = 'gen_ai.system' as const;\n\n/**\n * The type of token being counted.\n *\n * @example input\n * @example output\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_TOKEN_TYPE = 'gen_ai.token.type' as const;\n\n/**\n * The number of tokens used in the GenAI input (prompt).\n *\n * @example 100\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_USAGE_INPUT_TOKENS =\n 'gen_ai.usage.input_tokens' as const;\n\n/**\n * The number of tokens used in the GenAI response (completion).\n *\n * @example 180\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_GEN_AI_USAGE_OUTPUT_TOKENS =\n 'gen_ai.usage.output_tokens' as const;\n\n/**\n * Deprecated, use `http.response.status_code` instead.\n *\n * @example 200\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.response.status_code`.\n */\nexport const ATTR_HTTP_STATUS_CODE = 'http.status_code' as const;\n\n/**\n * The number of messages sent, received, or processed in the scope of the batching operation.\n *\n * @example 0\n * @example 1\n * @example 2\n *\n * @note Instrumentations **SHOULD NOT** set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations **SHOULD** use `messaging.batch.message_count` for batching APIs and **SHOULD NOT** use it for single-message APIs.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_BATCH_MESSAGE_COUNT =\n 'messaging.batch.message_count' as const;\n\n/**\n * The message destination name\n *\n * @example MyQueue\n * @example MyTopic\n *\n * @note Destination name **SHOULD** uniquely identify a specific queue, topic or other entity within the broker. If\n * the broker doesn't have such notion, the destination name **SHOULD** uniquely identify the broker.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_DESTINATION_NAME =\n 'messaging.destination.name' as const;\n\n/**\n * A value used by the messaging system as an identifier for the message, represented as a string.\n *\n * @example \"452a7c7c7c7048c2f887f61572b18fc2\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_MESSAGE_ID = 'messaging.message.id' as const;\n\n/**\n * Deprecated, use `messaging.operation.type` instead.\n *\n * @example publish\n * @example create\n * @example process\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `messaging.operation.type`.\n */\nexport const ATTR_MESSAGING_OPERATION = 'messaging.operation' as const;\n\n/**\n * A string identifying the type of the messaging operation.\n *\n * @note If a custom value is used, it **MUST** be of low cardinality.\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_OPERATION_TYPE =\n 'messaging.operation.type' as const;\n\n/**\n * The messaging system as identified by the client instrumentation.\n *\n * @note The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_SYSTEM = 'messaging.system' as const;\n\n/**\n * The name of the (logical) method being called, must be equal to the $method part in the span name.\n *\n * @example \"exampleMethod\"\n *\n * @note This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RPC_METHOD = 'rpc.method' as const;\n\n/**\n * The full (logical) name of the service being called, including its package name, if applicable.\n *\n * @example \"myservice.EchoService\"\n *\n * @note This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RPC_SERVICE = 'rpc.service' as const;\n\n/**\n * A string identifying the remoting system. See below for a list of well-known identifiers.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RPC_SYSTEM = 'rpc.system' as const;\n\n/**\n * Enum value \"dynamodb\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * Amazon DynamoDB\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `DB_SYSTEM_NAME_VALUE_DYNAMODB`.\n */\nexport const DB_SYSTEM_VALUE_DYNAMODB = 'dynamodb' as const;\n\n/**\n * Enum value \"dynamodb\" for attribute ATTR_DB_SYSTEM_NAME.\n *\n * Amazon DynamoDB\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_NAME_VALUE_DYNAMODB = 'dynamodb' as const;\n\n/**\n * Enum value \"chat\" for attribute {@link ATTR_GEN_AI_OPERATION_NAME}.\n *\n * Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat)\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const GEN_AI_OPERATION_NAME_VALUE_CHAT = 'chat' as const;\n\n/**\n * Enum value \"aws.bedrock\" for attribute {@link ATTR_GEN_AI_SYSTEM}.\n *\n * AWS Bedrock\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const GEN_AI_SYSTEM_VALUE_AWS_BEDROCK = 'aws.bedrock' as const;\n\n/**\n * Enum value \"input\" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}.\n *\n * Input tokens (prompt, input, etc.)\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const GEN_AI_TOKEN_TYPE_VALUE_INPUT = 'input' as const;\n\n/**\n * Enum value \"output\" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}.\n *\n * Output tokens (completion, response, etc.)\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const GEN_AI_TOKEN_TYPE_VALUE_OUTPUT = 'output' as const;\n\n/**\n * GenAI operation duration.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_GEN_AI_CLIENT_OPERATION_DURATION =\n 'gen_ai.client.operation.duration' as const;\n\n/**\n * Number of input and output tokens used.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_GEN_AI_CLIENT_TOKEN_USAGE =\n 'gen_ai.client.token.usage' as const;\n"]}
@@ -3,18 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addPropagationFieldsToAttributeNames = exports.extractPropagationContext = exports.injectPropagationContext = exports.contextGetter = exports.contextSetter = exports.MAX_MESSAGE_ATTRIBUTES = void 0;
4
4
  /*
5
5
  * Copyright The OpenTelemetry Authors
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * https://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
6
+ * SPDX-License-Identifier: Apache-2.0
18
7
  */
19
8
  const api_1 = require("@opentelemetry/api");
20
9
  // https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html
@@ -1 +1 @@
1
- {"version":3,"file":"MessageAttributes.js","sourceRoot":"","sources":["../../../src/services/MessageAttributes.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAM4B;AAG5B,6FAA6F;AAChF,QAAA,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,aAAa;IAIjB,GAAG,CACD,OAA8D,EAC9D,GAAW,EACX,KAAa;QAEb,OAAO,CAAC,GAAG,CAAC,GAAG;YACb,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,KAAe;SAC7B,CAAC;IACJ,CAAC;CACF;AACY,QAAA,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;AASjD,MAAM,aAAa;IAIjB,IAAI,CACF,OAA8D;QAE9D,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,GAAG,CACD,OAA4B,EAC5B,GAAW;QAEX,OAAO,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,WAAW,IAAI,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAC9D,CAAC;CACF;AACY,QAAA,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;AAE1C,MAAM,wBAAwB,GAAG,CACtC,aAAqE,EACd,EAAE;IACzD,MAAM,UAAU,GAAG,aAAa,IAAI,EAAE,CAAC;IACvC,IACE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,iBAAW,CAAC,MAAM,EAAE,CAAC,MAAM;QAC5D,8BAAsB,EACtB;QACA,iBAAW,CAAC,MAAM,CAAC,aAAO,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,qBAAa,CAAC,CAAC;KACjE;SAAM;QACL,UAAI,CAAC,IAAI,CACP,uHAAuH,CACxH,CAAC;KACH;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAfW,QAAA,wBAAwB,4BAenC;AAEK,MAAM,yBAAyB,GAAG,CACvC,OAAoB,EACpB,uCAA4D,EAC3B,EAAE;IACnC,MAAM,iBAAiB,GAAG,iBAAW,CAAC,MAAM,EAAE,CAAC;IAC/C,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CACtC,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAChC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,IAAI,oBAAoB,EAAE;QACxB,OAAO,OAAO,CAAC,iBAAiB,CAAC;KAClC;SAAM,IAAI,uCAAuC,IAAI,OAAO,CAAC,IAAI,EAAE;QAClE,IAAI;YACF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzC,OAAO,OAAO,CAAC,iBAAiB,CAAC;SAClC;QAAC,MAAM;YACN,UAAI,CAAC,KAAK,CACR,wFAAwF,CACzF,CAAC;SACH;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AArBW,QAAA,yBAAyB,6BAqBpC;AAEK,MAAM,oCAAoC,GAAG,CAClD,wBAAkC,EAAE,EACpC,iBAA2B,EAC3B,EAAE;IACF,OAAO,qBAAqB,CAAC,MAAM;QACjC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,qBAAqB,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,iBAAiB,CAAC;AACxB,CAAC,CAAC;AAPW,QAAA,oCAAoC,wCAO/C","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 {\n TextMapGetter,\n TextMapSetter,\n context,\n propagation,\n diag,\n} from '@opentelemetry/api';\nimport type { SQS, SNS } from '../aws-sdk.types';\n\n// https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html\nexport const MAX_MESSAGE_ATTRIBUTES = 10;\nclass ContextSetter\n implements\n TextMapSetter<SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap>\n{\n set(\n carrier: SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap,\n key: string,\n value: string\n ) {\n carrier[key] = {\n DataType: 'String',\n StringValue: value as string,\n };\n }\n}\nexport const contextSetter = new ContextSetter();\n\nexport interface AwsSdkContextObject {\n [key: string]: {\n StringValue?: string;\n Value?: string;\n };\n}\n\nclass ContextGetter\n implements\n TextMapGetter<SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap>\n{\n keys(\n carrier: SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap\n ): string[] {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n }\n\n get(\n carrier: AwsSdkContextObject,\n key: string\n ): undefined | string | string[] {\n return carrier?.[key]?.StringValue || carrier?.[key]?.Value;\n }\n}\nexport const contextGetter = new ContextGetter();\n\nexport const injectPropagationContext = (\n attributesMap?: SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap\n): SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap => {\n const attributes = attributesMap ?? {};\n if (\n Object.keys(attributes).length + propagation.fields().length <=\n MAX_MESSAGE_ATTRIBUTES\n ) {\n propagation.inject(context.active(), attributes, contextSetter);\n } else {\n diag.warn(\n 'aws-sdk instrumentation: cannot set context propagation on SQS/SNS message due to maximum amount of MessageAttributes'\n );\n }\n return attributes;\n};\n\nexport const extractPropagationContext = (\n message: SQS.Message,\n sqsExtractContextPropagationFromPayload: boolean | undefined\n): AwsSdkContextObject | undefined => {\n const propagationFields = propagation.fields();\n const hasPropagationFields = Object.keys(\n message.MessageAttributes || []\n ).some(attr => propagationFields.includes(attr));\n if (hasPropagationFields) {\n return message.MessageAttributes;\n } else if (sqsExtractContextPropagationFromPayload && message.Body) {\n try {\n const payload = JSON.parse(message.Body);\n return payload.MessageAttributes;\n } catch {\n diag.debug(\n 'failed to parse SQS payload to extract context propagation, trace might be incomplete.'\n );\n }\n }\n return undefined;\n};\n\nexport const addPropagationFieldsToAttributeNames = (\n messageAttributeNames: string[] = [],\n propagationFields: string[]\n) => {\n return messageAttributeNames.length\n ? Array.from(new Set([...messageAttributeNames, ...propagationFields]))\n : propagationFields;\n};\n"]}
1
+ {"version":3,"file":"MessageAttributes.js","sourceRoot":"","sources":["../../../src/services/MessageAttributes.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,4CAM4B;AAG5B,6FAA6F;AAChF,QAAA,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,aAAa;IAIjB,GAAG,CACD,OAA8D,EAC9D,GAAW,EACX,KAAa;QAEb,OAAO,CAAC,GAAG,CAAC,GAAG;YACb,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,KAAe;SAC7B,CAAC;IACJ,CAAC;CACF;AACY,QAAA,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;AASjD,MAAM,aAAa;IAIjB,IAAI,CACF,OAA8D;QAE9D,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,GAAG,CACD,OAA4B,EAC5B,GAAW;QAEX,OAAO,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,WAAW,IAAI,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAC9D,CAAC;CACF;AACY,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AkC,EAAE,EACpC,iBAA2B,EAC3B,EAAE;IACF,OAAO,qBAAqB,CAAC,MAAM;QACjC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,qBAAqB,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,iBAAiB,CAAC;AACxB,CAAC,CAAC;AAPW,QAAA,oCAAoC,wCAO/C","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n TextMapGetter,\n TextMapSetter,\n context,\n propagation,\n diag,\n} from '@opentelemetry/api';\nimport type { SQS, SNS } from '../aws-sdk.types';\n\n// https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html\nexport const MAX_MESSAGE_ATTRIBUTES = 10;\nclass ContextSetter\n implements\n TextMapSetter<SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap>\n{\n set(\n carrier: SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap,\n key: string,\n value: string\n ) {\n carrier[key] = {\n DataType: 'String',\n StringValue: value as string,\n };\n }\n}\nexport const contextSetter = new ContextSetter();\n\nexport interface AwsSdkContextObject {\n [key: string]: {\n StringValue?: string;\n Value?: string;\n };\n}\n\nclass ContextGetter\n implements\n TextMapGetter<SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap>\n{\n keys(\n carrier: SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap\n ): string[] {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n }\n\n get(\n carrier: AwsSdkContextObject,\n key: string\n ): undefined | string | string[] {\n return carrier?.[key]?.StringValue || carrier?.[key]?.Value;\n }\n}\nexport const contextGetter = new ContextGetter();\n\nexport const injectPropagationContext = (\n attributesMap?: SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap\n): SQS.MessageBodyAttributeMap | SNS.MessageAttributeMap => {\n const attributes = attributesMap ?? {};\n if (\n Object.keys(attributes).length + propagation.fields().length <=\n MAX_MESSAGE_ATTRIBUTES\n ) {\n propagation.inject(context.active(), attributes, contextSetter);\n } else {\n diag.warn(\n 'aws-sdk instrumentation: cannot set context propagation on SQS/SNS message due to maximum amount of MessageAttributes'\n );\n }\n return attributes;\n};\n\nexport const extractPropagationContext = (\n message: SQS.Message,\n sqsExtractContextPropagationFromPayload: boolean | undefined\n): AwsSdkContextObject | undefined => {\n const propagationFields = propagation.fields();\n const hasPropagationFields = Object.keys(\n message.MessageAttributes || []\n ).some(attr => propagationFields.includes(attr));\n if (hasPropagationFields) {\n return message.MessageAttributes;\n } else if (sqsExtractContextPropagationFromPayload && message.Body) {\n try {\n const payload = JSON.parse(message.Body);\n return payload.MessageAttributes;\n } catch {\n diag.debug(\n 'failed to parse SQS payload to extract context propagation, trace might be incomplete.'\n );\n }\n }\n return undefined;\n};\n\nexport const addPropagationFieldsToAttributeNames = (\n messageAttributeNames: string[] = [],\n propagationFields: string[]\n) => {\n return messageAttributeNames.length\n ? Array.from(new Set([...messageAttributeNames, ...propagationFields]))\n : propagationFields;\n};\n"]}