@prisma/instrumentation 6.14.0-dev.13 → 6.14.0-dev.15
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/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -43,11 +43,9 @@ function engineSpanKindToOtelSpanKind(engineSpanKind) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
var ActiveTracingHelper = class {
|
|
46
|
-
traceMiddleware;
|
|
47
46
|
tracerProvider;
|
|
48
47
|
ignoreSpanTypes;
|
|
49
|
-
constructor({
|
|
50
|
-
this.traceMiddleware = traceMiddleware;
|
|
48
|
+
constructor({ tracerProvider, ignoreSpanTypes }) {
|
|
51
49
|
this.tracerProvider = tracerProvider;
|
|
52
50
|
this.ignoreSpanTypes = ignoreSpanTypes;
|
|
53
51
|
}
|
|
@@ -79,9 +77,6 @@ var ActiveTracingHelper = class {
|
|
|
79
77
|
if (options.internal && !showAllTraces) {
|
|
80
78
|
return callback();
|
|
81
79
|
}
|
|
82
|
-
if (options.middleware && !this.traceMiddleware) {
|
|
83
|
-
return callback();
|
|
84
|
-
}
|
|
85
80
|
const tracer = this.tracerProvider.getTracer("prisma");
|
|
86
81
|
const context = options.context ?? this.getActiveContext();
|
|
87
82
|
const name = `prisma:client:${options.name}`;
|
|
@@ -156,7 +151,7 @@ function shouldIgnoreSpan(spanName, ignoreSpanTypes) {
|
|
|
156
151
|
// package.json
|
|
157
152
|
var package_default = {
|
|
158
153
|
name: "@prisma/instrumentation",
|
|
159
|
-
version: "6.14.0-dev.
|
|
154
|
+
version: "6.14.0-dev.15",
|
|
160
155
|
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
161
156
|
main: "dist/index.js",
|
|
162
157
|
module: "dist/index.mjs",
|
|
@@ -240,7 +235,6 @@ var PrismaInstrumentation = class extends import_instrumentation.Instrumentation
|
|
|
240
235
|
const config = this._config;
|
|
241
236
|
const globalValue = {
|
|
242
237
|
helper: new ActiveTracingHelper({
|
|
243
|
-
traceMiddleware: config.middleware ?? false,
|
|
244
238
|
tracerProvider: this.tracerProvider ?? import_api2.trace.getTracerProvider(),
|
|
245
239
|
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
246
240
|
})
|
package/dist/index.mjs
CHANGED
|
@@ -23,11 +23,9 @@ function engineSpanKindToOtelSpanKind(engineSpanKind) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
var ActiveTracingHelper = class {
|
|
26
|
-
traceMiddleware;
|
|
27
26
|
tracerProvider;
|
|
28
27
|
ignoreSpanTypes;
|
|
29
|
-
constructor({
|
|
30
|
-
this.traceMiddleware = traceMiddleware;
|
|
28
|
+
constructor({ tracerProvider, ignoreSpanTypes }) {
|
|
31
29
|
this.tracerProvider = tracerProvider;
|
|
32
30
|
this.ignoreSpanTypes = ignoreSpanTypes;
|
|
33
31
|
}
|
|
@@ -59,9 +57,6 @@ var ActiveTracingHelper = class {
|
|
|
59
57
|
if (options.internal && !showAllTraces) {
|
|
60
58
|
return callback();
|
|
61
59
|
}
|
|
62
|
-
if (options.middleware && !this.traceMiddleware) {
|
|
63
|
-
return callback();
|
|
64
|
-
}
|
|
65
60
|
const tracer = this.tracerProvider.getTracer("prisma");
|
|
66
61
|
const context = options.context ?? this.getActiveContext();
|
|
67
62
|
const name = `prisma:client:${options.name}`;
|
|
@@ -136,7 +131,7 @@ function shouldIgnoreSpan(spanName, ignoreSpanTypes) {
|
|
|
136
131
|
// package.json
|
|
137
132
|
var package_default = {
|
|
138
133
|
name: "@prisma/instrumentation",
|
|
139
|
-
version: "6.14.0-dev.
|
|
134
|
+
version: "6.14.0-dev.15",
|
|
140
135
|
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
141
136
|
main: "dist/index.js",
|
|
142
137
|
module: "dist/index.mjs",
|
|
@@ -220,7 +215,6 @@ var PrismaInstrumentation = class extends InstrumentationBase {
|
|
|
220
215
|
const config = this._config;
|
|
221
216
|
const globalValue = {
|
|
222
217
|
helper: new ActiveTracingHelper({
|
|
223
|
-
traceMiddleware: config.middleware ?? false,
|
|
224
218
|
tracerProvider: this.tracerProvider ?? trace2.getTracerProvider(),
|
|
225
219
|
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
226
220
|
})
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Context, TracerProvider } from '@opentelemetry/api';
|
|
2
2
|
import { EngineSpan, ExtendedSpanOptions, SpanCallback, TracingHelper } from '@prisma/internals';
|
|
3
3
|
type Options = {
|
|
4
|
-
traceMiddleware: boolean;
|
|
5
4
|
tracerProvider: TracerProvider;
|
|
6
5
|
ignoreSpanTypes: (string | RegExp)[];
|
|
7
6
|
};
|
|
8
7
|
export declare class ActiveTracingHelper implements TracingHelper {
|
|
9
|
-
private traceMiddleware;
|
|
10
8
|
private tracerProvider;
|
|
11
9
|
private ignoreSpanTypes;
|
|
12
|
-
constructor({
|
|
10
|
+
constructor({ tracerProvider, ignoreSpanTypes }: Options);
|
|
13
11
|
isEnabled(): boolean;
|
|
14
12
|
getTraceParent(context?: Context | undefined): string;
|
|
15
13
|
dispatchEngineSpans(spans: EngineSpan[]): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TracerProvider } from '@opentelemetry/api';
|
|
2
2
|
import { InstrumentationBase, InstrumentationConfig, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
3
3
|
export interface PrismaInstrumentationConfig {
|
|
4
|
-
middleware?: boolean;
|
|
5
4
|
ignoreSpanTypes?: (string | RegExp)[];
|
|
6
5
|
}
|
|
7
6
|
type Config = PrismaInstrumentationConfig & InstrumentationConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/instrumentation",
|
|
3
|
-
"version": "6.14.0-dev.
|
|
3
|
+
"version": "6.14.0-dev.15",
|
|
4
4
|
"description": "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"jest": "29.7.0",
|
|
34
34
|
"jest-junit": "16.0.0",
|
|
35
35
|
"typescript": "5.4.5",
|
|
36
|
-
"@prisma/internals": "6.14.0-dev.
|
|
36
|
+
"@prisma/internals": "6.14.0-dev.15"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"
|