@opentelemetry/instrumentation-amqplib 0.52.0 → 0.52.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/src/amqplib.js +13 -12
- package/build/src/amqplib.js.map +1 -1
- package/build/src/semconv-obsolete.d.ts +63 -0
- package/build/src/semconv-obsolete.js +89 -0
- package/build/src/semconv-obsolete.js.map +1 -0
- package/build/src/semconv.d.ts +41 -0
- package/build/src/semconv.js +64 -0
- package/build/src/semconv.js.map +1 -0
- package/build/src/utils.js +11 -10
- package/build/src/utils.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +4 -6
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ By default, the tests that connect to RabbitMQ are skipped. To make sure these t
|
|
|
89
89
|
|
|
90
90
|
## Semantic Conventions
|
|
91
91
|
|
|
92
|
-
This package
|
|
92
|
+
This package emits telemetry using Semantic Convention [version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md)
|
|
93
93
|
|
|
94
94
|
Attributes collected:
|
|
95
95
|
|
package/build/src/amqplib.js
CHANGED
|
@@ -19,7 +19,8 @@ exports.AmqplibInstrumentation = void 0;
|
|
|
19
19
|
const api_1 = require("@opentelemetry/api");
|
|
20
20
|
const core_1 = require("@opentelemetry/core");
|
|
21
21
|
const instrumentation_1 = require("@opentelemetry/instrumentation");
|
|
22
|
-
const
|
|
22
|
+
const semconv_1 = require("./semconv");
|
|
23
|
+
const semconv_obsolete_1 = require("../src/semconv-obsolete");
|
|
23
24
|
const types_1 = require("./types");
|
|
24
25
|
const utils_1 = require("./utils");
|
|
25
26
|
/** @knipignore */
|
|
@@ -220,12 +221,12 @@ class AmqplibInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
|
220
221
|
kind: api_1.SpanKind.CONSUMER,
|
|
221
222
|
attributes: {
|
|
222
223
|
...channel?.connection?.[utils_1.CONNECTION_ATTRIBUTES],
|
|
223
|
-
[
|
|
224
|
-
[
|
|
225
|
-
[
|
|
226
|
-
[
|
|
227
|
-
[
|
|
228
|
-
[
|
|
224
|
+
[semconv_obsolete_1.ATTR_MESSAGING_DESTINATION]: exchange,
|
|
225
|
+
[semconv_obsolete_1.ATTR_MESSAGING_DESTINATION_KIND]: semconv_obsolete_1.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,
|
|
226
|
+
[semconv_obsolete_1.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: msg.fields?.routingKey,
|
|
227
|
+
[semconv_1.ATTR_MESSAGING_OPERATION]: semconv_obsolete_1.MESSAGING_OPERATION_VALUE_PROCESS,
|
|
228
|
+
[semconv_obsolete_1.OLD_ATTR_MESSAGING_MESSAGE_ID]: msg?.properties.messageId,
|
|
229
|
+
[semconv_obsolete_1.ATTR_MESSAGING_CONVERSATION_ID]: msg?.properties.correlationId,
|
|
229
230
|
},
|
|
230
231
|
links,
|
|
231
232
|
}, parentContext);
|
|
@@ -361,11 +362,11 @@ class AmqplibInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
|
361
362
|
kind: api_1.SpanKind.PRODUCER,
|
|
362
363
|
attributes: {
|
|
363
364
|
...channel.connection[utils_1.CONNECTION_ATTRIBUTES],
|
|
364
|
-
[
|
|
365
|
-
[
|
|
366
|
-
[
|
|
367
|
-
[
|
|
368
|
-
[
|
|
365
|
+
[semconv_obsolete_1.ATTR_MESSAGING_DESTINATION]: exchange,
|
|
366
|
+
[semconv_obsolete_1.ATTR_MESSAGING_DESTINATION_KIND]: semconv_obsolete_1.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,
|
|
367
|
+
[semconv_obsolete_1.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey,
|
|
368
|
+
[semconv_obsolete_1.OLD_ATTR_MESSAGING_MESSAGE_ID]: options?.messageId,
|
|
369
|
+
[semconv_obsolete_1.ATTR_MESSAGING_CONVERSATION_ID]: options?.correlationId,
|
|
369
370
|
},
|
|
370
371
|
});
|
|
371
372
|
const modifiedOptions = options ?? {};
|
package/build/src/amqplib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amqplib.js","sourceRoot":"","sources":["../../src/amqplib.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAW4B;AAC5B,8CAI6B;AAC7B,oEAMwC;AACxC,8EAS6C;AAQ7C,mCAIiB;AACjB,mCAgBiB;AACjB,kBAAkB;AAClB,uCAA0D;AAE1D,MAAM,iBAAiB,GAAG,CAAC,YAAY,CAAC,CAAC;AAEzC,MAAa,sBAAuB,SAAQ,qCAAiD;IAC3F,YAAY,SAAuC,EAAE;QACnD,KAAK,CAAC,sBAAY,EAAE,yBAAe,EAAE,EAAE,GAAG,sBAAc,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;IAEQ,SAAS,CAAC,SAAuC,EAAE;QAC1D,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,sBAAc,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC;IAES,IAAI;QACZ,MAAM,sBAAsB,GAAG,IAAI,+CAA6B,CAC9D,8BAA8B,EAC9B,iBAAiB,EACjB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EACjC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CACpC,CAAC;QAEF,MAAM,uBAAuB,GAAG,IAAI,+CAA6B,CAC/D,+BAA+B,EAC/B,iBAAiB,EACjB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EACjC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CACpC,CAAC;QAEF,MAAM,iBAAiB,GAAG,IAAI,+CAA6B,CACzD,wBAAwB,EACxB,iBAAiB,EACjB,IAAI,CAAC,YAAY,CAAC,I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aACP;YACD,IAAI,CAAC,eAAe,CAClB,WAAW,CAAC,GAAG,EACf,IAAI,EACJ,oBAAY,CAAC,sBAAsB,EACnC,IAAI,CACL,CAAC;SACH;QACD,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF;AAvqBD,wDAuqBC","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 context,\n diag,\n propagation,\n trace,\n Span,\n SpanKind,\n SpanStatusCode,\n ROOT_CONTEXT,\n Link,\n Context,\n} from '@opentelemetry/api';\nimport {\n hrTime,\n hrTimeDuration,\n hrTimeToMilliseconds,\n} from '@opentelemetry/core';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n isWrapped,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport {\n SEMATTRS_MESSAGING_DESTINATION,\n SEMATTRS_MESSAGING_DESTINATION_KIND,\n MESSAGINGDESTINATIONKINDVALUES_TOPIC,\n SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY,\n SEMATTRS_MESSAGING_OPERATION,\n MESSAGINGOPERATIONVALUES_PROCESS,\n SEMATTRS_MESSAGING_MESSAGE_ID,\n SEMATTRS_MESSAGING_CONVERSATION_ID,\n} from '@opentelemetry/semantic-conventions';\nimport type {\n Connection,\n ConsumeMessage,\n Message,\n Options,\n Replies,\n} from 'amqplib';\nimport {\n AmqplibInstrumentationConfig,\n DEFAULT_CONFIG,\n EndOperation,\n} from './types';\nimport {\n CHANNEL_CONSUME_TIMEOUT_TIMER,\n CHANNEL_SPANS_NOT_ENDED,\n CONNECTION_ATTRIBUTES,\n getConnectionAttributesFromServer,\n getConnectionAttributesFromUrl,\n InstrumentationConnection,\n InstrumentationConsumeChannel,\n InstrumentationConsumeMessage,\n InstrumentationMessage,\n InstrumentationPublishChannel,\n isConfirmChannelTracing,\n markConfirmChannelTracing,\n MESSAGE_STORED_SPAN,\n normalizeExchange,\n unmarkConfirmChannelTracing,\n} from './utils';\n/** @knipignore */\nimport { PACKAGE_NAME, PACKAGE_VERSION } from './version';\n\nconst supportedVersions = ['>=0.5.5 <1'];\n\nexport class AmqplibInstrumentation extends InstrumentationBase<AmqplibInstrumentationConfig> {\n constructor(config: AmqplibInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, { ...DEFAULT_CONFIG, ...config });\n }\n\n override setConfig(config: AmqplibInstrumentationConfig = {}) {\n super.setConfig({ ...DEFAULT_CONFIG, ...config });\n }\n\n protected init() {\n const channelModelModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/channel_model.js',\n supportedVersions,\n this.patchChannelModel.bind(this),\n this.unpatchChannelModel.bind(this)\n );\n\n const callbackModelModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/callback_model.js',\n supportedVersions,\n this.patchChannelModel.bind(this),\n this.unpatchChannelModel.bind(this)\n );\n\n const connectModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/connect.js',\n supportedVersions,\n this.patchConnect.bind(this),\n this.unpatchConnect.bind(this)\n );\n\n const module = new InstrumentationNodeModuleDefinition(\n 'amqplib',\n supportedVersions,\n undefined,\n undefined,\n [channelModelModuleFile, connectModuleFile, callbackModelModuleFile]\n );\n return module;\n }\n\n private patchConnect(moduleExports: any) {\n moduleExports = this.unpatchConnect(moduleExports);\n if (!isWrapped(moduleExports.connect)) {\n this._wrap(moduleExports, 'connect', this.getConnectPatch.bind(this));\n }\n return moduleExports;\n }\n\n private unpatchConnect(moduleExports: any) {\n if (isWrapped(moduleExports.connect)) {\n this._unwrap(moduleExports, 'connect');\n }\n return moduleExports;\n }\n\n private patchChannelModel(\n moduleExports: any,\n moduleVersion: string | undefined\n ) {\n if (!isWrapped(moduleExports.Channel.prototype.publish)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'publish',\n this.getPublishPatch.bind(this, moduleVersion)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.consume)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'consume',\n this.getConsumePatch.bind(this, moduleVersion)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.ack)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'ack',\n this.getAckPatch.bind(this, false, EndOperation.Ack)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.nack)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'nack',\n this.getAckPatch.bind(this, true, EndOperation.Nack)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.reject)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'reject',\n this.getAckPatch.bind(this, true, EndOperation.Reject)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.ackAll)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'ackAll',\n this.getAckAllPatch.bind(this, false, EndOperation.AckAll)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.nackAll)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'nackAll',\n this.getAckAllPatch.bind(this, true, EndOperation.NackAll)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.emit)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'emit',\n this.getChannelEmitPatch.bind(this)\n );\n }\n if (!isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {\n this._wrap(\n moduleExports.ConfirmChannel.prototype,\n 'publish',\n this.getConfirmedPublishPatch.bind(this, moduleVersion)\n );\n }\n return moduleExports;\n }\n\n private unpatchChannelModel(moduleExports: any) {\n if (isWrapped(moduleExports.Channel.prototype.publish)) {\n this._unwrap(moduleExports.Channel.prototype, 'publish');\n }\n if (isWrapped(moduleExports.Channel.prototype.consume)) {\n this._unwrap(moduleExports.Channel.prototype, 'consume');\n }\n if (isWrapped(moduleExports.Channel.prototype.ack)) {\n this._unwrap(moduleExports.Channel.prototype, 'ack');\n }\n if (isWrapped(moduleExports.Channel.prototype.nack)) {\n this._unwrap(moduleExports.Channel.prototype, 'nack');\n }\n if (isWrapped(moduleExports.Channel.prototype.reject)) {\n this._unwrap(moduleExports.Channel.prototype, 'reject');\n }\n if (isWrapped(moduleExports.Channel.prototype.ackAll)) {\n this._unwrap(moduleExports.Channel.prototype, 'ackAll');\n }\n if (isWrapped(moduleExports.Channel.prototype.nackAll)) {\n this._unwrap(moduleExports.Channel.prototype, 'nackAll');\n }\n if (isWrapped(moduleExports.Channel.prototype.emit)) {\n this._unwrap(moduleExports.Channel.prototype, 'emit');\n }\n if (isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {\n this._unwrap(moduleExports.ConfirmChannel.prototype, 'publish');\n }\n return moduleExports;\n }\n\n private getConnectPatch(\n original: (\n url: string | Options.Connect,\n socketOptions: any,\n openCallback: (err: any, connection: Connection) => void\n ) => Connection\n ) {\n return function patchedConnect(\n this: unknown,\n url: string | Options.Connect,\n socketOptions: any,\n openCallback: Function\n ) {\n return original.call(\n this,\n url,\n socketOptions,\n function (this: unknown, err, conn: InstrumentationConnection) {\n if (err == null) {\n const urlAttributes = getConnectionAttributesFromUrl(url);\n const serverAttributes = getConnectionAttributesFromServer(conn);\n conn[CONNECTION_ATTRIBUTES] = {\n ...urlAttributes,\n ...serverAttributes,\n };\n }\n openCallback.apply(this, arguments);\n }\n );\n };\n }\n\n private getChannelEmitPatch(original: Function) {\n const self = this;\n return function emit(\n this: InstrumentationConsumeChannel,\n eventName: string\n ) {\n if (eventName === 'close') {\n self.endAllSpansOnChannel(\n this,\n true,\n EndOperation.ChannelClosed,\n undefined\n );\n const activeTimer = this[CHANNEL_CONSUME_TIMEOUT_TIMER];\n if (activeTimer) {\n clearInterval(activeTimer);\n }\n this[CHANNEL_CONSUME_TIMEOUT_TIMER] = undefined;\n } else if (eventName === 'error') {\n self.endAllSpansOnChannel(\n this,\n true,\n EndOperation.ChannelError,\n undefined\n );\n }\n return original.apply(this, arguments);\n };\n }\n\n private getAckAllPatch(\n isRejected: boolean,\n endOperation: EndOperation,\n original: Function\n ) {\n const self = this;\n return function ackAll(\n this: InstrumentationConsumeChannel,\n requeueOrEmpty?: boolean\n ): void {\n self.endAllSpansOnChannel(this, isRejected, endOperation, requeueOrEmpty);\n return original.apply(this, arguments);\n };\n }\n\n private getAckPatch(\n isRejected: boolean,\n endOperation: EndOperation,\n original: Function\n ) {\n const self = this;\n return function ack(\n this: InstrumentationConsumeChannel,\n message: Message,\n allUpToOrRequeue?: boolean,\n requeue?: boolean\n ): void {\n const channel = this;\n // we use this patch in reject function as well, but it has different signature\n const requeueResolved =\n endOperation === EndOperation.Reject ? allUpToOrRequeue : requeue;\n\n const spansNotEnded: { msg: Message }[] =\n channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n const msgIndex = spansNotEnded.findIndex(\n msgDetails => msgDetails.msg === message\n );\n if (msgIndex < 0) {\n // should not happen in happy flow\n // but possible if user is calling the api function ack twice with same message\n self.endConsumerSpan(\n message,\n isRejected,\n endOperation,\n requeueResolved\n );\n } else if (endOperation !== EndOperation.Reject && allUpToOrRequeue) {\n for (let i = 0; i <= msgIndex; i++) {\n self.endConsumerSpan(\n spansNotEnded[i].msg,\n isRejected,\n endOperation,\n requeueResolved\n );\n }\n spansNotEnded.splice(0, msgIndex + 1);\n } else {\n self.endConsumerSpan(\n message,\n isRejected,\n endOperation,\n requeueResolved\n );\n spansNotEnded.splice(msgIndex, 1);\n }\n return original.apply(this, arguments);\n };\n }\n\n private getConsumePatch(\n moduleVersion: string | undefined,\n original: Function\n ) {\n const self = this;\n return function consume(\n this: InstrumentationConsumeChannel,\n queue: string,\n onMessage: (msg: ConsumeMessage | null) => void,\n options?: Options.Consume\n ): Promise<Replies.Consume> {\n const channel = this;\n if (\n !Object.prototype.hasOwnProperty.call(channel, CHANNEL_SPANS_NOT_ENDED)\n ) {\n const { consumeTimeoutMs } = self.getConfig();\n if (consumeTimeoutMs) {\n const timer = setInterval(() => {\n self.checkConsumeTimeoutOnChannel(channel);\n }, consumeTimeoutMs);\n timer.unref();\n channel[CHANNEL_CONSUME_TIMEOUT_TIMER] = timer;\n }\n channel[CHANNEL_SPANS_NOT_ENDED] = [];\n }\n\n const patchedOnMessage = function (\n this: unknown,\n msg: InstrumentationConsumeMessage | null\n ) {\n // msg is expected to be null for signaling consumer cancel notification\n // https://www.rabbitmq.com/consumer-cancel.html\n // in this case, we do not start a span, as this is not a real message.\n if (!msg) {\n return onMessage.call(this, msg);\n }\n\n const headers = msg.properties.headers ?? {};\n let parentContext: Context | undefined = propagation.extract(\n ROOT_CONTEXT,\n headers\n );\n const exchange = msg.fields?.exchange;\n let links: Link[] | undefined;\n if (self._config.useLinksForConsume) {\n const parentSpanContext = parentContext\n ? trace.getSpan(parentContext)?.spanContext()\n : undefined;\n parentContext = undefined;\n if (parentSpanContext) {\n links = [\n {\n context: parentSpanContext,\n },\n ];\n }\n }\n const span = self.tracer.startSpan(\n `${queue} process`,\n {\n kind: SpanKind.CONSUMER,\n attributes: {\n ...channel?.connection?.[CONNECTION_ATTRIBUTES],\n [SEMATTRS_MESSAGING_DESTINATION]: exchange,\n [SEMATTRS_MESSAGING_DESTINATION_KIND]:\n MESSAGINGDESTINATIONKINDVALUES_TOPIC,\n [SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]: msg.fields?.routingKey,\n [SEMATTRS_MESSAGING_OPERATION]: MESSAGINGOPERATIONVALUES_PROCESS,\n [SEMATTRS_MESSAGING_MESSAGE_ID]: msg?.properties.messageId,\n [SEMATTRS_MESSAGING_CONVERSATION_ID]:\n msg?.properties.correlationId,\n },\n links,\n },\n parentContext\n );\n\n const { consumeHook } = self.getConfig();\n if (consumeHook) {\n safeExecuteInTheMiddle(\n () => consumeHook(span, { moduleVersion, msg }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: consumerHook error', e);\n }\n },\n true\n );\n }\n\n if (!options?.noAck) {\n // store the message on the channel so we can close the span on ackAll etc\n channel[CHANNEL_SPANS_NOT_ENDED]!.push({\n msg,\n timeOfConsume: hrTime(),\n });\n\n // store the span on the message, so we can end it when user call 'ack' on it\n msg[MESSAGE_STORED_SPAN] = span;\n }\n const setContext: Context = parentContext\n ? parentContext\n : ROOT_CONTEXT;\n context.with(trace.setSpan(setContext, span), () => {\n onMessage.call(this, msg);\n });\n\n if (options?.noAck) {\n self.callConsumeEndHook(span, msg, false, EndOperation.AutoAck);\n span.end();\n }\n };\n arguments[1] = patchedOnMessage;\n return original.apply(this, arguments);\n };\n }\n\n private getConfirmedPublishPatch(\n moduleVersion: string | undefined,\n original: Function\n ) {\n const self = this;\n return function confirmedPublish(\n this: InstrumentationConsumeChannel,\n exchange: string,\n routingKey: string,\n content: Buffer,\n options?: Options.Publish,\n callback?: (err: any, ok: Replies.Empty) => void\n ): boolean {\n const channel = this;\n const { span, modifiedOptions } = self.createPublishSpan(\n self,\n exchange,\n routingKey,\n channel,\n options\n );\n\n const { publishHook } = self.getConfig();\n if (publishHook) {\n safeExecuteInTheMiddle(\n () =>\n publishHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options: modifiedOptions,\n isConfirmChannel: true,\n }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: publishHook error', e);\n }\n },\n true\n );\n }\n\n const patchedOnConfirm = function (\n this: unknown,\n err: any,\n ok: Replies.Empty\n ) {\n try {\n callback?.call(this, err, ok);\n } finally {\n const { publishConfirmHook } = self.getConfig();\n if (publishConfirmHook) {\n safeExecuteInTheMiddle(\n () =>\n publishConfirmHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options,\n isConfirmChannel: true,\n confirmError: err,\n }),\n e => {\n if (e) {\n diag.error(\n 'amqplib instrumentation: publishConfirmHook error',\n e\n );\n }\n },\n true\n );\n }\n\n if (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: \"message confirmation has been nack'ed\",\n });\n }\n span.end();\n }\n };\n\n // calling confirm channel publish function is storing the message in queue and registering the callback for broker confirm.\n // span ends in the patched callback.\n const markedContext = markConfirmChannelTracing(context.active());\n const argumentsCopy = [...arguments];\n argumentsCopy[3] = modifiedOptions;\n argumentsCopy[4] = context.bind(\n unmarkConfirmChannelTracing(trace.setSpan(markedContext, span)),\n patchedOnConfirm\n );\n return context.with(markedContext, original.bind(this, ...argumentsCopy));\n };\n }\n\n private getPublishPatch(\n moduleVersion: string | undefined,\n original: Function\n ) {\n const self = this;\n return function publish(\n this: InstrumentationPublishChannel,\n exchange: string,\n routingKey: string,\n content: Buffer,\n options?: Options.Publish\n ): boolean {\n if (isConfirmChannelTracing(context.active())) {\n // work already done\n return original.apply(this, arguments);\n } else {\n const channel = this;\n const { span, modifiedOptions } = self.createPublishSpan(\n self,\n exchange,\n routingKey,\n channel,\n options\n );\n\n const { publishHook } = self.getConfig();\n if (publishHook) {\n safeExecuteInTheMiddle(\n () =>\n publishHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options: modifiedOptions,\n isConfirmChannel: false,\n }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: publishHook error', e);\n }\n },\n true\n );\n }\n\n // calling normal channel publish function is only storing the message in queue.\n // it does not send it and waits for an ack, so the span duration is expected to be very short.\n const argumentsCopy = [...arguments];\n argumentsCopy[3] = modifiedOptions;\n const originalRes = original.apply(this, argumentsCopy as any);\n span.end();\n return originalRes;\n }\n };\n }\n\n private createPublishSpan(\n self: this,\n exchange: string,\n routingKey: string,\n channel: InstrumentationPublishChannel,\n options?: Options.Publish\n ) {\n const normalizedExchange = normalizeExchange(exchange);\n\n const span = self.tracer.startSpan(`publish ${normalizedExchange}`, {\n kind: SpanKind.PRODUCER,\n attributes: {\n ...channel.connection[CONNECTION_ATTRIBUTES],\n [SEMATTRS_MESSAGING_DESTINATION]: exchange,\n [SEMATTRS_MESSAGING_DESTINATION_KIND]:\n MESSAGINGDESTINATIONKINDVALUES_TOPIC,\n [SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey,\n [SEMATTRS_MESSAGING_MESSAGE_ID]: options?.messageId,\n [SEMATTRS_MESSAGING_CONVERSATION_ID]: options?.correlationId,\n },\n });\n const modifiedOptions = options ?? {};\n modifiedOptions.headers = modifiedOptions.headers ?? {};\n\n propagation.inject(\n trace.setSpan(context.active(), span),\n modifiedOptions.headers\n );\n\n return { span, modifiedOptions };\n }\n\n private endConsumerSpan(\n message: InstrumentationMessage,\n isRejected: boolean | null,\n operation: EndOperation,\n requeue: boolean | undefined\n ) {\n const storedSpan: Span | undefined = message[MESSAGE_STORED_SPAN];\n if (!storedSpan) return;\n if (isRejected !== false) {\n storedSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message:\n operation !== EndOperation.ChannelClosed &&\n operation !== EndOperation.ChannelError\n ? `${operation} called on message${\n requeue === true\n ? ' with requeue'\n : requeue === false\n ? ' without requeue'\n : ''\n }`\n : operation,\n });\n }\n this.callConsumeEndHook(storedSpan, message, isRejected, operation);\n storedSpan.end();\n message[MESSAGE_STORED_SPAN] = undefined;\n }\n\n private endAllSpansOnChannel(\n channel: InstrumentationConsumeChannel,\n isRejected: boolean,\n operation: EndOperation,\n requeue: boolean | undefined\n ) {\n const spansNotEnded: { msg: Message }[] =\n channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n spansNotEnded.forEach(msgDetails => {\n this.endConsumerSpan(msgDetails.msg, isRejected, operation, requeue);\n });\n channel[CHANNEL_SPANS_NOT_ENDED] = [];\n }\n\n private callConsumeEndHook(\n span: Span,\n msg: InstrumentationMessage,\n rejected: boolean | null,\n endOperation: EndOperation\n ) {\n const { consumeEndHook } = this.getConfig();\n if (!consumeEndHook) return;\n\n safeExecuteInTheMiddle(\n () => consumeEndHook(span, { msg, rejected, endOperation }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: consumerEndHook error', e);\n }\n },\n true\n );\n }\n\n private checkConsumeTimeoutOnChannel(channel: InstrumentationConsumeChannel) {\n const currentTime = hrTime();\n const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n let i: number;\n const { consumeTimeoutMs } = this.getConfig();\n for (i = 0; i < spansNotEnded.length; i++) {\n const currMessage = spansNotEnded[i];\n const timeFromConsume = hrTimeDuration(\n currMessage.timeOfConsume,\n currentTime\n );\n if (hrTimeToMilliseconds(timeFromConsume) < consumeTimeoutMs!) {\n break;\n }\n this.endConsumerSpan(\n currMessage.msg,\n null,\n EndOperation.InstrumentationTimeout,\n true\n );\n }\n spansNotEnded.splice(0, i);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"amqplib.js","sourceRoot":"","sources":["../../src/amqplib.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAW4B;AAC5B,8CAI6B;AAC7B,oEAMwC;AACxC,uCAAqD;AACrD,8DAQiC;AAQjC,mCAIiB;AACjB,mCAgBiB;AACjB,kBAAkB;AAClB,uCAA0D;AAE1D,MAAM,iBAAiB,GAAG,CAAC,YAAY,CAAC,CAAC;AAEzC,MAAa,sBAAuB,SAAQ,qCAAiD;IAC3F,YAAY,SAAuC,EAAE;QACnD,KAAK,CAAC,sBAAY,EAAE,yBAAe,EAAE,EAAE,GAAG,sBAAc,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;IAEQ,SAAS,CAAC,SAAuC,EAAE;QAC1D,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,sBAAc,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC;IAES,IAAI;QACZ,MAAM,sBAAsB,GAAG,IAAI,+CAA6B,CAC9D,8BAA8B,EAC9B,iBAAiB,EACjB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EACjC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AE,gBAAgB,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACzC,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;YACrC,MAAM,eAAe,GAAG,IAAA,qBAAc,EACpC,WAAW,CAAC,aAAa,EACzB,WAAW,CACZ,CAAC;YACF,IAAI,IAAA,2BAAoB,EAAC,eAAe,CAAC,GAAG,gBAAiB,EAAE;gBAC7D,MAAM;aACP;YACD,IAAI,CAAC,eAAe,CAClB,WAAW,CAAC,GAAG,EACf,IAAI,EACJ,oBAAY,CAAC,sBAAsB,EACnC,IAAI,CACL,CAAC;SACH;QACD,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF;AAvqBD,wDAuqBC","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 context,\n diag,\n propagation,\n trace,\n Span,\n SpanKind,\n SpanStatusCode,\n ROOT_CONTEXT,\n Link,\n Context,\n} from '@opentelemetry/api';\nimport {\n hrTime,\n hrTimeDuration,\n hrTimeToMilliseconds,\n} from '@opentelemetry/core';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n isWrapped,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport { ATTR_MESSAGING_OPERATION } from './semconv';\nimport {\n ATTR_MESSAGING_DESTINATION,\n ATTR_MESSAGING_DESTINATION_KIND,\n ATTR_MESSAGING_RABBITMQ_ROUTING_KEY,\n MESSAGING_DESTINATION_KIND_VALUE_TOPIC,\n MESSAGING_OPERATION_VALUE_PROCESS,\n OLD_ATTR_MESSAGING_MESSAGE_ID,\n ATTR_MESSAGING_CONVERSATION_ID,\n} from '../src/semconv-obsolete';\nimport type {\n Connection,\n ConsumeMessage,\n Message,\n Options,\n Replies,\n} from 'amqplib';\nimport {\n AmqplibInstrumentationConfig,\n DEFAULT_CONFIG,\n EndOperation,\n} from './types';\nimport {\n CHANNEL_CONSUME_TIMEOUT_TIMER,\n CHANNEL_SPANS_NOT_ENDED,\n CONNECTION_ATTRIBUTES,\n getConnectionAttributesFromServer,\n getConnectionAttributesFromUrl,\n InstrumentationConnection,\n InstrumentationConsumeChannel,\n InstrumentationConsumeMessage,\n InstrumentationMessage,\n InstrumentationPublishChannel,\n isConfirmChannelTracing,\n markConfirmChannelTracing,\n MESSAGE_STORED_SPAN,\n normalizeExchange,\n unmarkConfirmChannelTracing,\n} from './utils';\n/** @knipignore */\nimport { PACKAGE_NAME, PACKAGE_VERSION } from './version';\n\nconst supportedVersions = ['>=0.5.5 <1'];\n\nexport class AmqplibInstrumentation extends InstrumentationBase<AmqplibInstrumentationConfig> {\n constructor(config: AmqplibInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, { ...DEFAULT_CONFIG, ...config });\n }\n\n override setConfig(config: AmqplibInstrumentationConfig = {}) {\n super.setConfig({ ...DEFAULT_CONFIG, ...config });\n }\n\n protected init() {\n const channelModelModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/channel_model.js',\n supportedVersions,\n this.patchChannelModel.bind(this),\n this.unpatchChannelModel.bind(this)\n );\n\n const callbackModelModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/callback_model.js',\n supportedVersions,\n this.patchChannelModel.bind(this),\n this.unpatchChannelModel.bind(this)\n );\n\n const connectModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/connect.js',\n supportedVersions,\n this.patchConnect.bind(this),\n this.unpatchConnect.bind(this)\n );\n\n const module = new InstrumentationNodeModuleDefinition(\n 'amqplib',\n supportedVersions,\n undefined,\n undefined,\n [channelModelModuleFile, connectModuleFile, callbackModelModuleFile]\n );\n return module;\n }\n\n private patchConnect(moduleExports: any) {\n moduleExports = this.unpatchConnect(moduleExports);\n if (!isWrapped(moduleExports.connect)) {\n this._wrap(moduleExports, 'connect', this.getConnectPatch.bind(this));\n }\n return moduleExports;\n }\n\n private unpatchConnect(moduleExports: any) {\n if (isWrapped(moduleExports.connect)) {\n this._unwrap(moduleExports, 'connect');\n }\n return moduleExports;\n }\n\n private patchChannelModel(\n moduleExports: any,\n moduleVersion: string | undefined\n ) {\n if (!isWrapped(moduleExports.Channel.prototype.publish)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'publish',\n this.getPublishPatch.bind(this, moduleVersion)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.consume)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'consume',\n this.getConsumePatch.bind(this, moduleVersion)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.ack)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'ack',\n this.getAckPatch.bind(this, false, EndOperation.Ack)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.nack)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'nack',\n this.getAckPatch.bind(this, true, EndOperation.Nack)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.reject)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'reject',\n this.getAckPatch.bind(this, true, EndOperation.Reject)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.ackAll)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'ackAll',\n this.getAckAllPatch.bind(this, false, EndOperation.AckAll)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.nackAll)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'nackAll',\n this.getAckAllPatch.bind(this, true, EndOperation.NackAll)\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.emit)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'emit',\n this.getChannelEmitPatch.bind(this)\n );\n }\n if (!isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {\n this._wrap(\n moduleExports.ConfirmChannel.prototype,\n 'publish',\n this.getConfirmedPublishPatch.bind(this, moduleVersion)\n );\n }\n return moduleExports;\n }\n\n private unpatchChannelModel(moduleExports: any) {\n if (isWrapped(moduleExports.Channel.prototype.publish)) {\n this._unwrap(moduleExports.Channel.prototype, 'publish');\n }\n if (isWrapped(moduleExports.Channel.prototype.consume)) {\n this._unwrap(moduleExports.Channel.prototype, 'consume');\n }\n if (isWrapped(moduleExports.Channel.prototype.ack)) {\n this._unwrap(moduleExports.Channel.prototype, 'ack');\n }\n if (isWrapped(moduleExports.Channel.prototype.nack)) {\n this._unwrap(moduleExports.Channel.prototype, 'nack');\n }\n if (isWrapped(moduleExports.Channel.prototype.reject)) {\n this._unwrap(moduleExports.Channel.prototype, 'reject');\n }\n if (isWrapped(moduleExports.Channel.prototype.ackAll)) {\n this._unwrap(moduleExports.Channel.prototype, 'ackAll');\n }\n if (isWrapped(moduleExports.Channel.prototype.nackAll)) {\n this._unwrap(moduleExports.Channel.prototype, 'nackAll');\n }\n if (isWrapped(moduleExports.Channel.prototype.emit)) {\n this._unwrap(moduleExports.Channel.prototype, 'emit');\n }\n if (isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {\n this._unwrap(moduleExports.ConfirmChannel.prototype, 'publish');\n }\n return moduleExports;\n }\n\n private getConnectPatch(\n original: (\n url: string | Options.Connect,\n socketOptions: any,\n openCallback: (err: any, connection: Connection) => void\n ) => Connection\n ) {\n return function patchedConnect(\n this: unknown,\n url: string | Options.Connect,\n socketOptions: any,\n openCallback: Function\n ) {\n return original.call(\n this,\n url,\n socketOptions,\n function (this: unknown, err, conn: InstrumentationConnection) {\n if (err == null) {\n const urlAttributes = getConnectionAttributesFromUrl(url);\n const serverAttributes = getConnectionAttributesFromServer(conn);\n conn[CONNECTION_ATTRIBUTES] = {\n ...urlAttributes,\n ...serverAttributes,\n };\n }\n openCallback.apply(this, arguments);\n }\n );\n };\n }\n\n private getChannelEmitPatch(original: Function) {\n const self = this;\n return function emit(\n this: InstrumentationConsumeChannel,\n eventName: string\n ) {\n if (eventName === 'close') {\n self.endAllSpansOnChannel(\n this,\n true,\n EndOperation.ChannelClosed,\n undefined\n );\n const activeTimer = this[CHANNEL_CONSUME_TIMEOUT_TIMER];\n if (activeTimer) {\n clearInterval(activeTimer);\n }\n this[CHANNEL_CONSUME_TIMEOUT_TIMER] = undefined;\n } else if (eventName === 'error') {\n self.endAllSpansOnChannel(\n this,\n true,\n EndOperation.ChannelError,\n undefined\n );\n }\n return original.apply(this, arguments);\n };\n }\n\n private getAckAllPatch(\n isRejected: boolean,\n endOperation: EndOperation,\n original: Function\n ) {\n const self = this;\n return function ackAll(\n this: InstrumentationConsumeChannel,\n requeueOrEmpty?: boolean\n ): void {\n self.endAllSpansOnChannel(this, isRejected, endOperation, requeueOrEmpty);\n return original.apply(this, arguments);\n };\n }\n\n private getAckPatch(\n isRejected: boolean,\n endOperation: EndOperation,\n original: Function\n ) {\n const self = this;\n return function ack(\n this: InstrumentationConsumeChannel,\n message: Message,\n allUpToOrRequeue?: boolean,\n requeue?: boolean\n ): void {\n const channel = this;\n // we use this patch in reject function as well, but it has different signature\n const requeueResolved =\n endOperation === EndOperation.Reject ? allUpToOrRequeue : requeue;\n\n const spansNotEnded: { msg: Message }[] =\n channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n const msgIndex = spansNotEnded.findIndex(\n msgDetails => msgDetails.msg === message\n );\n if (msgIndex < 0) {\n // should not happen in happy flow\n // but possible if user is calling the api function ack twice with same message\n self.endConsumerSpan(\n message,\n isRejected,\n endOperation,\n requeueResolved\n );\n } else if (endOperation !== EndOperation.Reject && allUpToOrRequeue) {\n for (let i = 0; i <= msgIndex; i++) {\n self.endConsumerSpan(\n spansNotEnded[i].msg,\n isRejected,\n endOperation,\n requeueResolved\n );\n }\n spansNotEnded.splice(0, msgIndex + 1);\n } else {\n self.endConsumerSpan(\n message,\n isRejected,\n endOperation,\n requeueResolved\n );\n spansNotEnded.splice(msgIndex, 1);\n }\n return original.apply(this, arguments);\n };\n }\n\n private getConsumePatch(\n moduleVersion: string | undefined,\n original: Function\n ) {\n const self = this;\n return function consume(\n this: InstrumentationConsumeChannel,\n queue: string,\n onMessage: (msg: ConsumeMessage | null) => void,\n options?: Options.Consume\n ): Promise<Replies.Consume> {\n const channel = this;\n if (\n !Object.prototype.hasOwnProperty.call(channel, CHANNEL_SPANS_NOT_ENDED)\n ) {\n const { consumeTimeoutMs } = self.getConfig();\n if (consumeTimeoutMs) {\n const timer = setInterval(() => {\n self.checkConsumeTimeoutOnChannel(channel);\n }, consumeTimeoutMs);\n timer.unref();\n channel[CHANNEL_CONSUME_TIMEOUT_TIMER] = timer;\n }\n channel[CHANNEL_SPANS_NOT_ENDED] = [];\n }\n\n const patchedOnMessage = function (\n this: unknown,\n msg: InstrumentationConsumeMessage | null\n ) {\n // msg is expected to be null for signaling consumer cancel notification\n // https://www.rabbitmq.com/consumer-cancel.html\n // in this case, we do not start a span, as this is not a real message.\n if (!msg) {\n return onMessage.call(this, msg);\n }\n\n const headers = msg.properties.headers ?? {};\n let parentContext: Context | undefined = propagation.extract(\n ROOT_CONTEXT,\n headers\n );\n const exchange = msg.fields?.exchange;\n let links: Link[] | undefined;\n if (self._config.useLinksForConsume) {\n const parentSpanContext = parentContext\n ? trace.getSpan(parentContext)?.spanContext()\n : undefined;\n parentContext = undefined;\n if (parentSpanContext) {\n links = [\n {\n context: parentSpanContext,\n },\n ];\n }\n }\n const span = self.tracer.startSpan(\n `${queue} process`,\n {\n kind: SpanKind.CONSUMER,\n attributes: {\n ...channel?.connection?.[CONNECTION_ATTRIBUTES],\n [ATTR_MESSAGING_DESTINATION]: exchange,\n [ATTR_MESSAGING_DESTINATION_KIND]:\n MESSAGING_DESTINATION_KIND_VALUE_TOPIC,\n [ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: msg.fields?.routingKey,\n [ATTR_MESSAGING_OPERATION]: MESSAGING_OPERATION_VALUE_PROCESS,\n [OLD_ATTR_MESSAGING_MESSAGE_ID]: msg?.properties.messageId,\n [ATTR_MESSAGING_CONVERSATION_ID]: msg?.properties.correlationId,\n },\n links,\n },\n parentContext\n );\n\n const { consumeHook } = self.getConfig();\n if (consumeHook) {\n safeExecuteInTheMiddle(\n () => consumeHook(span, { moduleVersion, msg }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: consumerHook error', e);\n }\n },\n true\n );\n }\n\n if (!options?.noAck) {\n // store the message on the channel so we can close the span on ackAll etc\n channel[CHANNEL_SPANS_NOT_ENDED]!.push({\n msg,\n timeOfConsume: hrTime(),\n });\n\n // store the span on the message, so we can end it when user call 'ack' on it\n msg[MESSAGE_STORED_SPAN] = span;\n }\n const setContext: Context = parentContext\n ? parentContext\n : ROOT_CONTEXT;\n context.with(trace.setSpan(setContext, span), () => {\n onMessage.call(this, msg);\n });\n\n if (options?.noAck) {\n self.callConsumeEndHook(span, msg, false, EndOperation.AutoAck);\n span.end();\n }\n };\n arguments[1] = patchedOnMessage;\n return original.apply(this, arguments);\n };\n }\n\n private getConfirmedPublishPatch(\n moduleVersion: string | undefined,\n original: Function\n ) {\n const self = this;\n return function confirmedPublish(\n this: InstrumentationConsumeChannel,\n exchange: string,\n routingKey: string,\n content: Buffer,\n options?: Options.Publish,\n callback?: (err: any, ok: Replies.Empty) => void\n ): boolean {\n const channel = this;\n const { span, modifiedOptions } = self.createPublishSpan(\n self,\n exchange,\n routingKey,\n channel,\n options\n );\n\n const { publishHook } = self.getConfig();\n if (publishHook) {\n safeExecuteInTheMiddle(\n () =>\n publishHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options: modifiedOptions,\n isConfirmChannel: true,\n }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: publishHook error', e);\n }\n },\n true\n );\n }\n\n const patchedOnConfirm = function (\n this: unknown,\n err: any,\n ok: Replies.Empty\n ) {\n try {\n callback?.call(this, err, ok);\n } finally {\n const { publishConfirmHook } = self.getConfig();\n if (publishConfirmHook) {\n safeExecuteInTheMiddle(\n () =>\n publishConfirmHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options,\n isConfirmChannel: true,\n confirmError: err,\n }),\n e => {\n if (e) {\n diag.error(\n 'amqplib instrumentation: publishConfirmHook error',\n e\n );\n }\n },\n true\n );\n }\n\n if (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: \"message confirmation has been nack'ed\",\n });\n }\n span.end();\n }\n };\n\n // calling confirm channel publish function is storing the message in queue and registering the callback for broker confirm.\n // span ends in the patched callback.\n const markedContext = markConfirmChannelTracing(context.active());\n const argumentsCopy = [...arguments];\n argumentsCopy[3] = modifiedOptions;\n argumentsCopy[4] = context.bind(\n unmarkConfirmChannelTracing(trace.setSpan(markedContext, span)),\n patchedOnConfirm\n );\n return context.with(markedContext, original.bind(this, ...argumentsCopy));\n };\n }\n\n private getPublishPatch(\n moduleVersion: string | undefined,\n original: Function\n ) {\n const self = this;\n return function publish(\n this: InstrumentationPublishChannel,\n exchange: string,\n routingKey: string,\n content: Buffer,\n options?: Options.Publish\n ): boolean {\n if (isConfirmChannelTracing(context.active())) {\n // work already done\n return original.apply(this, arguments);\n } else {\n const channel = this;\n const { span, modifiedOptions } = self.createPublishSpan(\n self,\n exchange,\n routingKey,\n channel,\n options\n );\n\n const { publishHook } = self.getConfig();\n if (publishHook) {\n safeExecuteInTheMiddle(\n () =>\n publishHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options: modifiedOptions,\n isConfirmChannel: false,\n }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: publishHook error', e);\n }\n },\n true\n );\n }\n\n // calling normal channel publish function is only storing the message in queue.\n // it does not send it and waits for an ack, so the span duration is expected to be very short.\n const argumentsCopy = [...arguments];\n argumentsCopy[3] = modifiedOptions;\n const originalRes = original.apply(this, argumentsCopy as any);\n span.end();\n return originalRes;\n }\n };\n }\n\n private createPublishSpan(\n self: this,\n exchange: string,\n routingKey: string,\n channel: InstrumentationPublishChannel,\n options?: Options.Publish\n ) {\n const normalizedExchange = normalizeExchange(exchange);\n\n const span = self.tracer.startSpan(`publish ${normalizedExchange}`, {\n kind: SpanKind.PRODUCER,\n attributes: {\n ...channel.connection[CONNECTION_ATTRIBUTES],\n [ATTR_MESSAGING_DESTINATION]: exchange,\n [ATTR_MESSAGING_DESTINATION_KIND]:\n MESSAGING_DESTINATION_KIND_VALUE_TOPIC,\n\n [ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey,\n [OLD_ATTR_MESSAGING_MESSAGE_ID]: options?.messageId,\n [ATTR_MESSAGING_CONVERSATION_ID]: options?.correlationId,\n },\n });\n const modifiedOptions = options ?? {};\n modifiedOptions.headers = modifiedOptions.headers ?? {};\n\n propagation.inject(\n trace.setSpan(context.active(), span),\n modifiedOptions.headers\n );\n\n return { span, modifiedOptions };\n }\n\n private endConsumerSpan(\n message: InstrumentationMessage,\n isRejected: boolean | null,\n operation: EndOperation,\n requeue: boolean | undefined\n ) {\n const storedSpan: Span | undefined = message[MESSAGE_STORED_SPAN];\n if (!storedSpan) return;\n if (isRejected !== false) {\n storedSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message:\n operation !== EndOperation.ChannelClosed &&\n operation !== EndOperation.ChannelError\n ? `${operation} called on message${\n requeue === true\n ? ' with requeue'\n : requeue === false\n ? ' without requeue'\n : ''\n }`\n : operation,\n });\n }\n this.callConsumeEndHook(storedSpan, message, isRejected, operation);\n storedSpan.end();\n message[MESSAGE_STORED_SPAN] = undefined;\n }\n\n private endAllSpansOnChannel(\n channel: InstrumentationConsumeChannel,\n isRejected: boolean,\n operation: EndOperation,\n requeue: boolean | undefined\n ) {\n const spansNotEnded: { msg: Message }[] =\n channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n spansNotEnded.forEach(msgDetails => {\n this.endConsumerSpan(msgDetails.msg, isRejected, operation, requeue);\n });\n channel[CHANNEL_SPANS_NOT_ENDED] = [];\n }\n\n private callConsumeEndHook(\n span: Span,\n msg: InstrumentationMessage,\n rejected: boolean | null,\n endOperation: EndOperation\n ) {\n const { consumeEndHook } = this.getConfig();\n if (!consumeEndHook) return;\n\n safeExecuteInTheMiddle(\n () => consumeEndHook(span, { msg, rejected, endOperation }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: consumerEndHook error', e);\n }\n },\n true\n );\n }\n\n private checkConsumeTimeoutOnChannel(channel: InstrumentationConsumeChannel) {\n const currentTime = hrTime();\n const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n let i: number;\n const { consumeTimeoutMs } = this.getConfig();\n for (i = 0; i < spansNotEnded.length; i++) {\n const currMessage = spansNotEnded[i];\n const timeFromConsume = hrTimeDuration(\n currMessage.timeOfConsume,\n currentTime\n );\n if (hrTimeToMilliseconds(timeFromConsume) < consumeTimeoutMs!) {\n break;\n }\n this.endConsumerSpan(\n currMessage.msg,\n null,\n EndOperation.InstrumentationTimeout,\n true\n );\n }\n spansNotEnded.splice(0, i);\n }\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The message destination name. This might be equal to the span name but is required nevertheless.
|
|
3
|
+
*
|
|
4
|
+
* @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}).
|
|
5
|
+
*/
|
|
6
|
+
export declare const ATTR_MESSAGING_DESTINATION: "messaging.destination";
|
|
7
|
+
/**
|
|
8
|
+
* The kind of message destination.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Removed in semconv v1.20.0.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ATTR_MESSAGING_DESTINATION_KIND: "messaging.destination_kind";
|
|
13
|
+
/**
|
|
14
|
+
* RabbitMQ message routing key.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Use ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
17
|
+
*/
|
|
18
|
+
export declare const ATTR_MESSAGING_RABBITMQ_ROUTING_KEY: "messaging.rabbitmq.routing_key";
|
|
19
|
+
/**
|
|
20
|
+
* A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.
|
|
21
|
+
*
|
|
22
|
+
* @deprecated Use MESSAGING_OPERATION_TYPE_VALUE_PROCESS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
23
|
+
*/
|
|
24
|
+
export declare const MESSAGING_OPERATION_VALUE_PROCESS: "process";
|
|
25
|
+
/**
|
|
26
|
+
* The name of the transport protocol.
|
|
27
|
+
*
|
|
28
|
+
* @deprecated Use ATTR_NETWORK_PROTOCOL_NAME.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ATTR_MESSAGING_PROTOCOL: "messaging.protocol";
|
|
31
|
+
/**
|
|
32
|
+
* The version of the transport protocol.
|
|
33
|
+
*
|
|
34
|
+
* @deprecated Use ATTR_NETWORK_PROTOCOL_VERSION.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ATTR_MESSAGING_PROTOCOL_VERSION: "messaging.protocol_version";
|
|
37
|
+
/**
|
|
38
|
+
* Connection string.
|
|
39
|
+
*
|
|
40
|
+
* @deprecated Removed in semconv v1.17.0.
|
|
41
|
+
*/
|
|
42
|
+
export declare const ATTR_MESSAGING_URL: "messaging.url";
|
|
43
|
+
/**
|
|
44
|
+
* The kind of message destination.
|
|
45
|
+
*
|
|
46
|
+
* @deprecated Removed in semconv v1.20.0.
|
|
47
|
+
*/
|
|
48
|
+
export declare const MESSAGING_DESTINATION_KIND_VALUE_TOPIC: "topic";
|
|
49
|
+
/**
|
|
50
|
+
* A value used by the messaging system as an identifier for the message, represented as a string.
|
|
51
|
+
*
|
|
52
|
+
* @deprecated Use ATTR_MESSAGING_MESSAGE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
53
|
+
*
|
|
54
|
+
* Note: changing to `ATTR_MESSAGING_MESSAGE_ID` means a change in value from `messaging.message_id` to `messaging.message.id`.
|
|
55
|
+
*/
|
|
56
|
+
export declare const OLD_ATTR_MESSAGING_MESSAGE_ID: "messaging.message_id";
|
|
57
|
+
/**
|
|
58
|
+
* The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".
|
|
59
|
+
*
|
|
60
|
+
* @deprecated Use ATTR_MESSAGING_MESSAGE_CONVERSATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
61
|
+
*/
|
|
62
|
+
export declare const ATTR_MESSAGING_CONVERSATION_ID: "messaging.conversation_id";
|
|
63
|
+
//# sourceMappingURL=semconv-obsolete.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
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.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ATTR_MESSAGING_CONVERSATION_ID = exports.OLD_ATTR_MESSAGING_MESSAGE_ID = exports.MESSAGING_DESTINATION_KIND_VALUE_TOPIC = exports.ATTR_MESSAGING_URL = exports.ATTR_MESSAGING_PROTOCOL_VERSION = exports.ATTR_MESSAGING_PROTOCOL = exports.MESSAGING_OPERATION_VALUE_PROCESS = exports.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY = exports.ATTR_MESSAGING_DESTINATION_KIND = exports.ATTR_MESSAGING_DESTINATION = void 0;
|
|
19
|
+
/*
|
|
20
|
+
* This file contains constants for values that where replaced/removed from
|
|
21
|
+
* Semantic Conventions long enough ago that they do not have `ATTR_*`
|
|
22
|
+
* constants in the `@opentelemetry/semantic-conventions` package. Eventually
|
|
23
|
+
* it is expected that this instrumention will be updated to emit telemetry
|
|
24
|
+
* using modern Semantic Conventions, dropping the need for the constants in
|
|
25
|
+
* this file.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The message destination name. This might be equal to the span name but is required nevertheless.
|
|
29
|
+
*
|
|
30
|
+
* @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}).
|
|
31
|
+
*/
|
|
32
|
+
exports.ATTR_MESSAGING_DESTINATION = 'messaging.destination';
|
|
33
|
+
/**
|
|
34
|
+
* The kind of message destination.
|
|
35
|
+
*
|
|
36
|
+
* @deprecated Removed in semconv v1.20.0.
|
|
37
|
+
*/
|
|
38
|
+
exports.ATTR_MESSAGING_DESTINATION_KIND = 'messaging.destination_kind';
|
|
39
|
+
/**
|
|
40
|
+
* RabbitMQ message routing key.
|
|
41
|
+
*
|
|
42
|
+
* @deprecated Use ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
43
|
+
*/
|
|
44
|
+
exports.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY = 'messaging.rabbitmq.routing_key';
|
|
45
|
+
/**
|
|
46
|
+
* A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.
|
|
47
|
+
*
|
|
48
|
+
* @deprecated Use MESSAGING_OPERATION_TYPE_VALUE_PROCESS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
49
|
+
*/
|
|
50
|
+
exports.MESSAGING_OPERATION_VALUE_PROCESS = 'process';
|
|
51
|
+
/**
|
|
52
|
+
* The name of the transport protocol.
|
|
53
|
+
*
|
|
54
|
+
* @deprecated Use ATTR_NETWORK_PROTOCOL_NAME.
|
|
55
|
+
*/
|
|
56
|
+
exports.ATTR_MESSAGING_PROTOCOL = 'messaging.protocol';
|
|
57
|
+
/**
|
|
58
|
+
* The version of the transport protocol.
|
|
59
|
+
*
|
|
60
|
+
* @deprecated Use ATTR_NETWORK_PROTOCOL_VERSION.
|
|
61
|
+
*/
|
|
62
|
+
exports.ATTR_MESSAGING_PROTOCOL_VERSION = 'messaging.protocol_version';
|
|
63
|
+
/**
|
|
64
|
+
* Connection string.
|
|
65
|
+
*
|
|
66
|
+
* @deprecated Removed in semconv v1.17.0.
|
|
67
|
+
*/
|
|
68
|
+
exports.ATTR_MESSAGING_URL = 'messaging.url';
|
|
69
|
+
/**
|
|
70
|
+
* The kind of message destination.
|
|
71
|
+
*
|
|
72
|
+
* @deprecated Removed in semconv v1.20.0.
|
|
73
|
+
*/
|
|
74
|
+
exports.MESSAGING_DESTINATION_KIND_VALUE_TOPIC = 'topic';
|
|
75
|
+
/**
|
|
76
|
+
* A value used by the messaging system as an identifier for the message, represented as a string.
|
|
77
|
+
*
|
|
78
|
+
* @deprecated Use ATTR_MESSAGING_MESSAGE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
79
|
+
*
|
|
80
|
+
* Note: changing to `ATTR_MESSAGING_MESSAGE_ID` means a change in value from `messaging.message_id` to `messaging.message.id`.
|
|
81
|
+
*/
|
|
82
|
+
exports.OLD_ATTR_MESSAGING_MESSAGE_ID = 'messaging.message_id';
|
|
83
|
+
/**
|
|
84
|
+
* The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".
|
|
85
|
+
*
|
|
86
|
+
* @deprecated Use ATTR_MESSAGING_MESSAGE_CONVERSATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
87
|
+
*/
|
|
88
|
+
exports.ATTR_MESSAGING_CONVERSATION_ID = 'messaging.conversation_id';
|
|
89
|
+
//# sourceMappingURL=semconv-obsolete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv-obsolete.js","sourceRoot":"","sources":["../../src/semconv-obsolete.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;;;;GAOG;AAEH;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,uBAAgC,CAAC;AAE3E;;;;GAIG;AACU,QAAA,+BAA+B,GAC1C,4BAAqC,CAAC;AAExC;;;;GAIG;AACU,QAAA,mCAAmC,GAC9C,gCAAyC,CAAC;AAE5C;;;;GAIG;AACU,QAAA,iCAAiC,GAAG,SAAkB,CAAC;AAEpE;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,oBAA6B,CAAC;AAErE;;;;GAIG;AACU,QAAA,+BAA+B,GAC1C,4BAAqC,CAAC;AAExC;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;GAIG;AACU,QAAA,sCAAsC,GAAG,OAAgB,CAAC;AAEvE;;;;;;GAMG;AACU,QAAA,6BAA6B,GAAG,sBAA+B,CAAC;AAE7E;;;;GAIG;AACU,QAAA,8BAA8B,GACzC,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 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 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 * RabbitMQ message routing key.\n *\n * @deprecated Use ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY 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_RABBITMQ_ROUTING_KEY =\n 'messaging.rabbitmq.routing_key' 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 "send", 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_PROCESS 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_PROCESS = 'process' as const;\n\n/**\n * The name of the transport protocol.\n *\n * @deprecated Use ATTR_NETWORK_PROTOCOL_NAME.\n */\nexport const ATTR_MESSAGING_PROTOCOL = 'messaging.protocol' as const;\n\n/**\n * The version of the transport protocol.\n *\n * @deprecated Use ATTR_NETWORK_PROTOCOL_VERSION.\n */\nexport const ATTR_MESSAGING_PROTOCOL_VERSION =\n 'messaging.protocol_version' as const;\n\n/**\n * Connection string.\n *\n * @deprecated Removed in semconv v1.17.0.\n */\nexport const ATTR_MESSAGING_URL = 'messaging.url' 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 value used by the messaging system as an identifier for the message, represented as a string.\n *\n * @deprecated Use ATTR_MESSAGING_MESSAGE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n *\n * Note: changing to `ATTR_MESSAGING_MESSAGE_ID` means a change in value from `messaging.message_id` to `messaging.message.id`.\n */\nexport const OLD_ATTR_MESSAGING_MESSAGE_ID = 'messaging.message_id' as const;\n\n/**\n * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".\n *\n * @deprecated Use ATTR_MESSAGING_MESSAGE_CONVERSATION_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_MESSAGING_CONVERSATION_ID =\n 'messaging.conversation_id' as const;\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deprecated, use `messaging.operation.type` instead.
|
|
3
|
+
*
|
|
4
|
+
* @example publish
|
|
5
|
+
* @example create
|
|
6
|
+
* @example process
|
|
7
|
+
*
|
|
8
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Replaced by `messaging.operation.type`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ATTR_MESSAGING_OPERATION: "messaging.operation";
|
|
13
|
+
/**
|
|
14
|
+
* The messaging system as identified by the client instrumentation.
|
|
15
|
+
*
|
|
16
|
+
* @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.
|
|
17
|
+
*
|
|
18
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ATTR_MESSAGING_SYSTEM: "messaging.system";
|
|
21
|
+
/**
|
|
22
|
+
* Deprecated, use `server.address` on client spans and `client.address` on server spans.
|
|
23
|
+
*
|
|
24
|
+
* @example example.com
|
|
25
|
+
*
|
|
26
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
27
|
+
*
|
|
28
|
+
* @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ATTR_NET_PEER_NAME: "net.peer.name";
|
|
31
|
+
/**
|
|
32
|
+
* Deprecated, use `server.port` on client spans and `client.port` on server spans.
|
|
33
|
+
*
|
|
34
|
+
* @example 8080
|
|
35
|
+
*
|
|
36
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ATTR_NET_PEER_PORT: "net.peer.port";
|
|
41
|
+
//# sourceMappingURL=semconv.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
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.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ATTR_NET_PEER_PORT = exports.ATTR_NET_PEER_NAME = exports.ATTR_MESSAGING_SYSTEM = exports.ATTR_MESSAGING_OPERATION = void 0;
|
|
19
|
+
/*
|
|
20
|
+
* This file contains a copy of unstable semantic convention definitions
|
|
21
|
+
* used by this package.
|
|
22
|
+
* @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Deprecated, use `messaging.operation.type` instead.
|
|
26
|
+
*
|
|
27
|
+
* @example publish
|
|
28
|
+
* @example create
|
|
29
|
+
* @example process
|
|
30
|
+
*
|
|
31
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Replaced by `messaging.operation.type`.
|
|
34
|
+
*/
|
|
35
|
+
exports.ATTR_MESSAGING_OPERATION = 'messaging.operation';
|
|
36
|
+
/**
|
|
37
|
+
* The messaging system as identified by the client instrumentation.
|
|
38
|
+
*
|
|
39
|
+
* @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.
|
|
40
|
+
*
|
|
41
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
42
|
+
*/
|
|
43
|
+
exports.ATTR_MESSAGING_SYSTEM = 'messaging.system';
|
|
44
|
+
/**
|
|
45
|
+
* Deprecated, use `server.address` on client spans and `client.address` on server spans.
|
|
46
|
+
*
|
|
47
|
+
* @example example.com
|
|
48
|
+
*
|
|
49
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
50
|
+
*
|
|
51
|
+
* @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.
|
|
52
|
+
*/
|
|
53
|
+
exports.ATTR_NET_PEER_NAME = 'net.peer.name';
|
|
54
|
+
/**
|
|
55
|
+
* Deprecated, use `server.port` on client spans and `client.port` on server spans.
|
|
56
|
+
*
|
|
57
|
+
* @example 8080
|
|
58
|
+
*
|
|
59
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
60
|
+
*
|
|
61
|
+
* @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.
|
|
62
|
+
*/
|
|
63
|
+
exports.ATTR_NET_PEER_PORT = 'net.peer.port';
|
|
64
|
+
//# sourceMappingURL=semconv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH;;;;;;;;;;GAUG;AACU,QAAA,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,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 * 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 * 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 * Deprecated, use `server.address` on client spans and `client.address` on server spans.\n *\n * @example example.com\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 `server.address` on client spans and `client.address` on server spans.\n */\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\n\n/**\n * Deprecated, use `server.port` on client spans and `client.port` on server spans.\n *\n * @example 8080\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 `server.port` on client spans and `client.port` on server spans.\n */\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\n"]}
|
package/build/src/utils.js
CHANGED
|
@@ -17,7 +17,8 @@ exports.isConfirmChannelTracing = exports.unmarkConfirmChannelTracing = exports.
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
const api_1 = require("@opentelemetry/api");
|
|
20
|
-
const
|
|
20
|
+
const semconv_1 = require("./semconv");
|
|
21
|
+
const semconv_obsolete_1 = require("../src/semconv-obsolete");
|
|
21
22
|
exports.MESSAGE_STORED_SPAN = Symbol('opentelemetry.amqplib.message.stored-span');
|
|
22
23
|
exports.CHANNEL_SPANS_NOT_ENDED = Symbol('opentelemetry.amqplib.channel.spans-not-ended');
|
|
23
24
|
exports.CHANNEL_CONSUME_TIMEOUT_TIMER = Symbol('opentelemetry.amqplib.channel.consumer-timeout-timer');
|
|
@@ -62,7 +63,7 @@ const getConnectionAttributesFromServer = (conn) => {
|
|
|
62
63
|
const product = conn.serverProperties.product?.toLowerCase?.();
|
|
63
64
|
if (product) {
|
|
64
65
|
return {
|
|
65
|
-
[
|
|
66
|
+
[semconv_1.ATTR_MESSAGING_SYSTEM]: product,
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
else {
|
|
@@ -72,40 +73,40 @@ const getConnectionAttributesFromServer = (conn) => {
|
|
|
72
73
|
exports.getConnectionAttributesFromServer = getConnectionAttributesFromServer;
|
|
73
74
|
const getConnectionAttributesFromUrl = (url) => {
|
|
74
75
|
const attributes = {
|
|
75
|
-
[
|
|
76
|
+
[semconv_obsolete_1.ATTR_MESSAGING_PROTOCOL_VERSION]: '0.9.1', // this is the only protocol supported by the instrumented library
|
|
76
77
|
};
|
|
77
78
|
url = url || 'amqp://localhost';
|
|
78
79
|
if (typeof url === 'object') {
|
|
79
80
|
const connectOptions = url;
|
|
80
81
|
const protocol = getProtocol(connectOptions?.protocol);
|
|
81
82
|
Object.assign(attributes, {
|
|
82
|
-
...extractConnectionAttributeOrLog(url,
|
|
83
|
+
...extractConnectionAttributeOrLog(url, semconv_obsolete_1.ATTR_MESSAGING_PROTOCOL, protocol, 'protocol'),
|
|
83
84
|
});
|
|
84
85
|
const hostname = getHostname(connectOptions?.hostname);
|
|
85
86
|
Object.assign(attributes, {
|
|
86
|
-
...extractConnectionAttributeOrLog(url,
|
|
87
|
+
...extractConnectionAttributeOrLog(url, semconv_1.ATTR_NET_PEER_NAME, hostname, 'hostname'),
|
|
87
88
|
});
|
|
88
89
|
const port = getPort(connectOptions.port, protocol);
|
|
89
90
|
Object.assign(attributes, {
|
|
90
|
-
...extractConnectionAttributeOrLog(url,
|
|
91
|
+
...extractConnectionAttributeOrLog(url, semconv_1.ATTR_NET_PEER_PORT, port, 'port'),
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
else {
|
|
94
95
|
const censoredUrl = censorPassword(url);
|
|
95
|
-
attributes[
|
|
96
|
+
attributes[semconv_obsolete_1.ATTR_MESSAGING_URL] = censoredUrl;
|
|
96
97
|
try {
|
|
97
98
|
const urlParts = new URL(censoredUrl);
|
|
98
99
|
const protocol = getProtocol(urlParts.protocol);
|
|
99
100
|
Object.assign(attributes, {
|
|
100
|
-
...extractConnectionAttributeOrLog(censoredUrl,
|
|
101
|
+
...extractConnectionAttributeOrLog(censoredUrl, semconv_obsolete_1.ATTR_MESSAGING_PROTOCOL, protocol, 'protocol'),
|
|
101
102
|
});
|
|
102
103
|
const hostname = getHostname(urlParts.hostname);
|
|
103
104
|
Object.assign(attributes, {
|
|
104
|
-
...extractConnectionAttributeOrLog(censoredUrl,
|
|
105
|
+
...extractConnectionAttributeOrLog(censoredUrl, semconv_1.ATTR_NET_PEER_NAME, hostname, 'hostname'),
|
|
105
106
|
});
|
|
106
107
|
const port = getPort(urlParts.port ? parseInt(urlParts.port) : undefined, protocol);
|
|
107
108
|
Object.assign(attributes, {
|
|
108
|
-
...extractConnectionAttributeOrLog(censoredUrl,
|
|
109
|
+
...extractConnectionAttributeOrLog(censoredUrl, semconv_1.ATTR_NET_PEER_PORT, port, 'port'),
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
112
|
catch (err) {
|
package/build/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAQ4B;AAC5B,8EAO6C;AAGhC,QAAA,mBAAmB,GAAkB,MAAM,CACtD,2CAA2C,CAC5C,CAAC;AACW,QAAA,uBAAuB,GAAkB,MAAM,CAC1D,+CAA+C,CAChD,CAAC;AACW,QAAA,6BAA6B,GAAkB,MAAM,CAChE,sDAAsD,CACvD,CAAC;AACW,QAAA,qBAAqB,GAAkB,MAAM,CACxD,6CAA6C,CAC9C,CAAC;AAwBF,MAAM,8BAA8B,GAAW,IAAA,sBAAgB,EAC7D,kDAAkD,CACnD,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAAC,YAAoB,EAAE,EAAE,CACxD,YAAY,KAAK,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;AADtC,QAAA,iBAAiB,qBACqB;AAEnD,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE;IAC7C,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CACd,WAA+B,EAC/B,gBAAwB,EAChB,EAAE;IACV,yDAAyD;IACzD,qFAAqF;IACrF,OAAO,WAAW,IAAI,CAAC,gBAAgB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,eAAmC,EAAU,EAAE;IAClE,MAAM,gBAAgB,GAAG,eAAe,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,+BAA+B,CAChC,WAAW,EACX,6CAAsB,EACtB,QAAQ,EACR,UAAU,CACX;aACF,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,OAAO,CAClB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EACnD,QAAQ,CACT,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;gBACxB,GAAG,+BAA+B,CAChC,WAAW,EACX,6CAAsB,EACtB,IAAI,EACJ,MAAM,CACP;aACF,CAAC,CAAC;SACJ;QAAC,OAAO,GAAG,EAAE;YACZ,UAAI,CAAC,KAAK,CACR,wFAAwF,EACxF;gBACE,WAAW;gBACX,GAAG;aACJ,CACF,CAAC;SACH;KACF;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAzFW,QAAA,8BAA8B,kCAyFzC;AAEK,MAAM,yBAAyB,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC5D,OAAO,OAAO,CAAC,QAAQ,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC;AAEK,MAAM,2BAA2B,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC9D,OAAO,OAAO,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,2BAA2B,+BAEtC;AAEK,MAAM,uBAAuB,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC1D,OAAO,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,KAAK,IAAI,CAAC;AACnE,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC","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 Context,\n createContextKey,\n diag,\n HrTime,\n Span,\n Attributes,\n AttributeValue,\n} from '@opentelemetry/api';\nimport {\n SEMATTRS_MESSAGING_PROTOCOL,\n SEMATTRS_MESSAGING_PROTOCOL_VERSION,\n SEMATTRS_MESSAGING_SYSTEM,\n SEMATTRS_MESSAGING_URL,\n SEMATTRS_NET_PEER_NAME,\n SEMATTRS_NET_PEER_PORT,\n} from '@opentelemetry/semantic-conventions';\nimport type * as amqp from 'amqplib';\n\nexport const MESSAGE_STORED_SPAN: unique symbol = Symbol(\n 'opentelemetry.amqplib.message.stored-span'\n);\nexport const CHANNEL_SPANS_NOT_ENDED: unique symbol = Symbol(\n 'opentelemetry.amqplib.channel.spans-not-ended'\n);\nexport const CHANNEL_CONSUME_TIMEOUT_TIMER: unique symbol = Symbol(\n 'opentelemetry.amqplib.channel.consumer-timeout-timer'\n);\nexport const CONNECTION_ATTRIBUTES: unique symbol = Symbol(\n 'opentelemetry.amqplib.connection.attributes'\n);\n\nexport type InstrumentationConnection = amqp.Connection & {\n [CONNECTION_ATTRIBUTES]?: Attributes;\n};\nexport type InstrumentationPublishChannel = (\n | amqp.Channel\n | amqp.ConfirmChannel\n) & { connection: InstrumentationConnection };\nexport type InstrumentationConsumeChannel = amqp.Channel & {\n connection: InstrumentationConnection;\n [CHANNEL_SPANS_NOT_ENDED]?: {\n msg: amqp.ConsumeMessage;\n timeOfConsume: HrTime;\n }[];\n [CHANNEL_CONSUME_TIMEOUT_TIMER]?: NodeJS.Timeout;\n};\nexport type InstrumentationMessage = amqp.Message & {\n [MESSAGE_STORED_SPAN]?: Span;\n};\nexport type InstrumentationConsumeMessage = amqp.ConsumeMessage & {\n [MESSAGE_STORED_SPAN]?: Span;\n};\n\nconst IS_CONFIRM_CHANNEL_CONTEXT_KEY: symbol = createContextKey(\n 'opentelemetry.amqplib.channel.is-confirm-channel'\n);\n\nexport const normalizeExchange = (exchangeName: string) =>\n exchangeName !== '' ? exchangeName : '<default>';\n\nconst censorPassword = (url: string): string => {\n return url.replace(/:[^:@/]*@/, ':***@');\n};\n\nconst getPort = (\n portFromUrl: number | undefined,\n resolvedProtocol: string\n): number => {\n // we are using the resolved protocol which is upper case\n // this code mimic the behavior of the amqplib which is used to set connection params\n return portFromUrl || (resolvedProtocol === 'AMQP' ? 5672 : 5671);\n};\n\nconst getProtocol = (protocolFromUrl: string | undefined): string => {\n const resolvedProtocol = protocolFromUrl || 'amqp';\n // the substring removed the ':' part of the protocol ('amqp:' -> 'amqp')\n const noEndingColon = resolvedProtocol.endsWith(':')\n ? resolvedProtocol.substring(0, resolvedProtocol.length - 1)\n : resolvedProtocol;\n // upper cases to match spec\n return noEndingColon.toUpperCase();\n};\n\nconst getHostname = (hostnameFromUrl: string | undefined): string => {\n // if user supplies empty hostname, it gets forwarded to 'net' package which default it to localhost.\n // https://nodejs.org/docs/latest-v12.x/api/net.html#net_socket_connect_options_connectlistener\n return hostnameFromUrl || 'localhost';\n};\n\nconst extractConnectionAttributeOrLog = (\n url: string | amqp.Options.Connect,\n attributeKey: string,\n attributeValue: AttributeValue,\n nameForLog: string\n): Attributes => {\n if (attributeValue) {\n return { [attributeKey]: attributeValue };\n } else {\n diag.error(\n `amqplib instrumentation: could not extract connection attribute ${nameForLog} from user supplied url`,\n {\n url,\n }\n );\n return {};\n }\n};\n\nexport const getConnectionAttributesFromServer = (\n conn: amqp.Connection\n): Attributes => {\n const product = conn.serverProperties.product?.toLowerCase?.();\n if (product) {\n return {\n [SEMATTRS_MESSAGING_SYSTEM]: product,\n };\n } else {\n return {};\n }\n};\n\nexport const getConnectionAttributesFromUrl = (\n url: string | amqp.Options.Connect\n): Attributes => {\n const attributes: Attributes = {\n [SEMATTRS_MESSAGING_PROTOCOL_VERSION]: '0.9.1', // this is the only protocol supported by the instrumented library\n };\n\n url = url || 'amqp://localhost';\n if (typeof url === 'object') {\n const connectOptions = url as amqp.Options.Connect;\n\n const protocol = getProtocol(connectOptions?.protocol);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n url,\n SEMATTRS_MESSAGING_PROTOCOL,\n protocol,\n 'protocol'\n ),\n });\n\n const hostname = getHostname(connectOptions?.hostname);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n url,\n SEMATTRS_NET_PEER_NAME,\n hostname,\n 'hostname'\n ),\n });\n\n const port = getPort(connectOptions.port, protocol);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n url,\n SEMATTRS_NET_PEER_PORT,\n port,\n 'port'\n ),\n });\n } else {\n const censoredUrl = censorPassword(url);\n attributes[SEMATTRS_MESSAGING_URL] = censoredUrl;\n try {\n const urlParts = new URL(censoredUrl);\n\n const protocol = getProtocol(urlParts.protocol);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n censoredUrl,\n SEMATTRS_MESSAGING_PROTOCOL,\n protocol,\n 'protocol'\n ),\n });\n\n const hostname = getHostname(urlParts.hostname);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n censoredUrl,\n SEMATTRS_NET_PEER_NAME,\n hostname,\n 'hostname'\n ),\n });\n\n const port = getPort(\n urlParts.port ? parseInt(urlParts.port) : undefined,\n protocol\n );\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n censoredUrl,\n SEMATTRS_NET_PEER_PORT,\n port,\n 'port'\n ),\n });\n } catch (err) {\n diag.error(\n 'amqplib instrumentation: error while extracting connection details from connection url',\n {\n censoredUrl,\n err,\n }\n );\n }\n }\n return attributes;\n};\n\nexport const markConfirmChannelTracing = (context: Context) => {\n return context.setValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY, true);\n};\n\nexport const unmarkConfirmChannelTracing = (context: Context) => {\n return context.deleteValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY);\n};\n\nexport const isConfirmChannelTracing = (context: Context) => {\n return context.getValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY) === true;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAQ4B;AAC5B,uCAImB;AACnB,8DAIiC;AAGpB,QAAA,mBAAmB,GAAkB,MAAM,CACtD,2CAA2C,CAC5C,CAAC;AACW,QAAA,uBAAuB,GAAkB,MAAM,CAC1D,+CAA+C,CAChD,CAAC;AACW,QAAA,6BAA6B,GAAkB,MAAM,CAChE,sDAAsD,CACvD,CAAC;AACW,QAAA,qBAAqB,GAAkB,MAAM,CACxD,6CAA6C,CAC9C,CAAC;AAwBF,MAAM,8BAA8B,GAAW,IAAA,sBAAgB,EAC7D,kDAAkD,CACnD,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAAC,YAAoB,EAAE,EAAE,CACxD,YAAY,KAAK,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;AADtC,QAAA,iBAAiB,qBACqB;AAEnD,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE;IAC7C,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CACd,WAA+B,EAC/B,gBAAwB,EAChB,EAAE;IACV,yDAAyD;IACzD,qFAAqF;IACrF,OAAO,WAAW,IAAI,CAAC,gBAAgB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,eAAmC,EAAU,EAAE;IAClE,MAAM,gBAAgB,GAAG,eAAe,IAAI,MAAM,CAAC;IACnD,yEAAyE;IACzE,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC;QAClD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I,GAAG,OAAO,CAClB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EACnD,QAAQ,CACT,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;gBACxB,GAAG,+BAA+B,CAChC,WAAW,EACX,4BAAkB,EAClB,IAAI,EACJ,MAAM,CACP;aACF,CAAC,CAAC;SACJ;QAAC,OAAO,GAAG,EAAE;YACZ,UAAI,CAAC,KAAK,CACR,wFAAwF,EACxF;gBACE,WAAW;gBACX,GAAG;aACJ,CACF,CAAC;SACH;KACF;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AApFW,QAAA,8BAA8B,kCAoFzC;AAEK,MAAM,yBAAyB,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC5D,OAAO,OAAO,CAAC,QAAQ,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC;AAEK,MAAM,2BAA2B,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC9D,OAAO,OAAO,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,2BAA2B,+BAEtC;AAEK,MAAM,uBAAuB,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC1D,OAAO,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,KAAK,IAAI,CAAC;AACnE,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC","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 Context,\n createContextKey,\n diag,\n HrTime,\n Span,\n Attributes,\n AttributeValue,\n} from '@opentelemetry/api';\nimport {\n ATTR_MESSAGING_SYSTEM,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n} from './semconv';\nimport {\n ATTR_MESSAGING_PROTOCOL,\n ATTR_MESSAGING_PROTOCOL_VERSION,\n ATTR_MESSAGING_URL,\n} from '../src/semconv-obsolete';\nimport type * as amqp from 'amqplib';\n\nexport const MESSAGE_STORED_SPAN: unique symbol = Symbol(\n 'opentelemetry.amqplib.message.stored-span'\n);\nexport const CHANNEL_SPANS_NOT_ENDED: unique symbol = Symbol(\n 'opentelemetry.amqplib.channel.spans-not-ended'\n);\nexport const CHANNEL_CONSUME_TIMEOUT_TIMER: unique symbol = Symbol(\n 'opentelemetry.amqplib.channel.consumer-timeout-timer'\n);\nexport const CONNECTION_ATTRIBUTES: unique symbol = Symbol(\n 'opentelemetry.amqplib.connection.attributes'\n);\n\nexport type InstrumentationConnection = amqp.Connection & {\n [CONNECTION_ATTRIBUTES]?: Attributes;\n};\nexport type InstrumentationPublishChannel = (\n | amqp.Channel\n | amqp.ConfirmChannel\n) & { connection: InstrumentationConnection };\nexport type InstrumentationConsumeChannel = amqp.Channel & {\n connection: InstrumentationConnection;\n [CHANNEL_SPANS_NOT_ENDED]?: {\n msg: amqp.ConsumeMessage;\n timeOfConsume: HrTime;\n }[];\n [CHANNEL_CONSUME_TIMEOUT_TIMER]?: NodeJS.Timeout;\n};\nexport type InstrumentationMessage = amqp.Message & {\n [MESSAGE_STORED_SPAN]?: Span;\n};\nexport type InstrumentationConsumeMessage = amqp.ConsumeMessage & {\n [MESSAGE_STORED_SPAN]?: Span;\n};\n\nconst IS_CONFIRM_CHANNEL_CONTEXT_KEY: symbol = createContextKey(\n 'opentelemetry.amqplib.channel.is-confirm-channel'\n);\n\nexport const normalizeExchange = (exchangeName: string) =>\n exchangeName !== '' ? exchangeName : '<default>';\n\nconst censorPassword = (url: string): string => {\n return url.replace(/:[^:@/]*@/, ':***@');\n};\n\nconst getPort = (\n portFromUrl: number | undefined,\n resolvedProtocol: string\n): number => {\n // we are using the resolved protocol which is upper case\n // this code mimic the behavior of the amqplib which is used to set connection params\n return portFromUrl || (resolvedProtocol === 'AMQP' ? 5672 : 5671);\n};\n\nconst getProtocol = (protocolFromUrl: string | undefined): string => {\n const resolvedProtocol = protocolFromUrl || 'amqp';\n // the substring removed the ':' part of the protocol ('amqp:' -> 'amqp')\n const noEndingColon = resolvedProtocol.endsWith(':')\n ? resolvedProtocol.substring(0, resolvedProtocol.length - 1)\n : resolvedProtocol;\n // upper cases to match spec\n return noEndingColon.toUpperCase();\n};\n\nconst getHostname = (hostnameFromUrl: string | undefined): string => {\n // if user supplies empty hostname, it gets forwarded to 'net' package which default it to localhost.\n // https://nodejs.org/docs/latest-v12.x/api/net.html#net_socket_connect_options_connectlistener\n return hostnameFromUrl || 'localhost';\n};\n\nconst extractConnectionAttributeOrLog = (\n url: string | amqp.Options.Connect,\n attributeKey: string,\n attributeValue: AttributeValue,\n nameForLog: string\n): Attributes => {\n if (attributeValue) {\n return { [attributeKey]: attributeValue };\n } else {\n diag.error(\n `amqplib instrumentation: could not extract connection attribute ${nameForLog} from user supplied url`,\n {\n url,\n }\n );\n return {};\n }\n};\n\nexport const getConnectionAttributesFromServer = (\n conn: amqp.Connection\n): Attributes => {\n const product = conn.serverProperties.product?.toLowerCase?.();\n if (product) {\n return {\n [ATTR_MESSAGING_SYSTEM]: product,\n };\n } else {\n return {};\n }\n};\n\nexport const getConnectionAttributesFromUrl = (\n url: string | amqp.Options.Connect\n): Attributes => {\n const attributes: Attributes = {\n [ATTR_MESSAGING_PROTOCOL_VERSION]: '0.9.1', // this is the only protocol supported by the instrumented library\n };\n\n url = url || 'amqp://localhost';\n if (typeof url === 'object') {\n const connectOptions = url as amqp.Options.Connect;\n\n const protocol = getProtocol(connectOptions?.protocol);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n url,\n ATTR_MESSAGING_PROTOCOL,\n protocol,\n 'protocol'\n ),\n });\n\n const hostname = getHostname(connectOptions?.hostname);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n url,\n ATTR_NET_PEER_NAME,\n hostname,\n 'hostname'\n ),\n });\n\n const port = getPort(connectOptions.port, protocol);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(url, ATTR_NET_PEER_PORT, port, 'port'),\n });\n } else {\n const censoredUrl = censorPassword(url);\n attributes[ATTR_MESSAGING_URL] = censoredUrl;\n try {\n const urlParts = new URL(censoredUrl);\n\n const protocol = getProtocol(urlParts.protocol);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n censoredUrl,\n ATTR_MESSAGING_PROTOCOL,\n protocol,\n 'protocol'\n ),\n });\n\n const hostname = getHostname(urlParts.hostname);\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n censoredUrl,\n ATTR_NET_PEER_NAME,\n hostname,\n 'hostname'\n ),\n });\n\n const port = getPort(\n urlParts.port ? parseInt(urlParts.port) : undefined,\n protocol\n );\n Object.assign(attributes, {\n ...extractConnectionAttributeOrLog(\n censoredUrl,\n ATTR_NET_PEER_PORT,\n port,\n 'port'\n ),\n });\n } catch (err) {\n diag.error(\n 'amqplib instrumentation: error while extracting connection details from connection url',\n {\n censoredUrl,\n err,\n }\n );\n }\n }\n return attributes;\n};\n\nexport const markConfirmChannelTracing = (context: Context) => {\n return context.setValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY, true);\n};\n\nexport const unmarkConfirmChannelTracing = (context: Context) => {\n return context.deleteValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY);\n};\n\nexport const isConfirmChannelTracing = (context: Context) => {\n return context.getValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY) === true;\n};\n"]}
|
package/build/src/version.d.ts
CHANGED
package/build/src/version.js
CHANGED
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0;
|
|
19
19
|
// this is autogenerated file, see scripts/version-update.js
|
|
20
|
-
exports.PACKAGE_VERSION = '0.52.
|
|
20
|
+
exports.PACKAGE_VERSION = '0.52.3';
|
|
21
21
|
exports.PACKAGE_NAME = '@opentelemetry/instrumentation-amqplib';
|
|
22
22
|
//# sourceMappingURL=version.js.map
|
package/build/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,YAAY,GAAG,wCAAwC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.52.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,YAAY,GAAG,wCAAwC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.52.3';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-amqplib';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/instrumentation-amqplib",
|
|
3
|
-
"version": "0.52.
|
|
3
|
+
"version": "0.52.3",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for the `amqplib` messaging client for RabbitMQ",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"amqplib",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test",
|
|
43
43
|
"test-all-versions": "tav",
|
|
44
44
|
"test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions",
|
|
45
|
-
"test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json",
|
|
46
45
|
"test-services:start": "cd ../.. && npm run test-services:start rabbitmq",
|
|
47
46
|
"test-services:stop": "cd ../.. && npm run test-services:stop rabbitmq",
|
|
48
47
|
"version:update": "node ../../scripts/version-update.js",
|
|
@@ -53,12 +52,11 @@
|
|
|
53
52
|
},
|
|
54
53
|
"dependencies": {
|
|
55
54
|
"@opentelemetry/core": "^2.0.0",
|
|
56
|
-
"@opentelemetry/instrumentation": "^0.205.0"
|
|
57
|
-
"@opentelemetry/semantic-conventions": "^1.27.0"
|
|
55
|
+
"@opentelemetry/instrumentation": "^0.205.0"
|
|
58
56
|
},
|
|
59
57
|
"devDependencies": {
|
|
60
58
|
"@opentelemetry/api": "^1.3.0",
|
|
61
|
-
"@opentelemetry/contrib-test-utils": "^0.
|
|
59
|
+
"@opentelemetry/contrib-test-utils": "^0.52.2",
|
|
62
60
|
"@types/amqplib": "^0.10.7",
|
|
63
61
|
"@types/lodash": "4.14.199",
|
|
64
62
|
"@types/mocha": "10.0.10",
|
|
@@ -76,5 +74,5 @@
|
|
|
76
74
|
"engines": {
|
|
77
75
|
"node": "^18.19.0 || >=20.6.0"
|
|
78
76
|
},
|
|
79
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "5a5918fd4f9f16b14c9ef4d3de08ab98c20e5b46"
|
|
80
78
|
}
|