@prisma/instrumentation 6.7.0-dev.5 → 6.7.0-dev.51
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 +26 -0
- package/dist/index.d.ts +26 -2
- package/dist/index.js +243 -6
- package/dist/{chunk-LJTRIVKN.js → index.mjs} +128 -28
- package/dist/src/index.d.ts +2 -0
- package/package.json +15 -2
- package/dist/ActiveTracingHelper.js +0 -25
- package/dist/PrismaInstrumentation.js +0 -27
- package/dist/chunk-ETZX4C2R.js +0 -59
- package/dist/chunk-FTA5RKYX.js +0 -27
- package/dist/chunk-GT7XQI2M.js +0 -86
- package/dist/chunk-HCTXLVRZ.js +0 -59
- package/dist/chunk-Z7DYYWMV.js +0 -86
- package/dist/constants.js +0 -29
- /package/dist/{ActiveTracingHelper.d.ts → src/ActiveTracingHelper.d.ts} +0 -0
- /package/dist/{PrismaInstrumentation.d.ts → src/PrismaInstrumentation.d.ts} +0 -0
- /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InstrumentationBase } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
3
|
+
import { InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
4
|
+
import { registerInstrumentations } from '@opentelemetry/instrumentation';
|
|
5
|
+
import { TracerProvider } from '@opentelemetry/api';
|
|
6
|
+
|
|
7
|
+
declare type Config = PrismaInstrumentationConfig & InstrumentationConfig;
|
|
8
|
+
|
|
9
|
+
export declare class PrismaInstrumentation extends InstrumentationBase {
|
|
10
|
+
private tracerProvider;
|
|
11
|
+
constructor(config?: Config);
|
|
12
|
+
setTracerProvider(tracerProvider: TracerProvider): void;
|
|
13
|
+
init(): InstrumentationNodeModuleDefinition[];
|
|
14
|
+
enable(): void;
|
|
15
|
+
disable(): void;
|
|
16
|
+
isEnabled(): boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare interface PrismaInstrumentationConfig {
|
|
20
|
+
middleware?: boolean;
|
|
21
|
+
ignoreSpanTypes?: (string | RegExp)[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { registerInstrumentations }
|
|
25
|
+
|
|
26
|
+
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { InstrumentationBase } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
3
|
+
import { InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
4
|
+
import { registerInstrumentations } from '@opentelemetry/instrumentation';
|
|
5
|
+
import { TracerProvider } from '@opentelemetry/api';
|
|
6
|
+
|
|
7
|
+
declare type Config = PrismaInstrumentationConfig & InstrumentationConfig;
|
|
8
|
+
|
|
9
|
+
export declare class PrismaInstrumentation extends InstrumentationBase {
|
|
10
|
+
private tracerProvider;
|
|
11
|
+
constructor(config?: Config);
|
|
12
|
+
setTracerProvider(tracerProvider: TracerProvider): void;
|
|
13
|
+
init(): InstrumentationNodeModuleDefinition[];
|
|
14
|
+
enable(): void;
|
|
15
|
+
disable(): void;
|
|
16
|
+
isEnabled(): boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare interface PrismaInstrumentationConfig {
|
|
20
|
+
middleware?: boolean;
|
|
21
|
+
ignoreSpanTypes?: (string | RegExp)[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { registerInstrumentations }
|
|
25
|
+
|
|
26
|
+
export { }
|
package/dist/index.js
CHANGED
|
@@ -16,14 +16,251 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
19
21
|
var index_exports = {};
|
|
20
22
|
__export(index_exports, {
|
|
21
|
-
PrismaInstrumentation: () =>
|
|
22
|
-
registerInstrumentations: () =>
|
|
23
|
+
PrismaInstrumentation: () => PrismaInstrumentation,
|
|
24
|
+
registerInstrumentations: () => import_instrumentation2.registerInstrumentations
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(index_exports);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
|
27
|
+
|
|
28
|
+
// src/PrismaInstrumentation.ts
|
|
29
|
+
var import_api2 = require("@opentelemetry/api");
|
|
29
30
|
var import_instrumentation = require("@opentelemetry/instrumentation");
|
|
31
|
+
|
|
32
|
+
// src/ActiveTracingHelper.ts
|
|
33
|
+
var import_api = require("@opentelemetry/api");
|
|
34
|
+
var showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true";
|
|
35
|
+
var nonSampledTraceParent = `00-10-10-00`;
|
|
36
|
+
function engineSpanKindToOtelSpanKind(engineSpanKind) {
|
|
37
|
+
switch (engineSpanKind) {
|
|
38
|
+
case "client":
|
|
39
|
+
return import_api.SpanKind.CLIENT;
|
|
40
|
+
case "internal":
|
|
41
|
+
default:
|
|
42
|
+
return import_api.SpanKind.INTERNAL;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
var ActiveTracingHelper = class {
|
|
46
|
+
traceMiddleware;
|
|
47
|
+
tracerProvider;
|
|
48
|
+
ignoreSpanTypes;
|
|
49
|
+
constructor({ traceMiddleware, tracerProvider, ignoreSpanTypes }) {
|
|
50
|
+
this.traceMiddleware = traceMiddleware;
|
|
51
|
+
this.tracerProvider = tracerProvider;
|
|
52
|
+
this.ignoreSpanTypes = ignoreSpanTypes;
|
|
53
|
+
}
|
|
54
|
+
isEnabled() {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
getTraceParent(context) {
|
|
58
|
+
const span = import_api.trace.getSpanContext(context ?? import_api.context.active());
|
|
59
|
+
if (span) {
|
|
60
|
+
return `00-${span.traceId}-${span.spanId}-0${span.traceFlags}`;
|
|
61
|
+
}
|
|
62
|
+
return nonSampledTraceParent;
|
|
63
|
+
}
|
|
64
|
+
dispatchEngineSpans(spans) {
|
|
65
|
+
const tracer = this.tracerProvider.getTracer("prisma");
|
|
66
|
+
const linkIds = /* @__PURE__ */ new Map();
|
|
67
|
+
const roots = spans.filter((span) => span.parentId === null);
|
|
68
|
+
for (const root of roots) {
|
|
69
|
+
dispatchEngineSpan(tracer, root, spans, linkIds, this.ignoreSpanTypes);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
getActiveContext() {
|
|
73
|
+
return import_api.context.active();
|
|
74
|
+
}
|
|
75
|
+
runInChildSpan(options, callback) {
|
|
76
|
+
if (typeof options === "string") {
|
|
77
|
+
options = { name: options };
|
|
78
|
+
}
|
|
79
|
+
if (options.internal && !showAllTraces) {
|
|
80
|
+
return callback();
|
|
81
|
+
}
|
|
82
|
+
if (options.middleware && !this.traceMiddleware) {
|
|
83
|
+
return callback();
|
|
84
|
+
}
|
|
85
|
+
const tracer = this.tracerProvider.getTracer("prisma");
|
|
86
|
+
const context = options.context ?? this.getActiveContext();
|
|
87
|
+
const name = `prisma:client:${options.name}`;
|
|
88
|
+
if (shouldIgnoreSpan(name, this.ignoreSpanTypes)) {
|
|
89
|
+
return callback();
|
|
90
|
+
}
|
|
91
|
+
if (options.active === false) {
|
|
92
|
+
const span = tracer.startSpan(name, options, context);
|
|
93
|
+
return endSpan(span, callback(span, context));
|
|
94
|
+
}
|
|
95
|
+
return tracer.startActiveSpan(name, options, (span) => endSpan(span, callback(span, context)));
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
function dispatchEngineSpan(tracer, engineSpan, allSpans, linkIds, ignoreSpanTypes) {
|
|
99
|
+
if (shouldIgnoreSpan(engineSpan.name, ignoreSpanTypes)) return;
|
|
100
|
+
const spanOptions = {
|
|
101
|
+
attributes: engineSpan.attributes,
|
|
102
|
+
kind: engineSpanKindToOtelSpanKind(engineSpan.kind),
|
|
103
|
+
startTime: engineSpan.startTime
|
|
104
|
+
};
|
|
105
|
+
tracer.startActiveSpan(engineSpan.name, spanOptions, (span) => {
|
|
106
|
+
linkIds.set(engineSpan.id, span.spanContext().spanId);
|
|
107
|
+
if (engineSpan.links) {
|
|
108
|
+
span.addLinks(
|
|
109
|
+
engineSpan.links.flatMap((link) => {
|
|
110
|
+
const linkedId = linkIds.get(link);
|
|
111
|
+
if (!linkedId) {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
context: {
|
|
116
|
+
spanId: linkedId,
|
|
117
|
+
traceId: span.spanContext().traceId,
|
|
118
|
+
traceFlags: span.spanContext().traceFlags
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
})
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
const children = allSpans.filter((s) => s.parentId === engineSpan.id);
|
|
125
|
+
for (const child of children) {
|
|
126
|
+
dispatchEngineSpan(tracer, child, allSpans, linkIds, ignoreSpanTypes);
|
|
127
|
+
}
|
|
128
|
+
span.end(engineSpan.endTime);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function endSpan(span, result) {
|
|
132
|
+
if (isPromiseLike(result)) {
|
|
133
|
+
return result.then(
|
|
134
|
+
(value) => {
|
|
135
|
+
span.end();
|
|
136
|
+
return value;
|
|
137
|
+
},
|
|
138
|
+
(reason) => {
|
|
139
|
+
span.end();
|
|
140
|
+
throw reason;
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
span.end();
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
function isPromiseLike(value) {
|
|
148
|
+
return value != null && typeof value["then"] === "function";
|
|
149
|
+
}
|
|
150
|
+
function shouldIgnoreSpan(spanName, ignoreSpanTypes) {
|
|
151
|
+
return ignoreSpanTypes.some(
|
|
152
|
+
(pattern) => typeof pattern === "string" ? pattern === spanName : pattern.test(spanName)
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// package.json
|
|
157
|
+
var package_default = {
|
|
158
|
+
name: "@prisma/instrumentation",
|
|
159
|
+
version: "6.7.0-dev.51",
|
|
160
|
+
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
161
|
+
main: "dist/index.js",
|
|
162
|
+
module: "dist/index.mjs",
|
|
163
|
+
types: "dist/index.d.ts",
|
|
164
|
+
exports: {
|
|
165
|
+
".": {
|
|
166
|
+
require: {
|
|
167
|
+
types: "./dist/index.d.ts",
|
|
168
|
+
default: "./dist/index.js"
|
|
169
|
+
},
|
|
170
|
+
import: {
|
|
171
|
+
types: "./dist/index.d.ts",
|
|
172
|
+
default: "./dist/index.mjs"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
license: "Apache-2.0",
|
|
177
|
+
homepage: "https://www.prisma.io",
|
|
178
|
+
repository: {
|
|
179
|
+
type: "git",
|
|
180
|
+
url: "https://github.com/prisma/prisma.git",
|
|
181
|
+
directory: "packages/instrumentation"
|
|
182
|
+
},
|
|
183
|
+
bugs: "https://github.com/prisma/prisma/issues",
|
|
184
|
+
devDependencies: {
|
|
185
|
+
"@prisma/internals": "workspace:*",
|
|
186
|
+
"@swc/core": "1.11.5",
|
|
187
|
+
"@types/jest": "29.5.14",
|
|
188
|
+
"@types/node": "18.19.76",
|
|
189
|
+
"@opentelemetry/api": "1.9.0",
|
|
190
|
+
jest: "29.7.0",
|
|
191
|
+
"jest-junit": "16.0.0",
|
|
192
|
+
typescript: "5.4.5"
|
|
193
|
+
},
|
|
194
|
+
dependencies: {
|
|
195
|
+
"@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"
|
|
196
|
+
},
|
|
197
|
+
peerDependencies: {
|
|
198
|
+
"@opentelemetry/api": "^1.8"
|
|
199
|
+
},
|
|
200
|
+
files: [
|
|
201
|
+
"dist"
|
|
202
|
+
],
|
|
203
|
+
keywords: [
|
|
204
|
+
"prisma",
|
|
205
|
+
"instrumentation",
|
|
206
|
+
"opentelemetry",
|
|
207
|
+
"otel"
|
|
208
|
+
],
|
|
209
|
+
scripts: {
|
|
210
|
+
dev: "DEV=true tsx helpers/build.ts",
|
|
211
|
+
build: "tsx helpers/build.ts",
|
|
212
|
+
prepublishOnly: "pnpm run build",
|
|
213
|
+
test: "jest"
|
|
214
|
+
},
|
|
215
|
+
sideEffects: false
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// src/constants.ts
|
|
219
|
+
var VERSION = package_default.version;
|
|
220
|
+
var majorVersion = VERSION.split(".")[0];
|
|
221
|
+
var GLOBAL_INSTRUMENTATION_ACCESSOR_KEY = "PRISMA_INSTRUMENTATION";
|
|
222
|
+
var GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
223
|
+
var NAME = package_default.name;
|
|
224
|
+
var MODULE_NAME = "@prisma/client";
|
|
225
|
+
|
|
226
|
+
// src/PrismaInstrumentation.ts
|
|
227
|
+
var PrismaInstrumentation = class extends import_instrumentation.InstrumentationBase {
|
|
228
|
+
tracerProvider;
|
|
229
|
+
constructor(config = {}) {
|
|
230
|
+
super(NAME, VERSION, config);
|
|
231
|
+
}
|
|
232
|
+
setTracerProvider(tracerProvider) {
|
|
233
|
+
this.tracerProvider = tracerProvider;
|
|
234
|
+
}
|
|
235
|
+
init() {
|
|
236
|
+
const module2 = new import_instrumentation.InstrumentationNodeModuleDefinition(MODULE_NAME, [VERSION]);
|
|
237
|
+
return [module2];
|
|
238
|
+
}
|
|
239
|
+
enable() {
|
|
240
|
+
const config = this._config;
|
|
241
|
+
const globalValue = {
|
|
242
|
+
helper: new ActiveTracingHelper({
|
|
243
|
+
traceMiddleware: config.middleware ?? false,
|
|
244
|
+
tracerProvider: this.tracerProvider ?? import_api2.trace.getTracerProvider(),
|
|
245
|
+
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
246
|
+
})
|
|
247
|
+
};
|
|
248
|
+
global[GLOBAL_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
249
|
+
global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
250
|
+
}
|
|
251
|
+
disable() {
|
|
252
|
+
delete global[GLOBAL_INSTRUMENTATION_ACCESSOR_KEY];
|
|
253
|
+
delete global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY];
|
|
254
|
+
}
|
|
255
|
+
isEnabled() {
|
|
256
|
+
return Boolean(global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY]);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// src/index.ts
|
|
261
|
+
var import_instrumentation2 = require("@opentelemetry/instrumentation");
|
|
262
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
263
|
+
0 && (module.exports = {
|
|
264
|
+
PrismaInstrumentation,
|
|
265
|
+
registerInstrumentations
|
|
266
|
+
});
|
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_LJTRIVKN_exports = {};
|
|
20
|
-
__export(chunk_LJTRIVKN_exports, {
|
|
21
|
-
ActiveTracingHelper: () => ActiveTracingHelper
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(chunk_LJTRIVKN_exports);
|
|
24
|
-
var import_api = require("@opentelemetry/api");
|
|
1
|
+
// src/PrismaInstrumentation.ts
|
|
2
|
+
import { trace as trace2 } from "@opentelemetry/api";
|
|
3
|
+
import {
|
|
4
|
+
InstrumentationBase,
|
|
5
|
+
InstrumentationNodeModuleDefinition
|
|
6
|
+
} from "@opentelemetry/instrumentation";
|
|
7
|
+
|
|
8
|
+
// src/ActiveTracingHelper.ts
|
|
9
|
+
import {
|
|
10
|
+
context as _context,
|
|
11
|
+
SpanKind,
|
|
12
|
+
trace
|
|
13
|
+
} from "@opentelemetry/api";
|
|
25
14
|
var showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true";
|
|
26
15
|
var nonSampledTraceParent = `00-10-10-00`;
|
|
27
16
|
function engineSpanKindToOtelSpanKind(engineSpanKind) {
|
|
28
17
|
switch (engineSpanKind) {
|
|
29
18
|
case "client":
|
|
30
|
-
return
|
|
19
|
+
return SpanKind.CLIENT;
|
|
31
20
|
case "internal":
|
|
32
21
|
default:
|
|
33
|
-
return
|
|
22
|
+
return SpanKind.INTERNAL;
|
|
34
23
|
}
|
|
35
24
|
}
|
|
36
25
|
var ActiveTracingHelper = class {
|
|
@@ -46,7 +35,7 @@ var ActiveTracingHelper = class {
|
|
|
46
35
|
return true;
|
|
47
36
|
}
|
|
48
37
|
getTraceParent(context) {
|
|
49
|
-
const span =
|
|
38
|
+
const span = trace.getSpanContext(context ?? _context.active());
|
|
50
39
|
if (span) {
|
|
51
40
|
return `00-${span.traceId}-${span.spanId}-0${span.traceFlags}`;
|
|
52
41
|
}
|
|
@@ -61,7 +50,7 @@ var ActiveTracingHelper = class {
|
|
|
61
50
|
}
|
|
62
51
|
}
|
|
63
52
|
getActiveContext() {
|
|
64
|
-
return
|
|
53
|
+
return _context.active();
|
|
65
54
|
}
|
|
66
55
|
runInChildSpan(options, callback) {
|
|
67
56
|
if (typeof options === "string") {
|
|
@@ -143,3 +132,114 @@ function shouldIgnoreSpan(spanName, ignoreSpanTypes) {
|
|
|
143
132
|
(pattern) => typeof pattern === "string" ? pattern === spanName : pattern.test(spanName)
|
|
144
133
|
);
|
|
145
134
|
}
|
|
135
|
+
|
|
136
|
+
// package.json
|
|
137
|
+
var package_default = {
|
|
138
|
+
name: "@prisma/instrumentation",
|
|
139
|
+
version: "6.7.0-dev.51",
|
|
140
|
+
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
141
|
+
main: "dist/index.js",
|
|
142
|
+
module: "dist/index.mjs",
|
|
143
|
+
types: "dist/index.d.ts",
|
|
144
|
+
exports: {
|
|
145
|
+
".": {
|
|
146
|
+
require: {
|
|
147
|
+
types: "./dist/index.d.ts",
|
|
148
|
+
default: "./dist/index.js"
|
|
149
|
+
},
|
|
150
|
+
import: {
|
|
151
|
+
types: "./dist/index.d.ts",
|
|
152
|
+
default: "./dist/index.mjs"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
license: "Apache-2.0",
|
|
157
|
+
homepage: "https://www.prisma.io",
|
|
158
|
+
repository: {
|
|
159
|
+
type: "git",
|
|
160
|
+
url: "https://github.com/prisma/prisma.git",
|
|
161
|
+
directory: "packages/instrumentation"
|
|
162
|
+
},
|
|
163
|
+
bugs: "https://github.com/prisma/prisma/issues",
|
|
164
|
+
devDependencies: {
|
|
165
|
+
"@prisma/internals": "workspace:*",
|
|
166
|
+
"@swc/core": "1.11.5",
|
|
167
|
+
"@types/jest": "29.5.14",
|
|
168
|
+
"@types/node": "18.19.76",
|
|
169
|
+
"@opentelemetry/api": "1.9.0",
|
|
170
|
+
jest: "29.7.0",
|
|
171
|
+
"jest-junit": "16.0.0",
|
|
172
|
+
typescript: "5.4.5"
|
|
173
|
+
},
|
|
174
|
+
dependencies: {
|
|
175
|
+
"@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"
|
|
176
|
+
},
|
|
177
|
+
peerDependencies: {
|
|
178
|
+
"@opentelemetry/api": "^1.8"
|
|
179
|
+
},
|
|
180
|
+
files: [
|
|
181
|
+
"dist"
|
|
182
|
+
],
|
|
183
|
+
keywords: [
|
|
184
|
+
"prisma",
|
|
185
|
+
"instrumentation",
|
|
186
|
+
"opentelemetry",
|
|
187
|
+
"otel"
|
|
188
|
+
],
|
|
189
|
+
scripts: {
|
|
190
|
+
dev: "DEV=true tsx helpers/build.ts",
|
|
191
|
+
build: "tsx helpers/build.ts",
|
|
192
|
+
prepublishOnly: "pnpm run build",
|
|
193
|
+
test: "jest"
|
|
194
|
+
},
|
|
195
|
+
sideEffects: false
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// src/constants.ts
|
|
199
|
+
var VERSION = package_default.version;
|
|
200
|
+
var majorVersion = VERSION.split(".")[0];
|
|
201
|
+
var GLOBAL_INSTRUMENTATION_ACCESSOR_KEY = "PRISMA_INSTRUMENTATION";
|
|
202
|
+
var GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
203
|
+
var NAME = package_default.name;
|
|
204
|
+
var MODULE_NAME = "@prisma/client";
|
|
205
|
+
|
|
206
|
+
// src/PrismaInstrumentation.ts
|
|
207
|
+
var PrismaInstrumentation = class extends InstrumentationBase {
|
|
208
|
+
tracerProvider;
|
|
209
|
+
constructor(config = {}) {
|
|
210
|
+
super(NAME, VERSION, config);
|
|
211
|
+
}
|
|
212
|
+
setTracerProvider(tracerProvider) {
|
|
213
|
+
this.tracerProvider = tracerProvider;
|
|
214
|
+
}
|
|
215
|
+
init() {
|
|
216
|
+
const module = new InstrumentationNodeModuleDefinition(MODULE_NAME, [VERSION]);
|
|
217
|
+
return [module];
|
|
218
|
+
}
|
|
219
|
+
enable() {
|
|
220
|
+
const config = this._config;
|
|
221
|
+
const globalValue = {
|
|
222
|
+
helper: new ActiveTracingHelper({
|
|
223
|
+
traceMiddleware: config.middleware ?? false,
|
|
224
|
+
tracerProvider: this.tracerProvider ?? trace2.getTracerProvider(),
|
|
225
|
+
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
226
|
+
})
|
|
227
|
+
};
|
|
228
|
+
global[GLOBAL_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
229
|
+
global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
230
|
+
}
|
|
231
|
+
disable() {
|
|
232
|
+
delete global[GLOBAL_INSTRUMENTATION_ACCESSOR_KEY];
|
|
233
|
+
delete global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY];
|
|
234
|
+
}
|
|
235
|
+
isEnabled() {
|
|
236
|
+
return Boolean(global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY]);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// src/index.ts
|
|
241
|
+
import { registerInstrumentations } from "@opentelemetry/instrumentation";
|
|
242
|
+
export {
|
|
243
|
+
PrismaInstrumentation,
|
|
244
|
+
registerInstrumentations
|
|
245
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/instrumentation",
|
|
3
|
-
"version": "6.7.0-dev.
|
|
3
|
+
"version": "6.7.0-dev.51",
|
|
4
4
|
"description": "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"import": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.mjs"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
7
20
|
"license": "Apache-2.0",
|
|
8
21
|
"homepage": "https://www.prisma.io",
|
|
9
22
|
"repository": {
|
|
@@ -20,7 +33,7 @@
|
|
|
20
33
|
"jest": "29.7.0",
|
|
21
34
|
"jest-junit": "16.0.0",
|
|
22
35
|
"typescript": "5.4.5",
|
|
23
|
-
"@prisma/internals": "6.7.0-dev.
|
|
36
|
+
"@prisma/internals": "6.7.0-dev.51"
|
|
24
37
|
},
|
|
25
38
|
"dependencies": {
|
|
26
39
|
"@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var ActiveTracingHelper_exports = {};
|
|
20
|
-
__export(ActiveTracingHelper_exports, {
|
|
21
|
-
ActiveTracingHelper: () => import_chunk_LJTRIVKN.ActiveTracingHelper
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(ActiveTracingHelper_exports);
|
|
24
|
-
var import_chunk_LJTRIVKN = require("./chunk-LJTRIVKN.js");
|
|
25
|
-
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var PrismaInstrumentation_exports = {};
|
|
20
|
-
__export(PrismaInstrumentation_exports, {
|
|
21
|
-
PrismaInstrumentation: () => import_chunk_ETZX4C2R.PrismaInstrumentation
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(PrismaInstrumentation_exports);
|
|
24
|
-
var import_chunk_ETZX4C2R = require("./chunk-ETZX4C2R.js");
|
|
25
|
-
var import_chunk_LJTRIVKN = require("./chunk-LJTRIVKN.js");
|
|
26
|
-
var import_chunk_Z7DYYWMV = require("./chunk-Z7DYYWMV.js");
|
|
27
|
-
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
package/dist/chunk-ETZX4C2R.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_ETZX4C2R_exports = {};
|
|
20
|
-
__export(chunk_ETZX4C2R_exports, {
|
|
21
|
-
PrismaInstrumentation: () => PrismaInstrumentation
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(chunk_ETZX4C2R_exports);
|
|
24
|
-
var import_chunk_LJTRIVKN = require("./chunk-LJTRIVKN.js");
|
|
25
|
-
var import_chunk_Z7DYYWMV = require("./chunk-Z7DYYWMV.js");
|
|
26
|
-
var import_api = require("@opentelemetry/api");
|
|
27
|
-
var import_instrumentation = require("@opentelemetry/instrumentation");
|
|
28
|
-
var PrismaInstrumentation = class extends import_instrumentation.InstrumentationBase {
|
|
29
|
-
tracerProvider;
|
|
30
|
-
constructor(config = {}) {
|
|
31
|
-
super(import_chunk_Z7DYYWMV.NAME, import_chunk_Z7DYYWMV.VERSION, config);
|
|
32
|
-
}
|
|
33
|
-
setTracerProvider(tracerProvider) {
|
|
34
|
-
this.tracerProvider = tracerProvider;
|
|
35
|
-
}
|
|
36
|
-
init() {
|
|
37
|
-
const module2 = new import_instrumentation.InstrumentationNodeModuleDefinition(import_chunk_Z7DYYWMV.MODULE_NAME, [import_chunk_Z7DYYWMV.VERSION]);
|
|
38
|
-
return [module2];
|
|
39
|
-
}
|
|
40
|
-
enable() {
|
|
41
|
-
const config = this._config;
|
|
42
|
-
const globalValue = {
|
|
43
|
-
helper: new import_chunk_LJTRIVKN.ActiveTracingHelper({
|
|
44
|
-
traceMiddleware: config.middleware ?? false,
|
|
45
|
-
tracerProvider: this.tracerProvider ?? import_api.trace.getTracerProvider(),
|
|
46
|
-
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
47
|
-
})
|
|
48
|
-
};
|
|
49
|
-
global[import_chunk_Z7DYYWMV.GLOBAL_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
50
|
-
global[import_chunk_Z7DYYWMV.GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
51
|
-
}
|
|
52
|
-
disable() {
|
|
53
|
-
delete global[import_chunk_Z7DYYWMV.GLOBAL_INSTRUMENTATION_ACCESSOR_KEY];
|
|
54
|
-
delete global[import_chunk_Z7DYYWMV.GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY];
|
|
55
|
-
}
|
|
56
|
-
isEnabled() {
|
|
57
|
-
return Boolean(global[import_chunk_Z7DYYWMV.GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY]);
|
|
58
|
-
}
|
|
59
|
-
};
|
package/dist/chunk-FTA5RKYX.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_FTA5RKYX_exports = {};
|
|
20
|
-
__export(chunk_FTA5RKYX_exports, {
|
|
21
|
-
__commonJS: () => __commonJS
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(chunk_FTA5RKYX_exports);
|
|
24
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
25
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
26
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
27
|
-
};
|
package/dist/chunk-GT7XQI2M.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name2 in all)
|
|
8
|
-
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_GT7XQI2M_exports = {};
|
|
20
|
-
__export(chunk_GT7XQI2M_exports, {
|
|
21
|
-
GLOBAL_INSTRUMENTATION_ACCESSOR_KEY: () => GLOBAL_INSTRUMENTATION_ACCESSOR_KEY,
|
|
22
|
-
GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY: () => GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY,
|
|
23
|
-
MODULE_NAME: () => MODULE_NAME,
|
|
24
|
-
NAME: () => NAME,
|
|
25
|
-
VERSION: () => VERSION
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(chunk_GT7XQI2M_exports);
|
|
28
|
-
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
|
29
|
-
var require_package = (0, import_chunk_FTA5RKYX.__commonJS)({
|
|
30
|
-
"package.json"(exports, module2) {
|
|
31
|
-
module2.exports = {
|
|
32
|
-
name: "@prisma/instrumentation",
|
|
33
|
-
version: "0.0.0",
|
|
34
|
-
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
35
|
-
main: "dist/index.js",
|
|
36
|
-
types: "dist/index.d.ts",
|
|
37
|
-
license: "Apache-2.0",
|
|
38
|
-
homepage: "https://www.prisma.io",
|
|
39
|
-
repository: {
|
|
40
|
-
type: "git",
|
|
41
|
-
url: "https://github.com/prisma/prisma.git",
|
|
42
|
-
directory: "packages/instrumentation"
|
|
43
|
-
},
|
|
44
|
-
bugs: "https://github.com/prisma/prisma/issues",
|
|
45
|
-
devDependencies: {
|
|
46
|
-
"@prisma/internals": "workspace:*",
|
|
47
|
-
"@swc/core": "1.11.5",
|
|
48
|
-
"@types/jest": "29.5.14",
|
|
49
|
-
"@types/node": "18.19.76",
|
|
50
|
-
"@opentelemetry/api": "1.9.0",
|
|
51
|
-
jest: "29.7.0",
|
|
52
|
-
"jest-junit": "16.0.0",
|
|
53
|
-
typescript: "5.4.5"
|
|
54
|
-
},
|
|
55
|
-
dependencies: {
|
|
56
|
-
"@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"
|
|
57
|
-
},
|
|
58
|
-
peerDependencies: {
|
|
59
|
-
"@opentelemetry/api": "^1.8"
|
|
60
|
-
},
|
|
61
|
-
files: [
|
|
62
|
-
"dist"
|
|
63
|
-
],
|
|
64
|
-
keywords: [
|
|
65
|
-
"prisma",
|
|
66
|
-
"instrumentation",
|
|
67
|
-
"opentelemetry",
|
|
68
|
-
"otel"
|
|
69
|
-
],
|
|
70
|
-
scripts: {
|
|
71
|
-
dev: "DEV=true tsx helpers/build.ts",
|
|
72
|
-
build: "tsx helpers/build.ts",
|
|
73
|
-
prepublishOnly: "pnpm run build",
|
|
74
|
-
test: "jest"
|
|
75
|
-
},
|
|
76
|
-
sideEffects: false
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
var { version, name } = require_package();
|
|
81
|
-
var majorVersion = version.split(".")[0];
|
|
82
|
-
var VERSION = version;
|
|
83
|
-
var GLOBAL_INSTRUMENTATION_ACCESSOR_KEY = "PRISMA_INSTRUMENTATION";
|
|
84
|
-
var GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
85
|
-
var NAME = name;
|
|
86
|
-
var MODULE_NAME = "@prisma/client";
|
package/dist/chunk-HCTXLVRZ.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_HCTXLVRZ_exports = {};
|
|
20
|
-
__export(chunk_HCTXLVRZ_exports, {
|
|
21
|
-
PrismaInstrumentation: () => PrismaInstrumentation
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(chunk_HCTXLVRZ_exports);
|
|
24
|
-
var import_chunk_LJTRIVKN = require("./chunk-LJTRIVKN.js");
|
|
25
|
-
var import_chunk_GT7XQI2M = require("./chunk-GT7XQI2M.js");
|
|
26
|
-
var import_api = require("@opentelemetry/api");
|
|
27
|
-
var import_instrumentation = require("@opentelemetry/instrumentation");
|
|
28
|
-
var PrismaInstrumentation = class extends import_instrumentation.InstrumentationBase {
|
|
29
|
-
tracerProvider;
|
|
30
|
-
constructor(config = {}) {
|
|
31
|
-
super(import_chunk_GT7XQI2M.NAME, import_chunk_GT7XQI2M.VERSION, config);
|
|
32
|
-
}
|
|
33
|
-
setTracerProvider(tracerProvider) {
|
|
34
|
-
this.tracerProvider = tracerProvider;
|
|
35
|
-
}
|
|
36
|
-
init() {
|
|
37
|
-
const module2 = new import_instrumentation.InstrumentationNodeModuleDefinition(import_chunk_GT7XQI2M.MODULE_NAME, [import_chunk_GT7XQI2M.VERSION]);
|
|
38
|
-
return [module2];
|
|
39
|
-
}
|
|
40
|
-
enable() {
|
|
41
|
-
const config = this._config;
|
|
42
|
-
const globalValue = {
|
|
43
|
-
helper: new import_chunk_LJTRIVKN.ActiveTracingHelper({
|
|
44
|
-
traceMiddleware: config.middleware ?? false,
|
|
45
|
-
tracerProvider: this.tracerProvider ?? import_api.trace.getTracerProvider(),
|
|
46
|
-
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
47
|
-
})
|
|
48
|
-
};
|
|
49
|
-
global[import_chunk_GT7XQI2M.GLOBAL_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
50
|
-
global[import_chunk_GT7XQI2M.GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
51
|
-
}
|
|
52
|
-
disable() {
|
|
53
|
-
delete global[import_chunk_GT7XQI2M.GLOBAL_INSTRUMENTATION_ACCESSOR_KEY];
|
|
54
|
-
delete global[import_chunk_GT7XQI2M.GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY];
|
|
55
|
-
}
|
|
56
|
-
isEnabled() {
|
|
57
|
-
return Boolean(global[import_chunk_GT7XQI2M.GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY]);
|
|
58
|
-
}
|
|
59
|
-
};
|
package/dist/chunk-Z7DYYWMV.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name2 in all)
|
|
8
|
-
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_Z7DYYWMV_exports = {};
|
|
20
|
-
__export(chunk_Z7DYYWMV_exports, {
|
|
21
|
-
GLOBAL_INSTRUMENTATION_ACCESSOR_KEY: () => GLOBAL_INSTRUMENTATION_ACCESSOR_KEY,
|
|
22
|
-
GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY: () => GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY,
|
|
23
|
-
MODULE_NAME: () => MODULE_NAME,
|
|
24
|
-
NAME: () => NAME,
|
|
25
|
-
VERSION: () => VERSION
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(chunk_Z7DYYWMV_exports);
|
|
28
|
-
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
|
29
|
-
var require_package = (0, import_chunk_FTA5RKYX.__commonJS)({
|
|
30
|
-
"package.json"(exports, module2) {
|
|
31
|
-
module2.exports = {
|
|
32
|
-
name: "@prisma/instrumentation",
|
|
33
|
-
version: "6.7.0-dev.5",
|
|
34
|
-
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
35
|
-
main: "dist/index.js",
|
|
36
|
-
types: "dist/index.d.ts",
|
|
37
|
-
license: "Apache-2.0",
|
|
38
|
-
homepage: "https://www.prisma.io",
|
|
39
|
-
repository: {
|
|
40
|
-
type: "git",
|
|
41
|
-
url: "https://github.com/prisma/prisma.git",
|
|
42
|
-
directory: "packages/instrumentation"
|
|
43
|
-
},
|
|
44
|
-
bugs: "https://github.com/prisma/prisma/issues",
|
|
45
|
-
devDependencies: {
|
|
46
|
-
"@prisma/internals": "workspace:*",
|
|
47
|
-
"@swc/core": "1.11.5",
|
|
48
|
-
"@types/jest": "29.5.14",
|
|
49
|
-
"@types/node": "18.19.76",
|
|
50
|
-
"@opentelemetry/api": "1.9.0",
|
|
51
|
-
jest: "29.7.0",
|
|
52
|
-
"jest-junit": "16.0.0",
|
|
53
|
-
typescript: "5.4.5"
|
|
54
|
-
},
|
|
55
|
-
dependencies: {
|
|
56
|
-
"@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"
|
|
57
|
-
},
|
|
58
|
-
peerDependencies: {
|
|
59
|
-
"@opentelemetry/api": "^1.8"
|
|
60
|
-
},
|
|
61
|
-
files: [
|
|
62
|
-
"dist"
|
|
63
|
-
],
|
|
64
|
-
keywords: [
|
|
65
|
-
"prisma",
|
|
66
|
-
"instrumentation",
|
|
67
|
-
"opentelemetry",
|
|
68
|
-
"otel"
|
|
69
|
-
],
|
|
70
|
-
scripts: {
|
|
71
|
-
dev: "DEV=true tsx helpers/build.ts",
|
|
72
|
-
build: "tsx helpers/build.ts",
|
|
73
|
-
prepublishOnly: "pnpm run build",
|
|
74
|
-
test: "jest"
|
|
75
|
-
},
|
|
76
|
-
sideEffects: false
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
var { version, name } = require_package();
|
|
81
|
-
var majorVersion = version.split(".")[0];
|
|
82
|
-
var VERSION = version;
|
|
83
|
-
var GLOBAL_INSTRUMENTATION_ACCESSOR_KEY = "PRISMA_INSTRUMENTATION";
|
|
84
|
-
var GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
85
|
-
var NAME = name;
|
|
86
|
-
var MODULE_NAME = "@prisma/client";
|
package/dist/constants.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var constants_exports = {};
|
|
20
|
-
__export(constants_exports, {
|
|
21
|
-
GLOBAL_INSTRUMENTATION_ACCESSOR_KEY: () => import_chunk_Z7DYYWMV.GLOBAL_INSTRUMENTATION_ACCESSOR_KEY,
|
|
22
|
-
GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY: () => import_chunk_Z7DYYWMV.GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY,
|
|
23
|
-
MODULE_NAME: () => import_chunk_Z7DYYWMV.MODULE_NAME,
|
|
24
|
-
NAME: () => import_chunk_Z7DYYWMV.NAME,
|
|
25
|
-
VERSION: () => import_chunk_Z7DYYWMV.VERSION
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(constants_exports);
|
|
28
|
-
var import_chunk_Z7DYYWMV = require("./chunk-Z7DYYWMV.js");
|
|
29
|
-
var import_chunk_FTA5RKYX = require("./chunk-FTA5RKYX.js");
|
|
File without changes
|
|
File without changes
|
|
File without changes
|