@opentelemetry/instrumentation-ioredis 0.55.0 → 0.57.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.
- package/README.md +23 -13
- package/build/src/instrumentation.d.ts +3 -0
- package/build/src/instrumentation.js +50 -20
- package/build/src/instrumentation.js.map +1 -1
- package/build/src/internal-types.d.ts +1 -0
- package/build/src/semconv.d.ts +8 -0
- package/build/src/semconv.js +9 -1
- package/build/src/semconv.js.map +1 -1
- package/build/src/types.d.ts +1 -0
- 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 +7 -16
package/README.md
CHANGED
|
@@ -46,12 +46,12 @@ registerInstrumentations({
|
|
|
46
46
|
|
|
47
47
|
IORedis instrumentation has few options available to choose from. You can set the following:
|
|
48
48
|
|
|
49
|
-
| Options | Type | Description
|
|
50
|
-
|
|
51
|
-
| `dbStatementSerializer` | `DbStatementSerializer` | IORedis instrumentation will serialize db.statement using the specified function.
|
|
49
|
+
| Options | Type | Description |
|
|
50
|
+
| ----------------------- | ------------------------------------------------- | ----------- |
|
|
51
|
+
| `dbStatementSerializer` | `DbStatementSerializer` | IORedis instrumentation will serialize db.statement using the specified function. |
|
|
52
52
|
| `requestHook` | `RedisRequestCustomAttributeFunction` (function) | Function for adding custom attributes on db request. Receives params: `span, { moduleVersion, cmdName, cmdArgs }` |
|
|
53
|
-
| `responseHook` | `RedisResponseCustomAttributeFunction` (function) | Function for adding custom attributes on db response
|
|
54
|
-
| `requireParentSpan` | `boolean` | Require parent to create ioredis span, default when unset is true
|
|
53
|
+
| `responseHook` | `RedisResponseCustomAttributeFunction` (function) | Function for adding custom attributes on db response |
|
|
54
|
+
| `requireParentSpan` | `boolean` | Require parent to create ioredis span, default when unset is true |
|
|
55
55
|
|
|
56
56
|
#### Custom db.statement Serializer
|
|
57
57
|
|
|
@@ -100,17 +100,27 @@ requestHook: function (
|
|
|
100
100
|
|
|
101
101
|
## Semantic Conventions
|
|
102
102
|
|
|
103
|
-
This
|
|
103
|
+
This instrumentation implements Semantic Conventions (semconv) v1.7.0. Since then, networking (in semconv v1.23.1) and database (in semconv v1.33.0) semantic conventions were stabilized. As of `@opentelemetry/instrumentation-ioredis@0.57.0` support has been added for migrating to the stable semantic conventions using the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable as follows:
|
|
104
|
+
|
|
105
|
+
1. Upgrade to the latest version of this instrumentation package.
|
|
106
|
+
2. Set `OTEL_SEMCONV_STABILITY_OPT_IN=http/dup,database/dup` to emit both old and stable semantic conventions. (The `http` token is used to control the `net.*` attributes, the `database` token to control to `db.*` attributes.)
|
|
107
|
+
3. Modify alerts, dashboards, metrics, and other processes in your Observability system to use the stable semantic conventions.
|
|
108
|
+
4. Set `OTEL_SEMCONV_STABILITY_OPT_IN=http,database` to emit only the stable semantic conventions.
|
|
109
|
+
|
|
110
|
+
By default, if `OTEL_SEMCONV_STABILITY_OPT_IN` includes neither of the above tokens, the old v1.7.0 semconv is used.
|
|
111
|
+
The intent is to provide an approximate 6 month time window for users of this instrumentation to migrate to the new database and networking semconv, after which a new minor version will use the new semconv by default and drop support for the old semconv.
|
|
112
|
+
See [the HTTP migration guide](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/) and the [database migration guide](https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/) for details.
|
|
104
113
|
|
|
105
114
|
Attributes collected:
|
|
106
115
|
|
|
107
|
-
|
|
|
108
|
-
|
|
109
|
-
| `db.connection_string` |
|
|
110
|
-
| `db.
|
|
111
|
-
| `db.
|
|
112
|
-
| `net.peer.
|
|
113
|
-
| `net.peer.
|
|
116
|
+
| Old semconv | Stable semconv | Description |
|
|
117
|
+
| ---------------------- | ---------------- | ----------- |
|
|
118
|
+
| `db.connection_string` | Removed | |
|
|
119
|
+
| `db.system` | `db.system.name` | 'redis' |
|
|
120
|
+
| `db.statement` | `db.query.text` | The database query being executed. |
|
|
121
|
+
| `net.peer.port` | `server.port` | Remote port number. |
|
|
122
|
+
| `net.peer.name` | `server.address` | Remote hostname or similar. |
|
|
123
|
+
|
|
114
124
|
|
|
115
125
|
## Useful links
|
|
116
126
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
2
2
|
import { IORedisInstrumentationConfig } from './types';
|
|
3
3
|
export declare class IORedisInstrumentation extends InstrumentationBase<IORedisInstrumentationConfig> {
|
|
4
|
+
private _netSemconvStability;
|
|
5
|
+
private _dbSemconvStability;
|
|
4
6
|
constructor(config?: IORedisInstrumentationConfig);
|
|
7
|
+
private _setSemconvStabilityFromEnv;
|
|
5
8
|
setConfig(config?: IORedisInstrumentationConfig): void;
|
|
6
9
|
init(): InstrumentationNodeModuleDefinition[];
|
|
7
10
|
/**
|
|
@@ -18,6 +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
22
|
const semconv_1 = require("./semconv");
|
|
22
23
|
const instrumentation_2 = require("@opentelemetry/instrumentation");
|
|
23
24
|
const utils_1 = require("./utils");
|
|
@@ -28,8 +29,16 @@ const DEFAULT_CONFIG = {
|
|
|
28
29
|
requireParentSpan: true,
|
|
29
30
|
};
|
|
30
31
|
class IORedisInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
32
|
+
_netSemconvStability;
|
|
33
|
+
_dbSemconvStability;
|
|
31
34
|
constructor(config = {}) {
|
|
32
35
|
super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, { ...DEFAULT_CONFIG, ...config });
|
|
36
|
+
this._setSemconvStabilityFromEnv();
|
|
37
|
+
}
|
|
38
|
+
// Used for testing.
|
|
39
|
+
_setSemconvStabilityFromEnv() {
|
|
40
|
+
this._netSemconvStability = (0, instrumentation_1.semconvStabilityFromStr)('http', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
|
|
41
|
+
this._dbSemconvStability = (0, instrumentation_1.semconvStabilityFromStr)('database', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
|
|
33
42
|
}
|
|
34
43
|
setConfig(config = {}) {
|
|
35
44
|
super.setConfig({ ...DEFAULT_CONFIG, ...config });
|
|
@@ -85,12 +94,29 @@ class IORedisInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
|
85
94
|
if (config.requireParentSpan === true && hasNoParentSpan) {
|
|
86
95
|
return original.apply(this, arguments);
|
|
87
96
|
}
|
|
97
|
+
const attributes = {};
|
|
98
|
+
const { host, port } = this.options;
|
|
99
|
+
const dbQueryText = dbStatementSerializer(cmd.name, cmd.args);
|
|
100
|
+
if (instrumentation._dbSemconvStability & instrumentation_1.SemconvStability.OLD) {
|
|
101
|
+
attributes[semconv_1.ATTR_DB_SYSTEM] = semconv_1.DB_SYSTEM_VALUE_REDIS;
|
|
102
|
+
attributes[semconv_1.ATTR_DB_STATEMENT] = dbQueryText;
|
|
103
|
+
attributes[semconv_1.ATTR_DB_CONNECTION_STRING] = `redis://${host}:${port}`;
|
|
104
|
+
}
|
|
105
|
+
if (instrumentation._dbSemconvStability & instrumentation_1.SemconvStability.STABLE) {
|
|
106
|
+
attributes[semantic_conventions_1.ATTR_DB_SYSTEM_NAME] = semconv_1.DB_SYSTEM_NAME_VALUE_REDIS;
|
|
107
|
+
attributes[semantic_conventions_1.ATTR_DB_QUERY_TEXT] = dbQueryText;
|
|
108
|
+
}
|
|
109
|
+
if (instrumentation._netSemconvStability & instrumentation_1.SemconvStability.OLD) {
|
|
110
|
+
attributes[semconv_1.ATTR_NET_PEER_NAME] = host;
|
|
111
|
+
attributes[semconv_1.ATTR_NET_PEER_PORT] = port;
|
|
112
|
+
}
|
|
113
|
+
if (instrumentation._netSemconvStability & instrumentation_1.SemconvStability.STABLE) {
|
|
114
|
+
attributes[semantic_conventions_1.ATTR_SERVER_ADDRESS] = host;
|
|
115
|
+
attributes[semantic_conventions_1.ATTR_SERVER_PORT] = port;
|
|
116
|
+
}
|
|
88
117
|
const span = instrumentation.tracer.startSpan(cmd.name, {
|
|
89
118
|
kind: api_1.SpanKind.CLIENT,
|
|
90
|
-
attributes
|
|
91
|
-
[semconv_1.ATTR_DB_SYSTEM]: semconv_1.DB_SYSTEM_VALUE_REDIS,
|
|
92
|
-
[semconv_1.ATTR_DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args),
|
|
93
|
-
},
|
|
119
|
+
attributes,
|
|
94
120
|
});
|
|
95
121
|
const { requestHook } = config;
|
|
96
122
|
if (requestHook) {
|
|
@@ -104,12 +130,6 @@ class IORedisInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
|
104
130
|
}
|
|
105
131
|
}, true);
|
|
106
132
|
}
|
|
107
|
-
const { host, port } = this.options;
|
|
108
|
-
span.setAttributes({
|
|
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
|
-
});
|
|
113
133
|
try {
|
|
114
134
|
const result = original.apply(this, arguments);
|
|
115
135
|
const origResolve = cmd.resolve;
|
|
@@ -144,18 +164,28 @@ class IORedisInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
|
144
164
|
hasNoParentSpan) {
|
|
145
165
|
return original.apply(this, arguments);
|
|
146
166
|
}
|
|
167
|
+
const attributes = {};
|
|
168
|
+
const { host, port } = this.options;
|
|
169
|
+
if (instrumentation._dbSemconvStability & instrumentation_1.SemconvStability.OLD) {
|
|
170
|
+
attributes[semconv_1.ATTR_DB_SYSTEM] = semconv_1.DB_SYSTEM_VALUE_REDIS;
|
|
171
|
+
attributes[semconv_1.ATTR_DB_STATEMENT] = 'connect';
|
|
172
|
+
attributes[semconv_1.ATTR_DB_CONNECTION_STRING] = `redis://${host}:${port}`;
|
|
173
|
+
}
|
|
174
|
+
if (instrumentation._dbSemconvStability & instrumentation_1.SemconvStability.STABLE) {
|
|
175
|
+
attributes[semantic_conventions_1.ATTR_DB_SYSTEM_NAME] = semconv_1.DB_SYSTEM_NAME_VALUE_REDIS;
|
|
176
|
+
attributes[semantic_conventions_1.ATTR_DB_QUERY_TEXT] = 'connect';
|
|
177
|
+
}
|
|
178
|
+
if (instrumentation._netSemconvStability & instrumentation_1.SemconvStability.OLD) {
|
|
179
|
+
attributes[semconv_1.ATTR_NET_PEER_NAME] = host;
|
|
180
|
+
attributes[semconv_1.ATTR_NET_PEER_PORT] = port;
|
|
181
|
+
}
|
|
182
|
+
if (instrumentation._netSemconvStability & instrumentation_1.SemconvStability.STABLE) {
|
|
183
|
+
attributes[semantic_conventions_1.ATTR_SERVER_ADDRESS] = host;
|
|
184
|
+
attributes[semantic_conventions_1.ATTR_SERVER_PORT] = port;
|
|
185
|
+
}
|
|
147
186
|
const span = instrumentation.tracer.startSpan('connect', {
|
|
148
187
|
kind: api_1.SpanKind.CLIENT,
|
|
149
|
-
attributes
|
|
150
|
-
[semconv_1.ATTR_DB_SYSTEM]: semconv_1.DB_SYSTEM_VALUE_REDIS,
|
|
151
|
-
[semconv_1.ATTR_DB_STATEMENT]: 'connect',
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
const { host, port } = this.options;
|
|
155
|
-
span.setAttributes({
|
|
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}`,
|
|
188
|
+
attributes,
|
|
159
189
|
});
|
|
160
190
|
try {
|
|
161
191
|
const client = original.apply(this, arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sourceRoot":"","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,KAAK,IAAI;gBACtD,eAAe,EACf;gBACA,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;aACxC;YAED,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE;gBACvD,IAAI,EAAE,cAAQ,CAAC,MAAM;gBACrB,UAAU,EAAE;oBACV,CAAC,wBAAc,CAAC,EAAE,+BAAqB;oBACvC,CAAC,2BAAiB,CAAC,EAAE,SAAS;iBAC/B;aACF,CAAC,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;YAEpC,IAAI,CAAC,aAAa,CAAC;gBACjB,CAAC,4BAAkB,CAAC,EAAE,IAAI;gBAC1B,CAAC,4BAAkB,CAAC,EAAE,IAAI;gBAC1B,CAAC,mCAAyB,CAAC,EAAE,WAAW,IAAI,IAAI,IAAI,EAAE;aACvD,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 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"]}
|
|
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,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;QACvE,IAAI,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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"]}
|
package/build/src/semconv.d.ts
CHANGED
|
@@ -47,6 +47,14 @@ export declare const ATTR_NET_PEER_NAME: "net.peer.name";
|
|
|
47
47
|
* @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.
|
|
48
48
|
*/
|
|
49
49
|
export declare const ATTR_NET_PEER_PORT: "net.peer.port";
|
|
50
|
+
/**
|
|
51
|
+
* Enum value "redis" for attribute {@link ATTR_DB_SYSTEM_NAME}.
|
|
52
|
+
*
|
|
53
|
+
* [Redis](https://redis.io/)
|
|
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_NAME_VALUE_REDIS: "redis";
|
|
50
58
|
/**
|
|
51
59
|
* Enum value "redis" for attribute {@link ATTR_DB_SYSTEM}.
|
|
52
60
|
*
|
package/build/src/semconv.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
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;
|
|
18
|
+
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;
|
|
19
19
|
/*
|
|
20
20
|
* This file contains a copy of unstable semantic convention definitions
|
|
21
21
|
* used by this package.
|
|
@@ -70,6 +70,14 @@ exports.ATTR_NET_PEER_NAME = 'net.peer.name';
|
|
|
70
70
|
* @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.
|
|
71
71
|
*/
|
|
72
72
|
exports.ATTR_NET_PEER_PORT = 'net.peer.port';
|
|
73
|
+
/**
|
|
74
|
+
* Enum value "redis" for attribute {@link ATTR_DB_SYSTEM_NAME}.
|
|
75
|
+
*
|
|
76
|
+
* [Redis](https://redis.io/)
|
|
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_NAME_VALUE_REDIS = 'redis';
|
|
73
81
|
/**
|
|
74
82
|
* Enum value "redis" for attribute {@link ATTR_DB_SYSTEM}.
|
|
75
83
|
*
|
package/build/src/semconv.js.map
CHANGED
|
@@ -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,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
|
+
{"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"]}
|
package/build/src/types.d.ts
CHANGED
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.
|
|
20
|
+
exports.PACKAGE_VERSION = '0.57.0';
|
|
21
21
|
exports.PACKAGE_NAME = '@opentelemetry/instrumentation-ioredis';
|
|
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.
|
|
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.57.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.
|
|
3
|
+
"version": "0.57.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",
|
|
@@ -53,26 +53,17 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@opentelemetry/api": "^1.3.0",
|
|
55
55
|
"@opentelemetry/context-async-hooks": "^2.0.0",
|
|
56
|
-
"@opentelemetry/contrib-test-utils": "^0.
|
|
56
|
+
"@opentelemetry/contrib-test-utils": "^0.56.0",
|
|
57
57
|
"@opentelemetry/sdk-trace-base": "^2.0.0",
|
|
58
58
|
"@opentelemetry/sdk-trace-node": "^2.0.0",
|
|
59
|
-
"@opentelemetry/semantic-conventions": "^1.27.0",
|
|
60
59
|
"@types/ioredis4": "npm:@types/ioredis@4.28.10",
|
|
61
|
-
"
|
|
62
|
-
"@types/node": "18.18.14",
|
|
63
|
-
"@types/sinon": "17.0.4",
|
|
64
|
-
"cross-env": "7.0.3",
|
|
65
|
-
"ioredis": "5.8.1",
|
|
66
|
-
"nyc": "17.1.0",
|
|
67
|
-
"rimraf": "5.0.10",
|
|
68
|
-
"sinon": "15.2.0",
|
|
69
|
-
"test-all-versions": "6.1.0",
|
|
70
|
-
"typescript": "5.0.4"
|
|
60
|
+
"ioredis": "5.8.2"
|
|
71
61
|
},
|
|
72
62
|
"dependencies": {
|
|
73
|
-
"@opentelemetry/instrumentation": "^0.
|
|
74
|
-
"@opentelemetry/redis-common": "^0.38.2"
|
|
63
|
+
"@opentelemetry/instrumentation": "^0.208.0",
|
|
64
|
+
"@opentelemetry/redis-common": "^0.38.2",
|
|
65
|
+
"@opentelemetry/semantic-conventions": "^1.33.0"
|
|
75
66
|
},
|
|
76
67
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-ioredis#readme",
|
|
77
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "66935ac724cc271f70028035e534d47a4dfbcf12"
|
|
78
69
|
}
|