@opentelemetry/instrumentation-ioredis 0.62.0 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.IORedisInstrumentation = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,qDAA2D;AAAlD,yHAAA,sBAAsB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { IORedisInstrumentation } from './instrumentation';\nexport type {\n CommandArgs,\n DbStatementSerializer,\n IORedisInstrumentationConfig,\n IORedisRequestHookInformation,\n RedisRequestCustomAttributeFunction,\n RedisResponseCustomAttributeFunction,\n} from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAA2D;AAAlD,yHAAA,sBAAsB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { IORedisInstrumentation } from './instrumentation';\nexport type {\n CommandArgs,\n DbStatementSerializer,\n IORedisInstrumentationConfig,\n IORedisRequestHookInformation,\n RedisRequestCustomAttributeFunction,\n RedisResponseCustomAttributeFunction,\n} from './types';\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.IORedisInstrumentation = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAM4B;AAC5B,oEAMwC;AAGxC,8EAK6C;AAC7C,uCAQmB;AACnB,oEAAwE;AACxE,mCAAkC;AAClC,8DAA2E;AAC3E,kBAAkB;AAClB,uCAA0D;AAE1D,MAAM,cAAc,GAAiC;IACnD,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEF,MAAa,sBAAuB,SAAQ,qCAAiD;IACnF,oBAAoB,CAAoB;IACxC,mBAAmB,CAAoB;IAE/C,YAAY,SAAuC,EAAE;QACnD,KAAK,CAAC,sBAAY,EAAE,yBAAe,EAAE,EAAE,GAAG,cAAc,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G,IAAI,CAAC;gBACtC,UAAU,CAAC,4BAAkB,CAAC,GAAG,IAAI,CAAC;aACvC;YACD,IAAI,eAAe,CAAC,oBAAoB,GAAG,kCAAgB,CAAC,MAAM,EAAE;gBAClE,UAAU,CAAC,0CAAmB,CAAC,GAAG,IAAI,CAAC;gBACvC,UAAU,CAAC,uCAAgB,CAAC,GAAG,IAAI,CAAC;aACrC;YACD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE;gBACvD,IAAI,EAAE,cAAQ,CAAC,MAAM;gBACrB,UAAU;aACX,CAAC,CAAC;YAEH,IAAI;gBACF,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;gBAC/C,IAAA,eAAO,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACpB,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,KAAU,EAAE;gBACnB,IAAA,eAAO,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACrB,MAAM,KAAK,CAAC;aACb;QACH,CAAC,CAAC;IACJ,CAAC;CACF;AA1ND,wDA0NC","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\nimport {\n diag,\n trace,\n context,\n SpanKind,\n type Attributes,\n} from '@opentelemetry/api';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport { IORedisInstrumentationConfig } from './types';\nimport { IORedisCommand, RedisInterface } from './internal-types';\nimport {\n ATTR_DB_QUERY_TEXT,\n ATTR_DB_SYSTEM_NAME,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n} from '@opentelemetry/semantic-conventions';\nimport {\n DB_SYSTEM_VALUE_REDIS,\n DB_SYSTEM_NAME_VALUE_REDIS,\n ATTR_DB_CONNECTION_STRING,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n} from './semconv';\nimport { safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';\nimport { endSpan } from './utils';\nimport { defaultDbStatementSerializer } from '@opentelemetry/redis-common';\n/** @knipignore */\nimport { PACKAGE_NAME, PACKAGE_VERSION } from './version';\n\nconst DEFAULT_CONFIG: IORedisInstrumentationConfig = {\n requireParentSpan: true,\n};\n\nexport class IORedisInstrumentation extends InstrumentationBase<IORedisInstrumentationConfig> {\n private _netSemconvStability!: SemconvStability;\n private _dbSemconvStability!: SemconvStability;\n\n constructor(config: IORedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, { ...DEFAULT_CONFIG, ...config });\n this._setSemconvStabilityFromEnv();\n }\n\n // Used for testing.\n private _setSemconvStabilityFromEnv() {\n this._netSemconvStability = semconvStabilityFromStr(\n 'http',\n process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n );\n this._dbSemconvStability = semconvStabilityFromStr(\n 'database',\n process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n );\n }\n\n override setConfig(config: IORedisInstrumentationConfig = {}) {\n super.setConfig({ ...DEFAULT_CONFIG, ...config });\n }\n\n init(): InstrumentationNodeModuleDefinition[] {\n return [\n new InstrumentationNodeModuleDefinition(\n 'ioredis',\n ['>=2.0.0 <6'],\n (module, moduleVersion?: string) => {\n const moduleExports =\n module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n if (isWrapped(moduleExports.prototype.sendCommand)) {\n this._unwrap(moduleExports.prototype, 'sendCommand');\n }\n this._wrap(\n moduleExports.prototype,\n 'sendCommand',\n this._patchSendCommand(moduleVersion)\n );\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n this._wrap(\n moduleExports.prototype,\n 'connect',\n this._patchConnection()\n );\n return module;\n },\n module => {\n if (module === undefined) return;\n const moduleExports =\n module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n this._unwrap(moduleExports.prototype, 'sendCommand');\n this._unwrap(moduleExports.prototype, 'connect');\n }\n ),\n ];\n }\n\n /**\n * Patch send command internal to trace requests\n */\n private _patchSendCommand(moduleVersion?: string) {\n return (original: Function) => {\n return this._traceSendCommand(original, moduleVersion);\n };\n }\n\n private _patchConnection() {\n return (original: Function) => {\n return this._traceConnection(original);\n };\n }\n\n private _traceSendCommand(original: Function, moduleVersion?: string) {\n const instrumentation = this;\n return function (this: RedisInterface, cmd?: IORedisCommand) {\n if (arguments.length < 1 || typeof cmd !== 'object') {\n return original.apply(this, arguments);\n }\n const config = instrumentation.getConfig();\n const dbStatementSerializer =\n config.dbStatementSerializer || defaultDbStatementSerializer;\n\n const hasNoParentSpan = trace.getSpan(context.active()) === undefined;\n if (config.requireParentSpan === true && hasNoParentSpan) {\n return original.apply(this, arguments);\n }\n\n const attributes: Attributes = {};\n const { host, port } = this.options;\n const dbQueryText = dbStatementSerializer(cmd.name, cmd.args);\n if (instrumentation._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_REDIS;\n attributes[ATTR_DB_STATEMENT] = dbQueryText;\n attributes[ATTR_DB_CONNECTION_STRING] = `redis://${host}:${port}`;\n }\n if (instrumentation._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_REDIS;\n attributes[ATTR_DB_QUERY_TEXT] = dbQueryText;\n }\n if (instrumentation._netSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_NET_PEER_NAME] = host;\n attributes[ATTR_NET_PEER_PORT] = port;\n }\n if (instrumentation._netSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_SERVER_ADDRESS] = host;\n attributes[ATTR_SERVER_PORT] = port;\n }\n const span = instrumentation.tracer.startSpan(cmd.name, {\n kind: SpanKind.CLIENT,\n attributes,\n });\n\n const { requestHook } = config;\n if (requestHook) {\n safeExecuteInTheMiddle(\n () =>\n requestHook(span, {\n moduleVersion,\n cmdName: cmd.name,\n cmdArgs: cmd.args,\n }),\n e => {\n if (e) {\n diag.error('ioredis instrumentation: request hook failed', e);\n }\n },\n true\n );\n }\n\n try {\n const result = original.apply(this, arguments);\n\n const origResolve = cmd.resolve;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n cmd.resolve = function (result: any) {\n safeExecuteInTheMiddle(\n () => config.responseHook?.(span, cmd.name, cmd.args, result),\n e => {\n if (e) {\n diag.error('ioredis instrumentation: response hook failed', e);\n }\n },\n true\n );\n\n endSpan(span, null);\n origResolve(result);\n };\n\n const origReject = cmd.reject;\n cmd.reject = function (err: Error) {\n endSpan(span, err);\n origReject(err);\n };\n\n return result;\n } catch (error: any) {\n endSpan(span, error);\n throw error;\n }\n };\n }\n\n private _traceConnection(original: Function) {\n const instrumentation = this;\n return function (this: RedisInterface) {\n const hasNoParentSpan = trace.getSpan(context.active()) === undefined;\n if (\n instrumentation.getConfig().requireParentSpan === true &&\n hasNoParentSpan\n ) {\n return original.apply(this, arguments);\n }\n\n const attributes: Attributes = {};\n const { host, port } = this.options;\n if (instrumentation._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_REDIS;\n attributes[ATTR_DB_STATEMENT] = 'connect';\n attributes[ATTR_DB_CONNECTION_STRING] = `redis://${host}:${port}`;\n }\n if (instrumentation._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_REDIS;\n attributes[ATTR_DB_QUERY_TEXT] = 'connect';\n }\n if (instrumentation._netSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_NET_PEER_NAME] = host;\n attributes[ATTR_NET_PEER_PORT] = port;\n }\n if (instrumentation._netSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_SERVER_ADDRESS] = host;\n attributes[ATTR_SERVER_PORT] = port;\n }\n const span = instrumentation.tracer.startSpan('connect', {\n kind: SpanKind.CLIENT,\n attributes,\n });\n\n try {\n const client = original.apply(this, arguments);\n endSpan(span, null);\n return client;\n } catch (error: any) {\n endSpan(span, error);\n throw error;\n }\n };\n }\n}\n"]}
1
+ {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAM4B;AAC5B,oEAMwC;AAGxC,8EAK6C;AAC7C,uCAQmB;AACnB,oEAAwE;AACxE,mCAAkC;AAClC,8DAA2E;AAC3E,kBAAkB;AAClB,uCAA0D;AAE1D,MAAM,cAAc,GAAiC;IACnD,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEF,MAAa,sBAAuB,SAAQ,qCAAiD;IACnF,oBAAoB,CAAoB;IACxC,mBAAmB,CAAoB;IAE/C,YAAY,SAAuC,EAAE;QACnD,KAAK,CAAC,sBAAY,EAAE,yBAAe,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;QACvE,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACrC,CAAC;IAED,oBAAoB;IACZ,2BAA2B;QACjC,IAAI,CAAC,oBAAoB,GAAG,IAAA,yCAAuB,EACjD,MAAM,EACN,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAC1C,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,IAAA,yCAAuB,EAChD,UAAU,EACV,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAC1C,CAAC;IACJ,CAAC;IAEQ,SAAS,CAA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,UAAU;aACX,CAAC,CAAC;YAEH,IAAI;gBACF,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;gBAC/C,IAAA,eAAO,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACpB,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,KAAU,EAAE;gBACnB,IAAA,eAAO,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACrB,MAAM,KAAK,CAAC;aACb;QACH,CAAC,CAAC;IACJ,CAAC;CACF;AA1ND,wDA0NC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n diag,\n trace,\n context,\n SpanKind,\n type Attributes,\n} from '@opentelemetry/api';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport { IORedisInstrumentationConfig } from './types';\nimport { IORedisCommand, RedisInterface } from './internal-types';\nimport {\n ATTR_DB_QUERY_TEXT,\n ATTR_DB_SYSTEM_NAME,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n} from '@opentelemetry/semantic-conventions';\nimport {\n DB_SYSTEM_VALUE_REDIS,\n DB_SYSTEM_NAME_VALUE_REDIS,\n ATTR_DB_CONNECTION_STRING,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n} from './semconv';\nimport { safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';\nimport { endSpan } from './utils';\nimport { defaultDbStatementSerializer } from '@opentelemetry/redis-common';\n/** @knipignore */\nimport { PACKAGE_NAME, PACKAGE_VERSION } from './version';\n\nconst DEFAULT_CONFIG: IORedisInstrumentationConfig = {\n requireParentSpan: true,\n};\n\nexport class IORedisInstrumentation extends InstrumentationBase<IORedisInstrumentationConfig> {\n private _netSemconvStability!: SemconvStability;\n private _dbSemconvStability!: SemconvStability;\n\n constructor(config: IORedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, { ...DEFAULT_CONFIG, ...config });\n this._setSemconvStabilityFromEnv();\n }\n\n // Used for testing.\n private _setSemconvStabilityFromEnv() {\n this._netSemconvStability = semconvStabilityFromStr(\n 'http',\n process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n );\n this._dbSemconvStability = semconvStabilityFromStr(\n 'database',\n process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n );\n }\n\n override setConfig(config: IORedisInstrumentationConfig = {}) {\n super.setConfig({ ...DEFAULT_CONFIG, ...config });\n }\n\n init(): InstrumentationNodeModuleDefinition[] {\n return [\n new InstrumentationNodeModuleDefinition(\n 'ioredis',\n ['>=2.0.0 <6'],\n (module, moduleVersion?: string) => {\n const moduleExports =\n module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n if (isWrapped(moduleExports.prototype.sendCommand)) {\n this._unwrap(moduleExports.prototype, 'sendCommand');\n }\n this._wrap(\n moduleExports.prototype,\n 'sendCommand',\n this._patchSendCommand(moduleVersion)\n );\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n this._wrap(\n moduleExports.prototype,\n 'connect',\n this._patchConnection()\n );\n return module;\n },\n module => {\n if (module === undefined) return;\n const moduleExports =\n module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n this._unwrap(moduleExports.prototype, 'sendCommand');\n this._unwrap(moduleExports.prototype, 'connect');\n }\n ),\n ];\n }\n\n /**\n * Patch send command internal to trace requests\n */\n private _patchSendCommand(moduleVersion?: string) {\n return (original: Function) => {\n return this._traceSendCommand(original, moduleVersion);\n };\n }\n\n private _patchConnection() {\n return (original: Function) => {\n return this._traceConnection(original);\n };\n }\n\n private _traceSendCommand(original: Function, moduleVersion?: string) {\n const instrumentation = this;\n return function (this: RedisInterface, cmd?: IORedisCommand) {\n if (arguments.length < 1 || typeof cmd !== 'object') {\n return original.apply(this, arguments);\n }\n const config = instrumentation.getConfig();\n const dbStatementSerializer =\n config.dbStatementSerializer || defaultDbStatementSerializer;\n\n const hasNoParentSpan = trace.getSpan(context.active()) === undefined;\n if (config.requireParentSpan === true && hasNoParentSpan) {\n return original.apply(this, arguments);\n }\n\n const attributes: Attributes = {};\n const { host, port } = this.options;\n const dbQueryText = dbStatementSerializer(cmd.name, cmd.args);\n if (instrumentation._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_REDIS;\n attributes[ATTR_DB_STATEMENT] = dbQueryText;\n attributes[ATTR_DB_CONNECTION_STRING] = `redis://${host}:${port}`;\n }\n if (instrumentation._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_REDIS;\n attributes[ATTR_DB_QUERY_TEXT] = dbQueryText;\n }\n if (instrumentation._netSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_NET_PEER_NAME] = host;\n attributes[ATTR_NET_PEER_PORT] = port;\n }\n if (instrumentation._netSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_SERVER_ADDRESS] = host;\n attributes[ATTR_SERVER_PORT] = port;\n }\n const span = instrumentation.tracer.startSpan(cmd.name, {\n kind: SpanKind.CLIENT,\n attributes,\n });\n\n const { requestHook } = config;\n if (requestHook) {\n safeExecuteInTheMiddle(\n () =>\n requestHook(span, {\n moduleVersion,\n cmdName: cmd.name,\n cmdArgs: cmd.args,\n }),\n e => {\n if (e) {\n diag.error('ioredis instrumentation: request hook failed', e);\n }\n },\n true\n );\n }\n\n try {\n const result = original.apply(this, arguments);\n\n const origResolve = cmd.resolve;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n cmd.resolve = function (result: any) {\n safeExecuteInTheMiddle(\n () => config.responseHook?.(span, cmd.name, cmd.args, result),\n e => {\n if (e) {\n diag.error('ioredis instrumentation: response hook failed', e);\n }\n },\n true\n );\n\n endSpan(span, null);\n origResolve(result);\n };\n\n const origReject = cmd.reject;\n cmd.reject = function (err: Error) {\n endSpan(span, err);\n origReject(err);\n };\n\n return result;\n } catch (error: any) {\n endSpan(span, error);\n throw error;\n }\n };\n }\n\n private _traceConnection(original: Function) {\n const instrumentation = this;\n return function (this: RedisInterface) {\n const hasNoParentSpan = trace.getSpan(context.active()) === undefined;\n if (\n instrumentation.getConfig().requireParentSpan === true &&\n hasNoParentSpan\n ) {\n return original.apply(this, arguments);\n }\n\n const attributes: Attributes = {};\n const { host, port } = this.options;\n if (instrumentation._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_REDIS;\n attributes[ATTR_DB_STATEMENT] = 'connect';\n attributes[ATTR_DB_CONNECTION_STRING] = `redis://${host}:${port}`;\n }\n if (instrumentation._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_REDIS;\n attributes[ATTR_DB_QUERY_TEXT] = 'connect';\n }\n if (instrumentation._netSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_NET_PEER_NAME] = host;\n attributes[ATTR_NET_PEER_PORT] = port;\n }\n if (instrumentation._netSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_SERVER_ADDRESS] = host;\n attributes[ATTR_SERVER_PORT] = port;\n }\n const span = instrumentation.tracer.startSpan('connect', {\n kind: SpanKind.CLIENT,\n attributes,\n });\n\n try {\n const client = original.apply(this, arguments);\n endSpan(span, null);\n return client;\n } catch (error: any) {\n endSpan(span, error);\n throw error;\n }\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal-types.js","sourceRoot":"","sources":["../../src/internal-types.ts"],"names":[],"mappings":"","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 type { Command, Redis } from 'ioredis';\nimport type * as LegacyIORedis from 'ioredis4';\n\ninterface LegacyIORedisCommand {\n reject: (err: Error) => void;\n resolve: (result: {}) => void;\n promise: Promise<{}>;\n args: Array<string | Buffer | number>;\n callback: LegacyIORedis.CallbackFunction<unknown>;\n name: string;\n}\n\nexport type IORedisCommand = Command | LegacyIORedisCommand;\nexport type RedisInterface = Redis | LegacyIORedis.Redis;\n"]}
1
+ {"version":3,"file":"internal-types.js","sourceRoot":"","sources":["../../src/internal-types.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { Command, Redis } from 'ioredis';\nimport type * as LegacyIORedis from 'ioredis4';\n\ninterface LegacyIORedisCommand {\n reject: (err: Error) => void;\n resolve: (result: {}) => void;\n promise: Promise<{}>;\n args: Array<string | Buffer | number>;\n callback: LegacyIORedis.CallbackFunction<unknown>;\n name: string;\n}\n\nexport type IORedisCommand = Command | LegacyIORedisCommand;\nexport type RedisInterface = Redis | LegacyIORedis.Redis;\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.DB_SYSTEM_VALUE_REDIS = exports.DB_SYSTEM_NAME_VALUE_REDIS = exports.ATTR_NET_PEER_PORT = exports.ATTR_NET_PEER_NAME = exports.ATTR_DB_SYSTEM = exports.ATTR_DB_STATEMENT = exports.ATTR_DB_CONNECTION_STRING = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH;;;;;;;;GAQG;AACU,QAAA,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,OAAgB,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG,OAAgB,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 `server.address`, `server.port` attributes instead.\n *\n * @example \"Server=(localdb)\\\\v11.0;Integrated Security=true;\"\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` and `server.port`.\n */\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\n\n/**\n * The database statement being executed.\n *\n * @example SELECT * FROM wuser_table\n * @example SET mykey \"WuValue\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * 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\n/**\n * Enum value \"redis\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [Redis](https://redis.io/)\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_NAME_VALUE_REDIS = 'redis' as const;\n\n/**\n * Enum value \"redis\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * Redis\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_VALUE_REDIS = 'redis' as const;\n"]}
1
+ {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH;;;;;;;;GAQG;AACU,QAAA,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,OAAgB,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG,OAAgB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Deprecated, use `server.address`, `server.port` attributes instead.\n *\n * @example \"Server=(localdb)\\\\v11.0;Integrated Security=true;\"\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` and `server.port`.\n */\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\n\n/**\n * The database statement being executed.\n *\n * @example SELECT * FROM wuser_table\n * @example SET mykey \"WuValue\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * 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\n/**\n * Enum value \"redis\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [Redis](https://redis.io/)\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_NAME_VALUE_REDIS = 'redis' as const;\n\n/**\n * Enum value \"redis\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * Redis\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_VALUE_REDIS = 'redis' as const;\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { Span } from '@opentelemetry/api';\n\nexport type CommandArgs = Array<string | Buffer | number | any[]>;\n\n/**\n * Function that can be used to serialize db.statement tag\n * @param cmdName - The name of the command (eg. set, get, mset)\n * @param cmdArgs - Array of arguments passed to the command\n *\n * @returns serialized string that will be used as the db.statement attribute.\n */\nexport type DbStatementSerializer = (\n cmdName: string,\n cmdArgs: CommandArgs\n) => string;\n\nexport interface IORedisRequestHookInformation {\n moduleVersion?: string;\n cmdName: string;\n cmdArgs: CommandArgs;\n}\n\nexport interface RedisRequestCustomAttributeFunction {\n (span: Span, requestInfo: IORedisRequestHookInformation): void;\n}\n\n/**\n * Function that can be used to add custom attributes to span on response from redis server\n * @param span - The span created for the redis command, on which attributes can be set\n * @param cmdName - The name of the command (eg. set, get, mset)\n * @param cmdArgs - Array of arguments passed to the command\n * @param response - The response object which is returned to the user who called this command.\n * Can be used to set custom attributes on the span.\n * The type of the response varies depending on the specific command.\n */\nexport interface RedisResponseCustomAttributeFunction {\n (span: Span, cmdName: string, cmdArgs: CommandArgs, response: unknown): void;\n}\n\n/**\n * Options available for the IORedis Instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/packages/instrumentation-ioredis/README.md#ioredis-instrumentation-options))\n */\nexport interface IORedisInstrumentationConfig extends InstrumentationConfig {\n /** Custom serializer function for the db.statement tag */\n dbStatementSerializer?: DbStatementSerializer;\n\n /** Function for adding custom attributes on db request */\n requestHook?: RedisRequestCustomAttributeFunction;\n\n /** Function for adding custom attributes on db response */\n responseHook?: RedisResponseCustomAttributeFunction;\n\n /** Require parent to create ioredis span, default when unset is true */\n requireParentSpan?: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { Span } from '@opentelemetry/api';\n\nexport type CommandArgs = Array<string | Buffer | number | any[]>;\n\n/**\n * Function that can be used to serialize db.statement tag\n * @param cmdName - The name of the command (eg. set, get, mset)\n * @param cmdArgs - Array of arguments passed to the command\n *\n * @returns serialized string that will be used as the db.statement attribute.\n */\nexport type DbStatementSerializer = (\n cmdName: string,\n cmdArgs: CommandArgs\n) => string;\n\nexport interface IORedisRequestHookInformation {\n moduleVersion?: string;\n cmdName: string;\n cmdArgs: CommandArgs;\n}\n\nexport interface RedisRequestCustomAttributeFunction {\n (span: Span, requestInfo: IORedisRequestHookInformation): void;\n}\n\n/**\n * Function that can be used to add custom attributes to span on response from redis server\n * @param span - The span created for the redis command, on which attributes can be set\n * @param cmdName - The name of the command (eg. set, get, mset)\n * @param cmdArgs - Array of arguments passed to the command\n * @param response - The response object which is returned to the user who called this command.\n * Can be used to set custom attributes on the span.\n * The type of the response varies depending on the specific command.\n */\nexport interface RedisResponseCustomAttributeFunction {\n (span: Span, cmdName: string, cmdArgs: CommandArgs, response: unknown): void;\n}\n\n/**\n * Options available for the IORedis Instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/packages/instrumentation-ioredis/README.md#ioredis-instrumentation-options))\n */\nexport interface IORedisInstrumentationConfig extends InstrumentationConfig {\n /** Custom serializer function for the db.statement tag */\n dbStatementSerializer?: DbStatementSerializer;\n\n /** Function for adding custom attributes on db request */\n requestHook?: RedisRequestCustomAttributeFunction;\n\n /** Function for adding custom attributes on db response */\n responseHook?: RedisResponseCustomAttributeFunction;\n\n /** Require parent to create ioredis span, default when unset is true */\n requireParentSpan?: boolean;\n}\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.endSpan = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0D;AAEnD,MAAM,OAAO,GAAG,CACrB,IAAU,EACV,GAA6C,EAC7C,EAAE;IACF,IAAI,GAAG,EAAE;QACP,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,oBAAc,CAAC,KAAK;YAC1B,OAAO,EAAE,GAAG,CAAC,OAAO;SACrB,CAAC,CAAC;KACJ;IACD,IAAI,CAAC,GAAG,EAAE,CAAC;AACb,CAAC,CAAC;AAZW,QAAA,OAAO,WAYlB","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\nimport { Span, SpanStatusCode } from '@opentelemetry/api';\n\nexport const endSpan = (\n span: Span,\n err: NodeJS.ErrnoException | null | undefined\n) => {\n if (err) {\n span.recordException(err);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n }\n span.end();\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAA0D;AAEnD,MAAM,OAAO,GAAG,CACrB,IAAU,EACV,GAA6C,EAC7C,EAAE;IACF,IAAI,GAAG,EAAE;QACP,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,SAAS,CAAC;YACb,IAAI,EAAE,oBAAc,CAAC,KAAK;YAC1B,OAAO,EAAE,GAAG,CAAC,OAAO;SACrB,CAAC,CAAC;KACJ;IACD,IAAI,CAAC,GAAG,EAAE,CAAC;AACb,CAAC,CAAC;AAZW,QAAA,OAAO,WAYlB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Span, SpanStatusCode } from '@opentelemetry/api';\n\nexport const endSpan = (\n span: Span,\n err: NodeJS.ErrnoException | null | undefined\n) => {\n if (err) {\n span.recordException(err);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n }\n span.end();\n};\n"]}
@@ -1,3 +1,3 @@
1
- export declare const PACKAGE_VERSION = "0.62.0";
1
+ export declare const PACKAGE_VERSION = "0.63.0";
2
2
  export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-ioredis";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1,22 +1,11 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0;
19
8
  // this is autogenerated file, see scripts/version-update.js
20
- exports.PACKAGE_VERSION = '0.62.0';
9
+ exports.PACKAGE_VERSION = '0.63.0';
21
10
  exports.PACKAGE_NAME = '@opentelemetry/instrumentation-ioredis';
22
11
  //# sourceMappingURL=version.js.map
@@ -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.62.0';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-ioredis';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,YAAY,GAAG,wCAAwC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.63.0';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-ioredis';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/instrumentation-ioredis",
3
- "version": "0.62.0",
3
+ "version": "0.63.0",
4
4
  "description": "OpenTelemetry instrumentation for `ioredis` database redis client for Redis",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -54,17 +54,17 @@
54
54
  "devDependencies": {
55
55
  "@opentelemetry/api": "^1.3.0",
56
56
  "@opentelemetry/context-async-hooks": "^2.0.0",
57
- "@opentelemetry/contrib-test-utils": "^0.61.0",
57
+ "@opentelemetry/contrib-test-utils": "^0.62.0",
58
58
  "@opentelemetry/sdk-trace-base": "^2.0.0",
59
59
  "@opentelemetry/sdk-trace-node": "^2.0.0",
60
60
  "@types/ioredis4": "npm:@types/ioredis@4.28.10",
61
61
  "ioredis": "5.8.2"
62
62
  },
63
63
  "dependencies": {
64
- "@opentelemetry/instrumentation": "^0.214.0",
65
- "@opentelemetry/redis-common": "^0.38.2",
64
+ "@opentelemetry/instrumentation": "^0.215.0",
65
+ "@opentelemetry/redis-common": "^0.38.3",
66
66
  "@opentelemetry/semantic-conventions": "^1.33.0"
67
67
  },
68
68
  "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-ioredis#readme",
69
- "gitHead": "ed97091c9890dd18e52759f2ea98e9d7593b3ae4"
69
+ "gitHead": "bd017c86bcdf369d7bc1b490e455f95b25385779"
70
70
  }