@prisma/instrumentation 7.3.0-integration-prisma6-fix-cloudflare-engine.3 → 7.3.0-integration-engines-7-3-0-12-parameterization-844f54891f0a80ec1820fc26cf513002357e4245.1
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 +0 -11
- package/dist/index.js +79 -18
- package/dist/index.mjs +79 -18
- package/dist/src/ActiveTracingHelper.d.ts +1 -1
- package/dist/src/constants.d.ts +0 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
[OTEL - OpenTelemetry](https://opentelemetry.io/) compliant instrumentation for Prisma Client.
|
|
6
6
|
|
|
7
|
-
⚠️ **Warning**: This package is provided as part of the `tracing` Preview Feature
|
|
8
|
-
Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.
|
|
9
|
-
|
|
10
7
|
## Installing
|
|
11
8
|
|
|
12
9
|
```
|
|
@@ -24,14 +21,6 @@ registerInstrumentations({
|
|
|
24
21
|
})
|
|
25
22
|
```
|
|
26
23
|
|
|
27
|
-
Don't forget to set `previewFeatures`:
|
|
28
|
-
|
|
29
|
-
```prisma
|
|
30
|
-
generator client {
|
|
31
|
-
provider = "prisma-client-js"
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
24
|
## Jaeger
|
|
36
25
|
|
|
37
26
|
Exporting traces to [Jaeger Tracing](https://jaegertracing.io).
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,73 @@ module.exports = __toCommonJS(index_exports);
|
|
|
29
29
|
var import_api2 = require("@opentelemetry/api");
|
|
30
30
|
var import_instrumentation = require("@opentelemetry/instrumentation");
|
|
31
31
|
|
|
32
|
+
// ../instrumentation-contract/dist/index.mjs
|
|
33
|
+
var package_default = {
|
|
34
|
+
name: "@prisma/instrumentation-contract",
|
|
35
|
+
version: "7.3.0-integration-engines-7-3-0-12-parameterization-844f54891f0a80ec1820fc26cf513002357e4245.1",
|
|
36
|
+
description: "Shared types and utilities for Prisma instrumentation",
|
|
37
|
+
main: "dist/index.js",
|
|
38
|
+
module: "dist/index.mjs",
|
|
39
|
+
types: "dist/index.d.ts",
|
|
40
|
+
exports: {
|
|
41
|
+
".": {
|
|
42
|
+
require: {
|
|
43
|
+
types: "./dist/index.d.ts",
|
|
44
|
+
default: "./dist/index.js"
|
|
45
|
+
},
|
|
46
|
+
import: {
|
|
47
|
+
types: "./dist/index.d.mts",
|
|
48
|
+
default: "./dist/index.mjs"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
license: "Apache-2.0",
|
|
53
|
+
homepage: "https://www.prisma.io",
|
|
54
|
+
repository: {
|
|
55
|
+
type: "git",
|
|
56
|
+
url: "https://github.com/prisma/prisma.git",
|
|
57
|
+
directory: "packages/instrumentation-contract"
|
|
58
|
+
},
|
|
59
|
+
bugs: "https://github.com/prisma/prisma/issues",
|
|
60
|
+
scripts: {
|
|
61
|
+
dev: "DEV=true tsx helpers/build.ts",
|
|
62
|
+
build: "tsx helpers/build.ts",
|
|
63
|
+
prepublishOnly: "pnpm run build",
|
|
64
|
+
test: "vitest run"
|
|
65
|
+
},
|
|
66
|
+
files: [
|
|
67
|
+
"dist"
|
|
68
|
+
],
|
|
69
|
+
sideEffects: false,
|
|
70
|
+
devDependencies: {
|
|
71
|
+
"@opentelemetry/api": "1.9.0"
|
|
72
|
+
},
|
|
73
|
+
peerDependencies: {
|
|
74
|
+
"@opentelemetry/api": "^1.8"
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var majorVersion = package_default.version.split(".")[0];
|
|
78
|
+
var GLOBAL_INSTRUMENTATION_KEY = "PRISMA_INSTRUMENTATION";
|
|
79
|
+
var GLOBAL_VERSIONED_INSTRUMENTATION_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
80
|
+
var globalThisWithPrismaInstrumentation = globalThis;
|
|
81
|
+
function getGlobalTracingHelper() {
|
|
82
|
+
const versionedGlobal = globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY];
|
|
83
|
+
if (versionedGlobal?.helper) {
|
|
84
|
+
return versionedGlobal.helper;
|
|
85
|
+
}
|
|
86
|
+
const fallbackGlobal = globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY];
|
|
87
|
+
return fallbackGlobal?.helper;
|
|
88
|
+
}
|
|
89
|
+
function setGlobalTracingHelper(helper) {
|
|
90
|
+
const globalValue = { helper };
|
|
91
|
+
globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = globalValue;
|
|
92
|
+
globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = globalValue;
|
|
93
|
+
}
|
|
94
|
+
function clearGlobalTracingHelper() {
|
|
95
|
+
delete globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY];
|
|
96
|
+
delete globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY];
|
|
97
|
+
}
|
|
98
|
+
|
|
32
99
|
// src/ActiveTracingHelper.ts
|
|
33
100
|
var import_api = require("@opentelemetry/api");
|
|
34
101
|
var showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true";
|
|
@@ -149,9 +216,9 @@ function shouldIgnoreSpan(spanName, ignoreSpanTypes) {
|
|
|
149
216
|
}
|
|
150
217
|
|
|
151
218
|
// package.json
|
|
152
|
-
var
|
|
219
|
+
var package_default2 = {
|
|
153
220
|
name: "@prisma/instrumentation",
|
|
154
|
-
version: "7.3.0-integration-
|
|
221
|
+
version: "7.3.0-integration-engines-7-3-0-12-parameterization-844f54891f0a80ec1820fc26cf513002357e4245.1",
|
|
155
222
|
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
156
223
|
main: "dist/index.js",
|
|
157
224
|
module: "dist/index.mjs",
|
|
@@ -177,13 +244,13 @@ var package_default = {
|
|
|
177
244
|
},
|
|
178
245
|
bugs: "https://github.com/prisma/prisma/issues",
|
|
179
246
|
devDependencies: {
|
|
180
|
-
"@prisma/internals": "workspace:*",
|
|
181
|
-
"@types/node": "18.19.76",
|
|
182
247
|
"@opentelemetry/api": "1.9.0",
|
|
248
|
+
"@prisma/instrumentation-contract": "workspace:*",
|
|
249
|
+
"@types/node": "~20.19.24",
|
|
183
250
|
typescript: "5.4.5"
|
|
184
251
|
},
|
|
185
252
|
dependencies: {
|
|
186
|
-
"@opentelemetry/instrumentation": "
|
|
253
|
+
"@opentelemetry/instrumentation": "^0.207.0"
|
|
187
254
|
},
|
|
188
255
|
peerDependencies: {
|
|
189
256
|
"@opentelemetry/api": "^1.8"
|
|
@@ -207,11 +274,8 @@ var package_default = {
|
|
|
207
274
|
};
|
|
208
275
|
|
|
209
276
|
// src/constants.ts
|
|
210
|
-
var VERSION =
|
|
211
|
-
var
|
|
212
|
-
var GLOBAL_INSTRUMENTATION_ACCESSOR_KEY = "PRISMA_INSTRUMENTATION";
|
|
213
|
-
var GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
214
|
-
var NAME = package_default.name;
|
|
277
|
+
var VERSION = package_default2.version;
|
|
278
|
+
var NAME = package_default2.name;
|
|
215
279
|
var MODULE_NAME = "@prisma/client";
|
|
216
280
|
|
|
217
281
|
// src/PrismaInstrumentation.ts
|
|
@@ -229,21 +293,18 @@ var PrismaInstrumentation = class extends import_instrumentation.Instrumentation
|
|
|
229
293
|
}
|
|
230
294
|
enable() {
|
|
231
295
|
const config = this._config;
|
|
232
|
-
|
|
233
|
-
|
|
296
|
+
setGlobalTracingHelper(
|
|
297
|
+
new ActiveTracingHelper({
|
|
234
298
|
tracerProvider: this.tracerProvider ?? import_api2.trace.getTracerProvider(),
|
|
235
299
|
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
236
300
|
})
|
|
237
|
-
|
|
238
|
-
global[GLOBAL_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
239
|
-
global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
301
|
+
);
|
|
240
302
|
}
|
|
241
303
|
disable() {
|
|
242
|
-
|
|
243
|
-
delete global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY];
|
|
304
|
+
clearGlobalTracingHelper();
|
|
244
305
|
}
|
|
245
306
|
isEnabled() {
|
|
246
|
-
return
|
|
307
|
+
return getGlobalTracingHelper() !== void 0;
|
|
247
308
|
}
|
|
248
309
|
};
|
|
249
310
|
|
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,73 @@ import {
|
|
|
5
5
|
InstrumentationNodeModuleDefinition
|
|
6
6
|
} from "@opentelemetry/instrumentation";
|
|
7
7
|
|
|
8
|
+
// ../instrumentation-contract/dist/index.mjs
|
|
9
|
+
var package_default = {
|
|
10
|
+
name: "@prisma/instrumentation-contract",
|
|
11
|
+
version: "7.3.0-integration-engines-7-3-0-12-parameterization-844f54891f0a80ec1820fc26cf513002357e4245.1",
|
|
12
|
+
description: "Shared types and utilities for Prisma instrumentation",
|
|
13
|
+
main: "dist/index.js",
|
|
14
|
+
module: "dist/index.mjs",
|
|
15
|
+
types: "dist/index.d.ts",
|
|
16
|
+
exports: {
|
|
17
|
+
".": {
|
|
18
|
+
require: {
|
|
19
|
+
types: "./dist/index.d.ts",
|
|
20
|
+
default: "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
import: {
|
|
23
|
+
types: "./dist/index.d.mts",
|
|
24
|
+
default: "./dist/index.mjs"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
license: "Apache-2.0",
|
|
29
|
+
homepage: "https://www.prisma.io",
|
|
30
|
+
repository: {
|
|
31
|
+
type: "git",
|
|
32
|
+
url: "https://github.com/prisma/prisma.git",
|
|
33
|
+
directory: "packages/instrumentation-contract"
|
|
34
|
+
},
|
|
35
|
+
bugs: "https://github.com/prisma/prisma/issues",
|
|
36
|
+
scripts: {
|
|
37
|
+
dev: "DEV=true tsx helpers/build.ts",
|
|
38
|
+
build: "tsx helpers/build.ts",
|
|
39
|
+
prepublishOnly: "pnpm run build",
|
|
40
|
+
test: "vitest run"
|
|
41
|
+
},
|
|
42
|
+
files: [
|
|
43
|
+
"dist"
|
|
44
|
+
],
|
|
45
|
+
sideEffects: false,
|
|
46
|
+
devDependencies: {
|
|
47
|
+
"@opentelemetry/api": "1.9.0"
|
|
48
|
+
},
|
|
49
|
+
peerDependencies: {
|
|
50
|
+
"@opentelemetry/api": "^1.8"
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var majorVersion = package_default.version.split(".")[0];
|
|
54
|
+
var GLOBAL_INSTRUMENTATION_KEY = "PRISMA_INSTRUMENTATION";
|
|
55
|
+
var GLOBAL_VERSIONED_INSTRUMENTATION_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
56
|
+
var globalThisWithPrismaInstrumentation = globalThis;
|
|
57
|
+
function getGlobalTracingHelper() {
|
|
58
|
+
const versionedGlobal = globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY];
|
|
59
|
+
if (versionedGlobal?.helper) {
|
|
60
|
+
return versionedGlobal.helper;
|
|
61
|
+
}
|
|
62
|
+
const fallbackGlobal = globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY];
|
|
63
|
+
return fallbackGlobal?.helper;
|
|
64
|
+
}
|
|
65
|
+
function setGlobalTracingHelper(helper) {
|
|
66
|
+
const globalValue = { helper };
|
|
67
|
+
globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = globalValue;
|
|
68
|
+
globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = globalValue;
|
|
69
|
+
}
|
|
70
|
+
function clearGlobalTracingHelper() {
|
|
71
|
+
delete globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY];
|
|
72
|
+
delete globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY];
|
|
73
|
+
}
|
|
74
|
+
|
|
8
75
|
// src/ActiveTracingHelper.ts
|
|
9
76
|
import {
|
|
10
77
|
context as _context,
|
|
@@ -129,9 +196,9 @@ function shouldIgnoreSpan(spanName, ignoreSpanTypes) {
|
|
|
129
196
|
}
|
|
130
197
|
|
|
131
198
|
// package.json
|
|
132
|
-
var
|
|
199
|
+
var package_default2 = {
|
|
133
200
|
name: "@prisma/instrumentation",
|
|
134
|
-
version: "7.3.0-integration-
|
|
201
|
+
version: "7.3.0-integration-engines-7-3-0-12-parameterization-844f54891f0a80ec1820fc26cf513002357e4245.1",
|
|
135
202
|
description: "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
136
203
|
main: "dist/index.js",
|
|
137
204
|
module: "dist/index.mjs",
|
|
@@ -157,13 +224,13 @@ var package_default = {
|
|
|
157
224
|
},
|
|
158
225
|
bugs: "https://github.com/prisma/prisma/issues",
|
|
159
226
|
devDependencies: {
|
|
160
|
-
"@prisma/internals": "workspace:*",
|
|
161
|
-
"@types/node": "18.19.76",
|
|
162
227
|
"@opentelemetry/api": "1.9.0",
|
|
228
|
+
"@prisma/instrumentation-contract": "workspace:*",
|
|
229
|
+
"@types/node": "~20.19.24",
|
|
163
230
|
typescript: "5.4.5"
|
|
164
231
|
},
|
|
165
232
|
dependencies: {
|
|
166
|
-
"@opentelemetry/instrumentation": "
|
|
233
|
+
"@opentelemetry/instrumentation": "^0.207.0"
|
|
167
234
|
},
|
|
168
235
|
peerDependencies: {
|
|
169
236
|
"@opentelemetry/api": "^1.8"
|
|
@@ -187,11 +254,8 @@ var package_default = {
|
|
|
187
254
|
};
|
|
188
255
|
|
|
189
256
|
// src/constants.ts
|
|
190
|
-
var VERSION =
|
|
191
|
-
var
|
|
192
|
-
var GLOBAL_INSTRUMENTATION_ACCESSOR_KEY = "PRISMA_INSTRUMENTATION";
|
|
193
|
-
var GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
|
|
194
|
-
var NAME = package_default.name;
|
|
257
|
+
var VERSION = package_default2.version;
|
|
258
|
+
var NAME = package_default2.name;
|
|
195
259
|
var MODULE_NAME = "@prisma/client";
|
|
196
260
|
|
|
197
261
|
// src/PrismaInstrumentation.ts
|
|
@@ -209,21 +273,18 @@ var PrismaInstrumentation = class extends InstrumentationBase {
|
|
|
209
273
|
}
|
|
210
274
|
enable() {
|
|
211
275
|
const config = this._config;
|
|
212
|
-
|
|
213
|
-
|
|
276
|
+
setGlobalTracingHelper(
|
|
277
|
+
new ActiveTracingHelper({
|
|
214
278
|
tracerProvider: this.tracerProvider ?? trace2.getTracerProvider(),
|
|
215
279
|
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
216
280
|
})
|
|
217
|
-
|
|
218
|
-
global[GLOBAL_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
219
|
-
global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY] = globalValue;
|
|
281
|
+
);
|
|
220
282
|
}
|
|
221
283
|
disable() {
|
|
222
|
-
|
|
223
|
-
delete global[GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY];
|
|
284
|
+
clearGlobalTracingHelper();
|
|
224
285
|
}
|
|
225
286
|
isEnabled() {
|
|
226
|
-
return
|
|
287
|
+
return getGlobalTracingHelper() !== void 0;
|
|
227
288
|
}
|
|
228
289
|
};
|
|
229
290
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, TracerProvider } from '@opentelemetry/api';
|
|
2
|
-
import { EngineSpan, ExtendedSpanOptions, SpanCallback, TracingHelper } from '@prisma/
|
|
2
|
+
import type { EngineSpan, ExtendedSpanOptions, SpanCallback, TracingHelper } from '@prisma/instrumentation-contract';
|
|
3
3
|
type Options = {
|
|
4
4
|
tracerProvider: TracerProvider;
|
|
5
5
|
ignoreSpanTypes: (string | RegExp)[];
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export declare const VERSION: string;
|
|
2
|
-
export declare const GLOBAL_INSTRUMENTATION_ACCESSOR_KEY = "PRISMA_INSTRUMENTATION";
|
|
3
|
-
export declare const GLOBAL_VERSIONED_INSTRUMENTATION_ACCESSOR_KEY: string;
|
|
4
2
|
export declare const NAME: string;
|
|
5
3
|
export declare const MODULE_NAME = "@prisma/client";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/instrumentation",
|
|
3
|
-
"version": "7.3.0-integration-
|
|
3
|
+
"version": "7.3.0-integration-engines-7-3-0-12-parameterization-844f54891f0a80ec1820fc26cf513002357e4245.1",
|
|
4
4
|
"description": "OpenTelemetry compliant instrumentation for Prisma Client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
},
|
|
27
27
|
"bugs": "https://github.com/prisma/prisma/issues",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "18.19.76",
|
|
30
29
|
"@opentelemetry/api": "1.9.0",
|
|
30
|
+
"@types/node": "~20.19.24",
|
|
31
31
|
"typescript": "5.4.5",
|
|
32
|
-
"@prisma/
|
|
32
|
+
"@prisma/instrumentation-contract": "7.3.0-integration-engines-7-3-0-12-parameterization-844f54891f0a80ec1820fc26cf513002357e4245.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@opentelemetry/instrumentation": "
|
|
35
|
+
"@opentelemetry/instrumentation": "^0.207.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@opentelemetry/api": "^1.8"
|