@zyno-io/dk-server-foundation 26.218.56 → 26.221.906
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/dist/resources/proto/generated/devconsole/devconsole.js +1 -1
- package/dist/src/telemetry/otel/MariaDBInstrumentation.d.ts +3 -0
- package/dist/src/telemetry/otel/MariaDBInstrumentation.d.ts.map +1 -1
- package/dist/src/telemetry/otel/MariaDBInstrumentation.js +48 -14
- package/dist/src/telemetry/otel/MariaDBInstrumentation.js.map +1 -1
- package/package.json +11 -11
- package/src/telemetry/otel/MariaDBInstrumentation.ts +52 -13
|
@@ -14,7 +14,7 @@ function __assignType(fn, args) {
|
|
|
14
14
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
15
15
|
// versions:
|
|
16
16
|
// protoc-gen-ts_proto v2.11.2
|
|
17
|
-
// protoc
|
|
17
|
+
// protoc v5.29.6
|
|
18
18
|
// source: devconsole.proto
|
|
19
19
|
/* eslint-disable */
|
|
20
20
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
@@ -9,6 +9,9 @@ export declare class MariaDBInstrumentation extends InstrumentationBase {
|
|
|
9
9
|
constructor(config?: MySQLInstrumentationConfig);
|
|
10
10
|
setMeterProvider(meterProvider: MeterProvider): void;
|
|
11
11
|
private _setMetricInstruments;
|
|
12
|
+
private _originals;
|
|
13
|
+
private _wrapCompat;
|
|
14
|
+
private _unwrapCompat;
|
|
12
15
|
protected init(): InstrumentationNodeModuleDefinition[];
|
|
13
16
|
private _patchCreateConnection;
|
|
14
17
|
private _patchCreatePool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MariaDBInstrumentation.d.ts","sourceRoot":"","sources":["../../../../src/telemetry/otel/MariaDBInstrumentation.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAc,aAAa,EAAiB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAa,MAAM,gCAAgC,CAAC;AAErH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAOlG,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC3D,MAAM,CAAC,QAAQ,CAAC,iBAAiB;;MAE/B;IACF,OAAO,CAAC,iBAAiB,CAAiB;gBAE9B,MAAM,CAAC,EAAE,0BAA0B;IAKtC,gBAAgB,CAAC,aAAa,EAAE,aAAa;IAKtD,OAAO,CAAC,qBAAqB;
|
|
1
|
+
{"version":3,"file":"MariaDBInstrumentation.d.ts","sourceRoot":"","sources":["../../../../src/telemetry/otel/MariaDBInstrumentation.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAc,aAAa,EAAiB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAa,MAAM,gCAAgC,CAAC;AAErH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAOlG,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC3D,MAAM,CAAC,QAAQ,CAAC,iBAAiB;;MAE/B;IACF,OAAO,CAAC,iBAAiB,CAAiB;gBAE9B,MAAM,CAAC,EAAE,0BAA0B;IAKtC,gBAAgB,CAAC,aAAa,EAAE,aAAa;IAKtD,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,UAAU,CAA+B;IAKjD,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,aAAa;IAWrB,SAAS,CAAC,IAAI;IAwCd,OAAO,CAAC,sBAAsB;IAoB9B,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,aAAa;IAyBrB,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,SAAS;IA4BjB,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,WAAW;IAwCnB,OAAO,CAAC,iBAAiB;CAiC5B"}
|
|
@@ -13,6 +13,8 @@ const helpers_1 = require("./helpers");
|
|
|
13
13
|
class MariaDBInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
14
14
|
constructor(config) {
|
|
15
15
|
super('@opentelemetry/instrumentation-mariadb', '0.0.1', config ?? {});
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
17
|
+
this._originals = (Map.Ω = [['&'], [() => Function, 'Pu!']], new Map());
|
|
16
18
|
this._setMetricInstruments();
|
|
17
19
|
}
|
|
18
20
|
setMeterProvider(meterProvider) {
|
|
@@ -26,31 +28,63 @@ class MariaDBInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
|
26
28
|
unit: '{connection}'
|
|
27
29
|
});
|
|
28
30
|
}
|
|
31
|
+
// mariadb 3.5+ uses ESM, where exports are writable but not configurable.
|
|
32
|
+
// shimmer's _wrap uses Object.defineProperty which requires configurable,
|
|
33
|
+
// so we fall back to direct assignment for non-configurable properties.
|
|
34
|
+
_wrapCompat(moduleExports, name,
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
36
|
+
wrapper) {
|
|
37
|
+
const descriptor = Object.getOwnPropertyDescriptor(moduleExports, name);
|
|
38
|
+
// oxlint-disable-next-line typescript/no-unsafe-function-type
|
|
39
|
+
const original = moduleExports[name];
|
|
40
|
+
if (descriptor && !descriptor.configurable) {
|
|
41
|
+
this._originals.set(name, original);
|
|
42
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
43
|
+
moduleExports[name] = wrapper(original);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
47
|
+
this._wrap(moduleExports, name, wrapper);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
_unwrapCompat(moduleExports, name) {
|
|
51
|
+
const original = this._originals.get(name);
|
|
52
|
+
if (original) {
|
|
53
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
54
|
+
moduleExports[name] = original;
|
|
55
|
+
this._originals.delete(name);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
this._unwrap(moduleExports, name);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
29
61
|
init() {
|
|
30
62
|
return [
|
|
31
63
|
new instrumentation_1.InstrumentationNodeModuleDefinition('mariadb', ['3.*'], __assignType(moduleExports => {
|
|
64
|
+
// ESM namespace objects are sealed (non-configurable, non-writable).
|
|
65
|
+
// Create a mutable shallow copy so we can patch the exports.
|
|
66
|
+
if (!Object.isExtensible(moduleExports)) {
|
|
67
|
+
moduleExports = { ...moduleExports };
|
|
68
|
+
}
|
|
32
69
|
if ((0, instrumentation_1.isWrapped)(moduleExports.createConnection)) {
|
|
33
|
-
this.
|
|
70
|
+
this._unwrapCompat(moduleExports, 'createConnection');
|
|
34
71
|
}
|
|
35
|
-
|
|
36
|
-
this._wrap(moduleExports, 'createConnection', this._patchCreateConnection());
|
|
72
|
+
this._wrapCompat(moduleExports, 'createConnection', this._patchCreateConnection());
|
|
37
73
|
if ((0, instrumentation_1.isWrapped)(moduleExports.createPool)) {
|
|
38
|
-
this.
|
|
74
|
+
this._unwrapCompat(moduleExports, 'createPool');
|
|
39
75
|
}
|
|
40
|
-
|
|
41
|
-
this._wrap(moduleExports, 'createPool', this._patchCreatePool());
|
|
76
|
+
this._wrapCompat(moduleExports, 'createPool', this._patchCreatePool());
|
|
42
77
|
if ((0, instrumentation_1.isWrapped)(moduleExports.createPoolCluster)) {
|
|
43
|
-
this.
|
|
78
|
+
this._unwrapCompat(moduleExports, 'createPoolCluster');
|
|
44
79
|
}
|
|
45
|
-
|
|
46
|
-
this._wrap(moduleExports, 'createPoolCluster', this._patchCreatePoolCluster());
|
|
80
|
+
this._wrapCompat(moduleExports, 'createPoolCluster', this._patchCreatePoolCluster());
|
|
47
81
|
return moduleExports;
|
|
48
82
|
}, ['moduleExports', '', 'P"2!"/"']), __assignType(moduleExports => {
|
|
49
83
|
if (moduleExports === undefined)
|
|
50
84
|
return;
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
85
|
+
this._unwrapCompat(moduleExports, 'createConnection');
|
|
86
|
+
this._unwrapCompat(moduleExports, 'createPool');
|
|
87
|
+
this._unwrapCompat(moduleExports, 'createPoolCluster');
|
|
54
88
|
}, ['moduleExports', '', 'P"2!"/"']))
|
|
55
89
|
];
|
|
56
90
|
}
|
|
@@ -205,7 +239,7 @@ class MariaDBInstrumentation extends instrumentation_1.InstrumentationBase {
|
|
|
205
239
|
}
|
|
206
240
|
return (0, helpers_1.withSpan)(spanName, spanAttributes, () => originalQuery.apply(connection, [query, _valuesOrCallback]));
|
|
207
241
|
}, ['query', '_valuesOrCallback', 'P&2!"F2"8"/!']);
|
|
208
|
-
}, [() => Function, 'originalQuery',
|
|
242
|
+
}, [() => Function, 'originalQuery', '', 'PPu!2""/#']);
|
|
209
243
|
}
|
|
210
244
|
_setPoolcallbacks(pool, thisPlugin, id) {
|
|
211
245
|
//TODO:: use semantic convention
|
|
@@ -244,5 +278,5 @@ MariaDBInstrumentation.COMMON_ATTRIBUTES = {
|
|
|
244
278
|
};
|
|
245
279
|
MariaDBInstrumentation.__type = [() => instrumentation_1.InstrumentationBase, 'COMMON_ATTRIBUTES', function () { return {
|
|
246
280
|
[semantic_conventions_1.ATTR_DB_SYSTEM_NAME]: semantic_conventions_1.DB_SYSTEM_NAME_VALUE_MARIADB
|
|
247
|
-
}; }, 'UpDownCounter', '_connectionsUsage', 'MySQLInstrumentationConfig', 'config', 'constructor', 'MeterProvider', 'meterProvider', 'setMeterProvider', '_setMetricInstruments', 'init', '_patchCreateConnection', '_patchCreatePool', 'pool', '_patchPoolEnd', '_patchCreatePoolCluster', 'cluster', '_patchAdd', '_patchGetConnection', 'connection', '_patchQuery', () => MariaDBInstrumentation, 'thisPlugin', 'id', '_setPoolcallbacks', 'MariaDBInstrumentation', 'P7!!3"9s>#"w$3%;P"w&2\'8"0(P"w)2*"0+P"0
|
|
281
|
+
}; }, 'UpDownCounter', '_connectionsUsage', 'MySQLInstrumentationConfig', 'config', 'constructor', 'MeterProvider', 'meterProvider', 'setMeterProvider', '_setMetricInstruments', '_originals', function () { return (Map.Ω = [['&'], [() => Function, 'Pu!']], new Map()); }, () => mariadbTypes, 'moduleExports', 'name', () => Function, 'original', () => Function, '', 'wrapper', '_wrapCompat', () => mariadbTypes, '_unwrapCompat', 'init', '_patchCreateConnection', '_patchCreatePool', 'pool', '_patchPoolEnd', '_patchCreatePoolCluster', 'cluster', '_patchAdd', '_patchGetConnection', 'connection', '_patchQuery', () => MariaDBInstrumentation, 'thisPlugin', 'id', '_setPoolcallbacks', 'MariaDBInstrumentation', 'P7!!3"9s>#"w$3%;P"w&2\'8"0(P"w)2*"0+P"0,;!3-;>.Pi/20"21PPu223Pu4/526"07;Pi820"21"09;P"0:<P"0;;P"0<;P!2="0>;P"0?;P!2@"0A;PP!!J2="0B;PP!!J2C"0D;P!2=P7E2F&2G"0H;5wI'];
|
|
248
282
|
//# sourceMappingURL=MariaDBInstrumentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MariaDBInstrumentation.js","sourceRoot":"","sources":["../../../../src/telemetry/otel/MariaDBInstrumentation.ts"],"names":[],"mappings":";;;;;;;AAmBA,oEAAqH;AACrH,kGAA+F;AAE/F,gFAAgH;AAChH,8EAA4H;AAG5H,uCAAqC;AAErC,MAAa,sBAAuB,SAAQ,qCAAmB;IAM3D,YAAY,MAAmC;QAC3C,KAAK,CAAC,wCAAwC,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"MariaDBInstrumentation.js","sourceRoot":"","sources":["../../../../src/telemetry/otel/MariaDBInstrumentation.ts"],"names":[],"mappings":";;;;;;;AAmBA,oEAAqH;AACrH,kGAA+F;AAE/F,gFAAgH;AAChH,8EAA4H;AAG5H,uCAAqC;AAErC,MAAa,sBAAuB,SAAQ,qCAAmB;IAM3D,YAAY,MAAmC;QAC3C,KAAK,CAAC,wCAAwC,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC,CA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,GAAG,CAAC,CAAC,EAAE;gBAChC,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;aACjB,CAAC,CAAC;QACP,CAAC,kCAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,SAAS,eAAE,WAAW,CAAC,EAAE;YAC7B,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBACjC,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;aACjB,CAAC,CAAC;YACH,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE;gBAChC,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;aACjB,CAAC,CAAC;QACP,CAAC,kCAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,SAAS,eAAE,WAAW,CAAC,EAAE;YAC7B,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBACjC,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;aACjB,CAAC,CAAC;YACH,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE;gBAChC,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;aACjB,CAAC,CAAC;QACP,CAAC,kCAAC,CAAC;IACP,CAAC;;AAlTL,wDAmTC;AAlTmB,wCAAiB,GAAG;IAChC,CAAC,0CAAmB,CAAC,EAAE,mDAA4B;CACtD,AAFgC,CAE/B;wHAFkC;QAChC,CAAC,0CAAmB,CAAC,EAAE,mDAA4B;KACtD,qNAwBwB,GAAG,uCAAP,IAAI,GAAG,EAAoB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyno-io/dk-server-foundation",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.221.906",
|
|
4
4
|
"description": "TypeScript server foundation built on the Deepkit framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"@opentelemetry/exporter-prometheus": "^0.212.0",
|
|
67
67
|
"@opentelemetry/exporter-trace-otlp-http": "^0.212.0",
|
|
68
68
|
"@opentelemetry/instrumentation": "^0.212.0",
|
|
69
|
-
"@opentelemetry/instrumentation-dns": "^0.
|
|
69
|
+
"@opentelemetry/instrumentation-dns": "^0.55.0",
|
|
70
70
|
"@opentelemetry/instrumentation-http": "^0.212.0",
|
|
71
|
-
"@opentelemetry/instrumentation-ioredis": "^0.
|
|
72
|
-
"@opentelemetry/instrumentation-mysql": "^0.
|
|
73
|
-
"@opentelemetry/instrumentation-undici": "^0.
|
|
71
|
+
"@opentelemetry/instrumentation-ioredis": "^0.60.0",
|
|
72
|
+
"@opentelemetry/instrumentation-mysql": "^0.58.0",
|
|
73
|
+
"@opentelemetry/instrumentation-undici": "^0.22.0",
|
|
74
74
|
"@opentelemetry/node": "^0.24.0",
|
|
75
75
|
"@opentelemetry/resources": "^2.5.1",
|
|
76
76
|
"@opentelemetry/sdk-metrics": "^2.5.1",
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
"@opentelemetry/sdk-trace-base": "^2.5.1",
|
|
79
79
|
"@opentelemetry/sdk-trace-node": "^2.5.1",
|
|
80
80
|
"@opentelemetry/semantic-conventions": "^1.39.0",
|
|
81
|
-
"@sentry/node": "^10.
|
|
81
|
+
"@sentry/node": "^10.39.0",
|
|
82
82
|
"@types/formidable": "^3.4.6",
|
|
83
83
|
"@zyno-io/config": "^1.10.0",
|
|
84
84
|
"bcrypt": "^6.0.0",
|
|
85
|
-
"bullmq": "^5.69.
|
|
85
|
+
"bullmq": "^5.69.4",
|
|
86
86
|
"date-fns": "^4.1.0",
|
|
87
87
|
"debug": "^4.4.3",
|
|
88
88
|
"deepkit-openapi-core": "^0.0.9",
|
|
@@ -90,13 +90,13 @@
|
|
|
90
90
|
"google-libphonenumber": "^3.2.44",
|
|
91
91
|
"ioredis": "^5.9.3",
|
|
92
92
|
"lodash": "^4.17.23",
|
|
93
|
-
"mariadb": "^3.
|
|
93
|
+
"mariadb": "^3.5.1",
|
|
94
94
|
"nodemailer": "^8.0.1",
|
|
95
95
|
"opentelemetry-node-metrics": "^3.0.0",
|
|
96
96
|
"patch-package": "^8.0.1",
|
|
97
97
|
"pino": "^10.3.1",
|
|
98
98
|
"pino-pretty": "^13.1.3",
|
|
99
|
-
"postmark": "^4.0.
|
|
99
|
+
"postmark": "^4.0.7",
|
|
100
100
|
"rxjs": "~7.8.2",
|
|
101
101
|
"send": "^1.2.1",
|
|
102
102
|
"tiny-glob": "^0.2.9",
|
|
@@ -110,11 +110,11 @@
|
|
|
110
110
|
"@types/debug": "^4.1.12",
|
|
111
111
|
"@types/google-libphonenumber": "^7.4.30",
|
|
112
112
|
"@types/lodash": "^4.17.23",
|
|
113
|
-
"@types/node": "^25.
|
|
113
|
+
"@types/node": "^25.3.0",
|
|
114
114
|
"@types/nodemailer": "^7",
|
|
115
115
|
"lefthook": "^2.1.1",
|
|
116
116
|
"npm-run-all": "^4.1.5",
|
|
117
|
-
"oxlint": "^1.
|
|
117
|
+
"oxlint": "^1.49.0",
|
|
118
118
|
"prettier": "^3.8.1",
|
|
119
119
|
"ts-essentials": "^10.1.1",
|
|
120
120
|
"ts-node": "^10.9.2",
|
|
@@ -52,37 +52,76 @@ export class MariaDBInstrumentation extends InstrumentationBase {
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
56
|
+
private _originals = new Map<string, Function>();
|
|
57
|
+
|
|
58
|
+
// mariadb 3.5+ uses ESM, where exports are writable but not configurable.
|
|
59
|
+
// shimmer's _wrap uses Object.defineProperty which requires configurable,
|
|
60
|
+
// so we fall back to direct assignment for non-configurable properties.
|
|
61
|
+
private _wrapCompat<K extends keyof typeof mariadbTypes>(
|
|
62
|
+
moduleExports: typeof mariadbTypes,
|
|
63
|
+
name: K,
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
65
|
+
wrapper: (original: Function) => Function
|
|
66
|
+
) {
|
|
67
|
+
const descriptor = Object.getOwnPropertyDescriptor(moduleExports, name);
|
|
68
|
+
// oxlint-disable-next-line typescript/no-unsafe-function-type
|
|
69
|
+
const original = moduleExports[name] as Function;
|
|
70
|
+
if (descriptor && !descriptor.configurable) {
|
|
71
|
+
this._originals.set(name, original);
|
|
72
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
73
|
+
(moduleExports as any)[name] = wrapper(original);
|
|
74
|
+
} else {
|
|
75
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
76
|
+
this._wrap(moduleExports, name, wrapper as any);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private _unwrapCompat<K extends keyof typeof mariadbTypes>(moduleExports: typeof mariadbTypes, name: K) {
|
|
81
|
+
const original = this._originals.get(name);
|
|
82
|
+
if (original) {
|
|
83
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
84
|
+
(moduleExports as any)[name] = original;
|
|
85
|
+
this._originals.delete(name);
|
|
86
|
+
} else {
|
|
87
|
+
this._unwrap(moduleExports, name);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
55
91
|
protected init() {
|
|
56
92
|
return [
|
|
57
93
|
new InstrumentationNodeModuleDefinition(
|
|
58
94
|
'mariadb',
|
|
59
95
|
['3.*'],
|
|
60
96
|
moduleExports => {
|
|
97
|
+
// ESM namespace objects are sealed (non-configurable, non-writable).
|
|
98
|
+
// Create a mutable shallow copy so we can patch the exports.
|
|
99
|
+
if (!Object.isExtensible(moduleExports)) {
|
|
100
|
+
moduleExports = { ...moduleExports };
|
|
101
|
+
}
|
|
102
|
+
|
|
61
103
|
if (isWrapped(moduleExports.createConnection)) {
|
|
62
|
-
this.
|
|
104
|
+
this._unwrapCompat(moduleExports, 'createConnection');
|
|
63
105
|
}
|
|
64
|
-
|
|
65
|
-
this._wrap(moduleExports, 'createConnection', this._patchCreateConnection() as any);
|
|
106
|
+
this._wrapCompat(moduleExports, 'createConnection', this._patchCreateConnection());
|
|
66
107
|
|
|
67
108
|
if (isWrapped(moduleExports.createPool)) {
|
|
68
|
-
this.
|
|
109
|
+
this._unwrapCompat(moduleExports, 'createPool');
|
|
69
110
|
}
|
|
70
|
-
|
|
71
|
-
this._wrap(moduleExports, 'createPool', this._patchCreatePool() as any);
|
|
111
|
+
this._wrapCompat(moduleExports, 'createPool', this._patchCreatePool());
|
|
72
112
|
|
|
73
113
|
if (isWrapped(moduleExports.createPoolCluster)) {
|
|
74
|
-
this.
|
|
114
|
+
this._unwrapCompat(moduleExports, 'createPoolCluster');
|
|
75
115
|
}
|
|
76
|
-
|
|
77
|
-
this._wrap(moduleExports, 'createPoolCluster', this._patchCreatePoolCluster() as any);
|
|
116
|
+
this._wrapCompat(moduleExports, 'createPoolCluster', this._patchCreatePoolCluster());
|
|
78
117
|
|
|
79
118
|
return moduleExports;
|
|
80
119
|
},
|
|
81
120
|
moduleExports => {
|
|
82
121
|
if (moduleExports === undefined) return;
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
85
|
-
this.
|
|
122
|
+
this._unwrapCompat(moduleExports, 'createConnection');
|
|
123
|
+
this._unwrapCompat(moduleExports, 'createPool');
|
|
124
|
+
this._unwrapCompat(moduleExports, 'createPoolCluster');
|
|
86
125
|
}
|
|
87
126
|
)
|
|
88
127
|
];
|
|
@@ -223,7 +262,7 @@ export class MariaDBInstrumentation extends InstrumentationBase {
|
|
|
223
262
|
|
|
224
263
|
private _patchQuery(connection: mariadbTypes.Connection | mariadbTypes.Pool) {
|
|
225
264
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
226
|
-
return (originalQuery: Function)
|
|
265
|
+
return (originalQuery: Function) => {
|
|
227
266
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
228
267
|
const thisPlugin = this;
|
|
229
268
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|