@opentelemetry/instrumentation-ioredis 0.53.0 → 0.53.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.
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.IORedisInstrumentation = void 0;
19
19
  const api_1 = require("@opentelemetry/api");
20
20
  const instrumentation_1 = require("@opentelemetry/instrumentation");
21
- const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
21
+ const semconv_1 = require("./semconv");
22
22
  const instrumentation_2 = require("@opentelemetry/instrumentation");
23
23
  const utils_1 = require("./utils");
24
24
  const redis_common_1 = require("@opentelemetry/redis-common");
@@ -88,8 +88,8 @@ class IORedisInstrumentation extends instrumentation_1.InstrumentationBase {
88
88
  const span = instrumentation.tracer.startSpan(cmd.name, {
89
89
  kind: api_1.SpanKind.CLIENT,
90
90
  attributes: {
91
- [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS,
92
- [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args),
91
+ [semconv_1.ATTR_DB_SYSTEM]: semconv_1.DB_SYSTEM_VALUE_REDIS,
92
+ [semconv_1.ATTR_DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args),
93
93
  },
94
94
  });
95
95
  const { requestHook } = config;
@@ -106,9 +106,9 @@ class IORedisInstrumentation extends instrumentation_1.InstrumentationBase {
106
106
  }
107
107
  const { host, port } = this.options;
108
108
  span.setAttributes({
109
- [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host,
110
- [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: port,
111
- [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: `redis://${host}:${port}`,
109
+ [semconv_1.ATTR_NET_PEER_NAME]: host,
110
+ [semconv_1.ATTR_NET_PEER_PORT]: port,
111
+ [semconv_1.ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`,
112
112
  });
113
113
  try {
114
114
  const result = original.apply(this, arguments);
@@ -147,15 +147,15 @@ class IORedisInstrumentation extends instrumentation_1.InstrumentationBase {
147
147
  const span = instrumentation.tracer.startSpan('connect', {
148
148
  kind: api_1.SpanKind.CLIENT,
149
149
  attributes: {
150
- [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS,
151
- [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: 'connect',
150
+ [semconv_1.ATTR_DB_SYSTEM]: semconv_1.DB_SYSTEM_VALUE_REDIS,
151
+ [semconv_1.ATTR_DB_STATEMENT]: 'connect',
152
152
  },
153
153
  });
154
154
  const { host, port } = this.options;
155
155
  span.setAttributes({
156
- [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host,
157
- [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: port,
158
- [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: `redis://${host}:${port}`,
156
+ [semconv_1.ATTR_NET_PEER_NAME]: host,
157
+ [semconv_1.ATTR_NET_PEER_PORT]: port,
158
+ [semconv_1.ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`,
159
159
  });
160
160
  try {
161
161
  const client = original.apply(this, arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAAoE;AACpE,oEAIwC;AAGxC,8EAO6C;AAC7C,oEAAwE;AACxE,mCAAkC;AAClC,8DAA2E;AAC3E,kBAAkB;AAClB,uCAA0D;AAE1D,MAAM,cAAc,GAAiC;IACnD,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEF,MAAa,sBAAuB,SAAQ,qCAAiD;IAC3F,YAAY,SAAuC,EAAE;QACnD,KAAK,CAAC,sBAAY,EAAE,yBAAe,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG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AAG,IAAI,CAAC,OAAO,CAAC;YAEpC,IAAI,CAAC,aAAa,CAAC;gBACjB,CAAC,6CAAsB,CAAC,EAAE,IAAI;gBAC9B,CAAC,6CAAsB,CAAC,EAAE,IAAI;gBAC9B,CAAC,oDAA6B,CAAC,EAAE,WAAW,IAAI,IAAI,IAAI,EAAE;aAC3D,CAAC,CAAC;YACH,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;AAvLD,wDAuLC","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 { diag, trace, context, SpanKind } from '@opentelemetry/api';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n} from '@opentelemetry/instrumentation';\nimport { IORedisInstrumentationConfig } from './types';\nimport { IORedisCommand, RedisInterface } from './internal-types';\nimport {\n DBSYSTEMVALUES_REDIS,\n SEMATTRS_DB_CONNECTION_STRING,\n SEMATTRS_DB_STATEMENT,\n SEMATTRS_DB_SYSTEM,\n SEMATTRS_NET_PEER_NAME,\n SEMATTRS_NET_PEER_PORT,\n} from '@opentelemetry/semantic-conventions';\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 constructor(config: IORedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, { ...DEFAULT_CONFIG, ...config });\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 span = instrumentation.tracer.startSpan(cmd.name, {\n kind: SpanKind.CLIENT,\n attributes: {\n [SEMATTRS_DB_SYSTEM]: DBSYSTEMVALUES_REDIS,\n [SEMATTRS_DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args),\n },\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 const { host, port } = this.options;\n\n span.setAttributes({\n [SEMATTRS_NET_PEER_NAME]: host,\n [SEMATTRS_NET_PEER_PORT]: port,\n [SEMATTRS_DB_CONNECTION_STRING]: `redis://${host}:${port}`,\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 span = instrumentation.tracer.startSpan('connect', {\n kind: SpanKind.CLIENT,\n attributes: {\n [SEMATTRS_DB_SYSTEM]: DBSYSTEMVALUES_REDIS,\n [SEMATTRS_DB_STATEMENT]: 'connect',\n },\n });\n const { host, port } = this.options;\n\n span.setAttributes({\n [SEMATTRS_NET_PEER_NAME]: host,\n [SEMATTRS_NET_PEER_PORT]: port,\n [SEMATTRS_DB_CONNECTION_STRING]: `redis://${host}:${port}`,\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;;;;;;;;;;;;;;GAcG;;;AAEH,4CAAoE;AACpE,oEAIwC;AAGxC,uCAOmB;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;IAC3F,YAAY,SAAuC,EAAE;QACnD,KAAK,CAAC,sBAAY,EAAE,yBAAe,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;IAEQ,SAAS,CAAC,SAAuC,EAAE;QAC1D,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,IAAI;QACF,OAAO;YACL,IAAI,qDAAmC,CACrC,SAAS,EACT,CAAC,YAAY,CAAC,EACd,CAAC,MAAM,EAAE,aAAsB,EAAE,EAAE;gBACjC,MAAM,aAAa,GACjB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,QAAQ;oBACrC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM;oBACvB,CAAC,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BACnB,IAAA,eAAO,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACrB,MAAM,KAAK,CAAC;aACb;QACH,CAAC,CAAC;IACJ,CAAC;CACF;AAvLD,wDAuLC","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 { diag, trace, context, SpanKind } from '@opentelemetry/api';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n} from '@opentelemetry/instrumentation';\nimport { IORedisInstrumentationConfig } from './types';\nimport { IORedisCommand, RedisInterface } from './internal-types';\nimport {\n DB_SYSTEM_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 constructor(config: IORedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, { ...DEFAULT_CONFIG, ...config });\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 span = instrumentation.tracer.startSpan(cmd.name, {\n kind: SpanKind.CLIENT,\n attributes: {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [ATTR_DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args),\n },\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 const { host, port } = this.options;\n\n span.setAttributes({\n [ATTR_NET_PEER_NAME]: host,\n [ATTR_NET_PEER_PORT]: port,\n [ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`,\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 span = instrumentation.tracer.startSpan('connect', {\n kind: SpanKind.CLIENT,\n attributes: {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [ATTR_DB_STATEMENT]: 'connect',\n },\n });\n const { host, port } = this.options;\n\n span.setAttributes({\n [ATTR_NET_PEER_NAME]: host,\n [ATTR_NET_PEER_PORT]: port,\n [ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`,\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"]}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Deprecated, use `server.address`, `server.port` attributes instead.
3
+ *
4
+ * @example "Server=(localdb)\\v11.0;Integrated Security=true;"
5
+ *
6
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
7
+ *
8
+ * @deprecated Replaced by `server.address` and `server.port`.
9
+ */
10
+ export declare const ATTR_DB_CONNECTION_STRING: "db.connection_string";
11
+ /**
12
+ * The database statement being executed.
13
+ *
14
+ * @example SELECT * FROM wuser_table
15
+ * @example SET mykey "WuValue"
16
+ *
17
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
18
+ *
19
+ * @deprecated Replaced by `db.query.text`.
20
+ */
21
+ export declare const ATTR_DB_STATEMENT: "db.statement";
22
+ /**
23
+ * Deprecated, use `db.system.name` instead.
24
+ *
25
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
26
+ *
27
+ * @deprecated Replaced by `db.system.name`.
28
+ */
29
+ export declare const ATTR_DB_SYSTEM: "db.system";
30
+ /**
31
+ * Deprecated, use `server.address` on client spans and `client.address` on server spans.
32
+ *
33
+ * @example example.com
34
+ *
35
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
36
+ *
37
+ * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.
38
+ */
39
+ export declare const ATTR_NET_PEER_NAME: "net.peer.name";
40
+ /**
41
+ * Deprecated, use `server.port` on client spans and `client.port` on server spans.
42
+ *
43
+ * @example 8080
44
+ *
45
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
46
+ *
47
+ * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.
48
+ */
49
+ export declare const ATTR_NET_PEER_PORT: "net.peer.port";
50
+ /**
51
+ * Enum value "redis" for attribute {@link ATTR_DB_SYSTEM}.
52
+ *
53
+ * Redis
54
+ *
55
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
56
+ */
57
+ export declare const DB_SYSTEM_VALUE_REDIS: "redis";
58
+ //# sourceMappingURL=semconv.d.ts.map
@@ -0,0 +1,81 @@
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.DB_SYSTEM_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;
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 `server.address`, `server.port` attributes instead.
26
+ *
27
+ * @example "Server=(localdb)\\v11.0;Integrated Security=true;"
28
+ *
29
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
30
+ *
31
+ * @deprecated Replaced by `server.address` and `server.port`.
32
+ */
33
+ exports.ATTR_DB_CONNECTION_STRING = 'db.connection_string';
34
+ /**
35
+ * The database statement being executed.
36
+ *
37
+ * @example SELECT * FROM wuser_table
38
+ * @example SET mykey "WuValue"
39
+ *
40
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
41
+ *
42
+ * @deprecated Replaced by `db.query.text`.
43
+ */
44
+ exports.ATTR_DB_STATEMENT = 'db.statement';
45
+ /**
46
+ * Deprecated, use `db.system.name` instead.
47
+ *
48
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
49
+ *
50
+ * @deprecated Replaced by `db.system.name`.
51
+ */
52
+ exports.ATTR_DB_SYSTEM = 'db.system';
53
+ /**
54
+ * Deprecated, use `server.address` on client spans and `client.address` on server spans.
55
+ *
56
+ * @example example.com
57
+ *
58
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
59
+ *
60
+ * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.
61
+ */
62
+ exports.ATTR_NET_PEER_NAME = 'net.peer.name';
63
+ /**
64
+ * Deprecated, use `server.port` on client spans and `client.port` on server spans.
65
+ *
66
+ * @example 8080
67
+ *
68
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
69
+ *
70
+ * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.
71
+ */
72
+ exports.ATTR_NET_PEER_PORT = 'net.peer.port';
73
+ /**
74
+ * Enum value "redis" for attribute {@link ATTR_DB_SYSTEM}.
75
+ *
76
+ * Redis
77
+ *
78
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
79
+ */
80
+ exports.DB_SYSTEM_VALUE_REDIS = 'redis';
81
+ //# 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;;;;;;;;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,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}.\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,3 +1,3 @@
1
- export declare const PACKAGE_VERSION = "0.53.0";
1
+ export declare const PACKAGE_VERSION = "0.53.3";
2
2
  export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-ioredis";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -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.53.0';
20
+ exports.PACKAGE_VERSION = '0.53.3';
21
21
  exports.PACKAGE_NAME = '@opentelemetry/instrumentation-ioredis';
22
22
  //# 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.53.0';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-ioredis';\n"]}
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.53.3';\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.53.0",
3
+ "version": "0.53.3",
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",
@@ -19,7 +19,6 @@
19
19
  "prepublishOnly": "npm run compile",
20
20
  "test": "nyc --no-clean mocha 'test/**/*.test.ts'",
21
21
  "test-all-versions": "tav",
22
- "test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json",
23
22
  "tdd": "npm run test -- --watch-extensions ts --watch",
24
23
  "test:debug": "cross-env RUN_REDIS_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'",
25
24
  "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test",
@@ -56,15 +55,16 @@
56
55
  "devDependencies": {
57
56
  "@opentelemetry/api": "^1.3.0",
58
57
  "@opentelemetry/context-async-hooks": "^2.0.0",
59
- "@opentelemetry/contrib-test-utils": "^0.51.0",
58
+ "@opentelemetry/contrib-test-utils": "^0.52.2",
60
59
  "@opentelemetry/sdk-trace-base": "^2.0.0",
61
60
  "@opentelemetry/sdk-trace-node": "^2.0.0",
61
+ "@opentelemetry/semantic-conventions": "^1.27.0",
62
62
  "@types/ioredis4": "npm:@types/ioredis@4.28.10",
63
63
  "@types/mocha": "10.0.10",
64
64
  "@types/node": "18.18.14",
65
65
  "@types/sinon": "17.0.4",
66
66
  "cross-env": "7.0.3",
67
- "ioredis": "5.2.2",
67
+ "ioredis": "5.8.0",
68
68
  "nyc": "17.1.0",
69
69
  "rimraf": "5.0.10",
70
70
  "sinon": "15.2.0",
@@ -73,9 +73,8 @@
73
73
  },
74
74
  "dependencies": {
75
75
  "@opentelemetry/instrumentation": "^0.205.0",
76
- "@opentelemetry/redis-common": "^0.38.0",
77
- "@opentelemetry/semantic-conventions": "^1.27.0"
76
+ "@opentelemetry/redis-common": "^0.38.2"
78
77
  },
79
78
  "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-ioredis#readme",
80
- "gitHead": "f54a1ba1adf19fd2cbf9ddbdb32a3baca2ed328e"
79
+ "gitHead": "5a5918fd4f9f16b14c9ef4d3de08ab98c20e5b46"
81
80
  }