@prisma/instrumentation 5.22.0-dev.4 → 5.22.0-dev.6
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/ActiveTracingHelper.js +2 -2
- package/dist/PrismaInstrumentation.js +4 -4
- package/dist/{chunk-PE6MMRJQ.js → chunk-GP42UUXC.js} +11 -11
- package/dist/{chunk-VVAFFO6L.js → chunk-O7OBHTYQ.js} +14 -4
- package/dist/{chunk-N3Q3USKE.js → chunk-QOJUVGZL.js} +4 -4
- package/dist/{chunk-WYW3L6VL.js → chunk-YIAJHTIL.js} +5 -5
- package/dist/constants.js +5 -5
- package/dist/index.js +4 -4
- package/package.json +2 -2
|
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var ActiveTracingHelper_exports = {};
|
|
20
20
|
__export(ActiveTracingHelper_exports, {
|
|
21
|
-
ActiveTracingHelper: () =>
|
|
21
|
+
ActiveTracingHelper: () => import_chunk_O7OBHTYQ.ActiveTracingHelper
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(ActiveTracingHelper_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_O7OBHTYQ = require("./chunk-O7OBHTYQ.js");
|
|
25
25
|
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
|
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var PrismaInstrumentation_exports = {};
|
|
20
20
|
__export(PrismaInstrumentation_exports, {
|
|
21
|
-
PrismaInstrumentation: () =>
|
|
21
|
+
PrismaInstrumentation: () => import_chunk_GP42UUXC.PrismaInstrumentation
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(PrismaInstrumentation_exports);
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
var import_chunk_GP42UUXC = require("./chunk-GP42UUXC.js");
|
|
25
|
+
var import_chunk_O7OBHTYQ = require("./chunk-O7OBHTYQ.js");
|
|
26
|
+
var import_chunk_QOJUVGZL = require("./chunk-QOJUVGZL.js");
|
|
27
27
|
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
|
@@ -16,33 +16,33 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_GP42UUXC_exports = {};
|
|
20
|
+
__export(chunk_GP42UUXC_exports, {
|
|
21
21
|
PrismaInstrumentation: () => PrismaInstrumentation
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_GP42UUXC_exports);
|
|
24
|
+
var import_chunk_O7OBHTYQ = require("./chunk-O7OBHTYQ.js");
|
|
25
|
+
var import_chunk_QOJUVGZL = require("./chunk-QOJUVGZL.js");
|
|
26
26
|
var import_instrumentation = require("@opentelemetry/instrumentation");
|
|
27
27
|
var PrismaInstrumentation = class extends import_instrumentation.InstrumentationBase {
|
|
28
28
|
constructor(config = {}) {
|
|
29
|
-
super(
|
|
29
|
+
super(import_chunk_QOJUVGZL.NAME, import_chunk_QOJUVGZL.VERSION, config);
|
|
30
30
|
}
|
|
31
31
|
init() {
|
|
32
|
-
const module2 = new import_instrumentation.InstrumentationNodeModuleDefinition(
|
|
32
|
+
const module2 = new import_instrumentation.InstrumentationNodeModuleDefinition(import_chunk_QOJUVGZL.MODULE_NAME, [import_chunk_QOJUVGZL.VERSION]);
|
|
33
33
|
return [module2];
|
|
34
34
|
}
|
|
35
35
|
enable() {
|
|
36
36
|
const config = this._config;
|
|
37
37
|
const globalValue = {
|
|
38
|
-
helper: new
|
|
38
|
+
helper: new import_chunk_O7OBHTYQ.ActiveTracingHelper({ traceMiddleware: config.middleware ?? false })
|
|
39
39
|
};
|
|
40
|
-
global[
|
|
40
|
+
global[import_chunk_QOJUVGZL.GLOBAL_KEY] = globalValue;
|
|
41
41
|
}
|
|
42
42
|
disable() {
|
|
43
|
-
delete global[
|
|
43
|
+
delete global[import_chunk_QOJUVGZL.GLOBAL_KEY];
|
|
44
44
|
}
|
|
45
45
|
isEnabled() {
|
|
46
|
-
return Boolean(global[
|
|
46
|
+
return Boolean(global[import_chunk_QOJUVGZL.GLOBAL_KEY]);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
@@ -16,15 +16,24 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_O7OBHTYQ_exports = {};
|
|
20
|
+
__export(chunk_O7OBHTYQ_exports, {
|
|
21
21
|
ActiveTracingHelper: () => ActiveTracingHelper
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_O7OBHTYQ_exports);
|
|
24
24
|
var import_api = require("@opentelemetry/api");
|
|
25
25
|
var import_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
26
26
|
var showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true";
|
|
27
27
|
var nonSampledTraceParent = `00-10-10-00`;
|
|
28
|
+
function engineSpanKindToOTELSpanKind(engineSpanKind) {
|
|
29
|
+
switch (engineSpanKind) {
|
|
30
|
+
case "client":
|
|
31
|
+
return import_api.SpanKind.CLIENT;
|
|
32
|
+
case "internal":
|
|
33
|
+
default:
|
|
34
|
+
return import_api.SpanKind.INTERNAL;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
28
37
|
var ActiveTracingHelper = class {
|
|
29
38
|
constructor({ traceMiddleware }) {
|
|
30
39
|
this.traceMiddleware = traceMiddleware;
|
|
@@ -42,6 +51,7 @@ var ActiveTracingHelper = class {
|
|
|
42
51
|
createEngineSpan(engineSpanEvent) {
|
|
43
52
|
const tracer = import_api.trace.getTracer("prisma");
|
|
44
53
|
engineSpanEvent.spans.forEach((engineSpan) => {
|
|
54
|
+
const spanKind = engineSpanKindToOTELSpanKind(engineSpan.kind);
|
|
45
55
|
const spanContext = {
|
|
46
56
|
traceId: engineSpan.trace_id,
|
|
47
57
|
spanId: engineSpan.span_id,
|
|
@@ -61,7 +71,7 @@ var ActiveTracingHelper = class {
|
|
|
61
71
|
import_api.ROOT_CONTEXT,
|
|
62
72
|
engineSpan.name,
|
|
63
73
|
spanContext,
|
|
64
|
-
|
|
74
|
+
spanKind,
|
|
65
75
|
engineSpan.parent_span_id,
|
|
66
76
|
links,
|
|
67
77
|
engineSpan.start_time
|
|
@@ -16,20 +16,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_QOJUVGZL_exports = {};
|
|
20
|
+
__export(chunk_QOJUVGZL_exports, {
|
|
21
21
|
GLOBAL_KEY: () => GLOBAL_KEY,
|
|
22
22
|
MODULE_NAME: () => MODULE_NAME,
|
|
23
23
|
NAME: () => NAME,
|
|
24
24
|
VERSION: () => VERSION
|
|
25
25
|
});
|
|
26
|
-
module.exports = __toCommonJS(
|
|
26
|
+
module.exports = __toCommonJS(chunk_QOJUVGZL_exports);
|
|
27
27
|
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
|
28
28
|
var require_package = (0, import_chunk_FTA5RKYX.__commonJS)({
|
|
29
29
|
"package.json"(exports, module2) {
|
|
30
30
|
module2.exports = {
|
|
31
31
|
name: "@prisma/instrumentation",
|
|
32
|
-
version: "5.22.0-dev.
|
|
32
|
+
version: "5.22.0-dev.6",
|
|
33
33
|
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
34
34
|
main: "dist/index.js",
|
|
35
35
|
types: "dist/index.d.ts",
|
|
@@ -16,12 +16,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_YIAJHTIL_exports = {};
|
|
20
|
+
__export(chunk_YIAJHTIL_exports, {
|
|
21
21
|
PrismaInstrumentation: () => PrismaInstrumentation
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_YIAJHTIL_exports);
|
|
24
|
+
var import_chunk_O7OBHTYQ = require("./chunk-O7OBHTYQ.js");
|
|
25
25
|
var import_chunk_KSVJP65B = require("./chunk-KSVJP65B.js");
|
|
26
26
|
var import_instrumentation = require("@opentelemetry/instrumentation");
|
|
27
27
|
var PrismaInstrumentation = class extends import_instrumentation.InstrumentationBase {
|
|
@@ -35,7 +35,7 @@ var PrismaInstrumentation = class extends import_instrumentation.Instrumentation
|
|
|
35
35
|
enable() {
|
|
36
36
|
const config = this._config;
|
|
37
37
|
const globalValue = {
|
|
38
|
-
helper: new
|
|
38
|
+
helper: new import_chunk_O7OBHTYQ.ActiveTracingHelper({ traceMiddleware: config.middleware ?? false })
|
|
39
39
|
};
|
|
40
40
|
global[import_chunk_KSVJP65B.GLOBAL_KEY] = globalValue;
|
|
41
41
|
}
|
package/dist/constants.js
CHANGED
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var constants_exports = {};
|
|
20
20
|
__export(constants_exports, {
|
|
21
|
-
GLOBAL_KEY: () =>
|
|
22
|
-
MODULE_NAME: () =>
|
|
23
|
-
NAME: () =>
|
|
24
|
-
VERSION: () =>
|
|
21
|
+
GLOBAL_KEY: () => import_chunk_QOJUVGZL.GLOBAL_KEY,
|
|
22
|
+
MODULE_NAME: () => import_chunk_QOJUVGZL.MODULE_NAME,
|
|
23
|
+
NAME: () => import_chunk_QOJUVGZL.NAME,
|
|
24
|
+
VERSION: () => import_chunk_QOJUVGZL.VERSION
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(constants_exports);
|
|
27
|
-
var
|
|
27
|
+
var import_chunk_QOJUVGZL = require("./chunk-QOJUVGZL.js");
|
|
28
28
|
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
package/dist/index.js
CHANGED
|
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var dist_exports = {};
|
|
20
20
|
__export(dist_exports, {
|
|
21
|
-
PrismaInstrumentation: () =>
|
|
21
|
+
PrismaInstrumentation: () => import_chunk_GP42UUXC.PrismaInstrumentation
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(dist_exports);
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
var import_chunk_GP42UUXC = require("./chunk-GP42UUXC.js");
|
|
25
|
+
var import_chunk_O7OBHTYQ = require("./chunk-O7OBHTYQ.js");
|
|
26
|
+
var import_chunk_QOJUVGZL = require("./chunk-QOJUVGZL.js");
|
|
27
27
|
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/instrumentation",
|
|
3
|
-
"version": "5.22.0-dev.
|
|
3
|
+
"version": "5.22.0-dev.6",
|
|
4
4
|
"description": "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"jest": "29.7.0",
|
|
20
20
|
"jest-junit": "16.0.0",
|
|
21
21
|
"typescript": "5.4.5",
|
|
22
|
-
"@prisma/internals": "5.22.0-dev.
|
|
22
|
+
"@prisma/internals": "5.22.0-dev.6"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@opentelemetry/api": "^1.8",
|