@sentry/node 10.64.0 → 10.66.0

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.
Files changed (121) hide show
  1. package/build/cjs/index.js +10 -8
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/http.js +4 -7
  4. package/build/cjs/integrations/http.js.map +1 -1
  5. package/build/cjs/integrations/tracing/dataloader/index.js +7 -2
  6. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -1
  7. package/build/cjs/integrations/tracing/graphql/index.js +3 -2
  8. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  9. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  10. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +5 -6
  11. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  12. package/build/cjs/integrations/tracing/index.js +2 -2
  13. package/build/cjs/integrations/tracing/index.js.map +1 -1
  14. package/build/cjs/integrations/tracing/knex/index.js +6 -1
  15. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  16. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +1 -1
  17. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -1
  18. package/build/cjs/integrations/tracing/mysql2/index.js +3 -2
  19. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  20. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +1 -1
  21. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  22. package/build/cjs/integrations/tracing/redis/index.js +3 -8
  23. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  24. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +10 -8
  25. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  26. package/build/cjs/sdk/index.js +10 -11
  27. package/build/cjs/sdk/index.js.map +1 -1
  28. package/build/esm/index.js +2 -1
  29. package/build/esm/index.js.map +1 -1
  30. package/build/esm/integrations/http.js +5 -8
  31. package/build/esm/integrations/http.js.map +1 -1
  32. package/build/esm/integrations/tracing/dataloader/index.js +7 -2
  33. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -1
  34. package/build/esm/integrations/tracing/graphql/index.js +4 -3
  35. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  36. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  37. package/build/esm/integrations/tracing/graphql/vendored/utils.js +5 -6
  38. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  39. package/build/esm/integrations/tracing/index.js +1 -1
  40. package/build/esm/integrations/tracing/index.js.map +1 -1
  41. package/build/esm/integrations/tracing/knex/index.js +6 -1
  42. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  43. package/build/esm/integrations/tracing/mongo/vendored/utils.js +2 -2
  44. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -1
  45. package/build/esm/integrations/tracing/mysql2/index.js +4 -3
  46. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  47. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +1 -1
  48. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  49. package/build/esm/integrations/tracing/redis/index.js +5 -10
  50. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  51. package/build/esm/package.json +1 -1
  52. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +11 -9
  53. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  54. package/build/esm/sdk/index.js +10 -11
  55. package/build/esm/sdk/index.js.map +1 -1
  56. package/build/types/index.d.ts +2 -1
  57. package/build/types/index.d.ts.map +1 -1
  58. package/build/types/integrations/http.d.ts +2 -2
  59. package/build/types/integrations/http.d.ts.map +1 -1
  60. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -1
  61. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  62. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +1 -135
  63. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +1 -1
  64. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -1
  65. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  66. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -1
  67. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  68. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
  69. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  70. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +2 -1
  71. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -1
  72. package/build/types/sdk/index.d.ts.map +1 -1
  73. package/build/types-ts3.8/index.d.ts +2 -1
  74. package/build/types-ts3.8/integrations/http.d.ts +2 -2
  75. package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +1 -135
  76. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +2 -1
  77. package/package.json +6 -6
  78. package/build/cjs/integrations/tracing/prisma/index.js +0 -109
  79. package/build/cjs/integrations/tracing/prisma/index.js.map +0 -1
  80. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js +0 -145
  81. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +0 -1
  82. package/build/cjs/integrations/tracing/prisma/vendored/constants.js +0 -14
  83. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +0 -1
  84. package/build/cjs/integrations/tracing/prisma/vendored/global.js +0 -28
  85. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +0 -1
  86. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js +0 -33
  87. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +0 -1
  88. package/build/esm/integrations/tracing/prisma/index.js +0 -106
  89. package/build/esm/integrations/tracing/prisma/index.js.map +0 -1
  90. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js +0 -143
  91. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +0 -1
  92. package/build/esm/integrations/tracing/prisma/vendored/constants.js +0 -9
  93. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +0 -1
  94. package/build/esm/integrations/tracing/prisma/vendored/global.js +0 -24
  95. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +0 -1
  96. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js +0 -31
  97. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +0 -1
  98. package/build/types/integrations/tracing/prisma/index.d.ts +0 -34
  99. package/build/types/integrations/tracing/prisma/index.d.ts.map +0 -1
  100. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +0 -16
  101. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +0 -1
  102. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts +0 -5
  103. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +0 -1
  104. package/build/types/integrations/tracing/prisma/vendored/global.d.ts +0 -5
  105. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +0 -1
  106. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts +0 -15
  107. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +0 -1
  108. package/build/types/integrations/tracing/prisma/vendored/types.d.ts +0 -34
  109. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +0 -1
  110. package/build/types/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts +0 -38
  111. package/build/types/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts.map +0 -1
  112. package/build/types/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts +0 -31
  113. package/build/types/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts.map +0 -1
  114. package/build/types-ts3.8/integrations/tracing/prisma/index.d.ts +0 -34
  115. package/build/types-ts3.8/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +0 -16
  116. package/build/types-ts3.8/integrations/tracing/prisma/vendored/constants.d.ts +0 -5
  117. package/build/types-ts3.8/integrations/tracing/prisma/vendored/global.d.ts +0 -5
  118. package/build/types-ts3.8/integrations/tracing/prisma/vendored/instrumentation.d.ts +0 -15
  119. package/build/types-ts3.8/integrations/tracing/prisma/vendored/types.d.ts +0 -37
  120. package/build/types-ts3.8/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts +0 -44
  121. package/build/types-ts3.8/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts +0 -34
@@ -1,143 +0,0 @@
1
- import { getActiveSpan, startInactiveSpan, startSpanManual, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
2
-
3
- const showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true";
4
- const nonSampledTraceParent = `00-10-10-00`;
5
- const PRISMA_ORIGIN = "auto.db.otel.prisma";
6
- function buildSpanAttributes(name, attributes) {
7
- const merged = {
8
- ...attributes,
9
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRISMA_ORIGIN
10
- };
11
- if (name === "prisma:engine:db_query" && merged["db.system"] == null) {
12
- merged["db.system"] = "prisma";
13
- }
14
- return merged;
15
- }
16
- function buildSpanName(name, attributes) {
17
- const queryText = attributes["db.query.text"];
18
- if ((name === "prisma:engine:db_query" || name === "prisma:client:db_query") && typeof queryText === "string") {
19
- return queryText;
20
- }
21
- return name;
22
- }
23
- class ActiveTracingHelper {
24
- constructor({ ignoreSpanTypes }) {
25
- this.ignoreSpanTypes = ignoreSpanTypes;
26
- }
27
- isEnabled() {
28
- return true;
29
- }
30
- getTraceParent(span) {
31
- const spanContext = (span ?? getActiveSpan())?.spanContext();
32
- if (spanContext) {
33
- return `00-${spanContext.traceId}-${spanContext.spanId}-0${spanContext.traceFlags}`;
34
- }
35
- return nonSampledTraceParent;
36
- }
37
- dispatchEngineSpans(spans) {
38
- const linkIds = /* @__PURE__ */ new Map();
39
- const roots = spans.filter((span) => span.parentId === null);
40
- for (const root of roots) {
41
- dispatchEngineSpan(root, spans, linkIds, this.ignoreSpanTypes);
42
- }
43
- }
44
- getActiveContext() {
45
- return getActiveSpan();
46
- }
47
- runInChildSpan(nameOrOptions, callback) {
48
- const options = typeof nameOrOptions === "string" ? { name: nameOrOptions } : nameOrOptions;
49
- if (options.internal && !showAllTraces) {
50
- return callback();
51
- }
52
- const name = `prisma:client:${options.name}`;
53
- if (shouldIgnoreSpan(name, this.ignoreSpanTypes)) {
54
- return callback();
55
- }
56
- const parentSpan = getActiveSpan();
57
- const attributes = buildSpanAttributes(name, options.attributes);
58
- const spanOptions = {
59
- name: buildSpanName(name, attributes),
60
- attributes,
61
- kind: options.kind,
62
- links: options.links,
63
- startTime: options.startTime,
64
- parentSpan
65
- };
66
- if (options.active === false) {
67
- const span = startInactiveSpan(spanOptions);
68
- return endSpan(span, () => callback(span, parentSpan));
69
- }
70
- return startSpanManual(spanOptions, (span) => endSpan(span, () => callback(span, parentSpan)));
71
- }
72
- }
73
- function dispatchEngineSpan(engineSpan, allSpans, linkIds, ignoreSpanTypes) {
74
- if (shouldIgnoreSpan(engineSpan.name, ignoreSpanTypes)) {
75
- return;
76
- }
77
- const attributes = buildSpanAttributes(engineSpan.name, engineSpan.attributes);
78
- startSpanManual(
79
- {
80
- name: buildSpanName(engineSpan.name, attributes),
81
- attributes,
82
- kind: engineSpan.kind === "client" ? SPAN_KIND.CLIENT : SPAN_KIND.INTERNAL,
83
- startTime: engineSpan.startTime
84
- },
85
- (span) => {
86
- linkIds.set(engineSpan.id, span.spanContext().spanId);
87
- if (engineSpan.links) {
88
- span.addLinks(
89
- engineSpan.links.flatMap((link) => {
90
- const linkedId = linkIds.get(link);
91
- if (!linkedId) {
92
- return [];
93
- }
94
- return {
95
- context: {
96
- spanId: linkedId,
97
- traceId: span.spanContext().traceId,
98
- traceFlags: span.spanContext().traceFlags
99
- }
100
- };
101
- })
102
- );
103
- }
104
- const children = allSpans.filter((s) => s.parentId === engineSpan.id);
105
- for (const child of children) {
106
- dispatchEngineSpan(child, allSpans, linkIds, ignoreSpanTypes);
107
- }
108
- span.end(engineSpan.endTime);
109
- }
110
- );
111
- }
112
- function endSpan(span, run) {
113
- let result;
114
- try {
115
- result = run();
116
- } catch (reason) {
117
- span.end();
118
- throw reason;
119
- }
120
- if (isPromiseLike(result)) {
121
- return result.then(
122
- (value) => {
123
- span.end();
124
- return value;
125
- },
126
- (reason) => {
127
- span.end();
128
- throw reason;
129
- }
130
- );
131
- }
132
- span.end();
133
- return result;
134
- }
135
- function isPromiseLike(value) {
136
- return value != null && typeof value["then"] === "function";
137
- }
138
- function shouldIgnoreSpan(spanName, ignoreSpanTypes) {
139
- return ignoreSpanTypes.some((pattern) => typeof pattern === "string" ? pattern === spanName : pattern.test(spanName));
140
- }
141
-
142
- export { ActiveTracingHelper };
143
- //# sourceMappingURL=active-tracing-helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"active-tracing-helper.js","sources":["../../../../../../src/integrations/tracing/prisma/vendored/active-tracing-helper.ts"],"sourcesContent":["/*\n * Copyright Prisma\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/prisma/prisma/tree/b6feea5565ec577545a79547d24273ccdd11b4c7/packages/instrumentation\n * - Upstream version: @prisma/instrumentation@7.8.0\n * - Replaced `@prisma/instrumentation-contract` imports with local vendored types\n * - Span creation uses Sentry's span APIs (`startSpanManual` / `startInactiveSpan`) instead of the OTel tracer\n * - Span creation sets the Sentry origin, renames `db_query` spans to their SQL text, and backfills\n * `db.system` for older Prisma versions\n */\n\nimport type { Span, SpanAttributes, SpanKindValue, SpanLink } from '@sentry/core';\nimport {\n getActiveSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n startInactiveSpan,\n startSpanManual,\n} from '@sentry/core';\nimport type { EngineSpan, ExtendedSpanOptions, SpanCallback, TracingHelper } from './types';\n\nconst showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === 'true';\n\nconst nonSampledTraceParent = `00-10-10-00`;\n\nconst PRISMA_ORIGIN = 'auto.db.otel.prisma';\n\ntype Options = {\n ignoreSpanTypes: (string | RegExp)[];\n};\n\n/**\n * Older Prisma versions emit `prisma:engine:db_query` spans without a `db.system`, so it's backfilled here.\n */\nfunction buildSpanAttributes(name: string, attributes: Record<string, unknown> | undefined): SpanAttributes {\n const merged: SpanAttributes = {\n ...(attributes as SpanAttributes | undefined),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRISMA_ORIGIN,\n };\n\n if (name === 'prisma:engine:db_query' && merged['db.system'] == null) {\n merged['db.system'] = 'prisma';\n }\n\n return merged;\n}\n\n/**\n * Db query spans are named after their SQL text (e.g. `SELECT * FROM \"User\"`) rather than the generic\n * engine name. v5/v6 emit `prisma:engine:db_query`; v7 inlined the engine and emits `prisma:client:db_query`.\n */\nfunction buildSpanName(name: string, attributes: SpanAttributes): string {\n const queryText = attributes['db.query.text'];\n if ((name === 'prisma:engine:db_query' || name === 'prisma:client:db_query') && typeof queryText === 'string') {\n return queryText;\n }\n return name;\n}\n\nexport class ActiveTracingHelper implements TracingHelper {\n private ignoreSpanTypes: (string | RegExp)[];\n\n public constructor({ ignoreSpanTypes }: Options) {\n this.ignoreSpanTypes = ignoreSpanTypes;\n }\n\n public isEnabled(): boolean {\n return true;\n }\n\n public getTraceParent(span?: Span): string {\n const spanContext = (span ?? getActiveSpan())?.spanContext();\n if (spanContext) {\n return `00-${spanContext.traceId}-${spanContext.spanId}-0${spanContext.traceFlags}`;\n }\n return nonSampledTraceParent;\n }\n\n public dispatchEngineSpans(spans: EngineSpan[]): void {\n const linkIds = new Map<string, string>();\n const roots = spans.filter(span => span.parentId === null);\n\n for (const root of roots) {\n dispatchEngineSpan(root, spans, linkIds, this.ignoreSpanTypes);\n }\n }\n\n public getActiveContext(): Span | undefined {\n return getActiveSpan();\n }\n\n public runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R {\n const options: ExtendedSpanOptions = typeof nameOrOptions === 'string' ? { name: nameOrOptions } : nameOrOptions;\n\n if (options.internal && !showAllTraces) {\n return callback();\n }\n\n const name = `prisma:client:${options.name}`;\n\n if (shouldIgnoreSpan(name, this.ignoreSpanTypes)) {\n return callback();\n }\n\n const parentSpan = getActiveSpan();\n\n const attributes = buildSpanAttributes(name, options.attributes as Record<string, unknown> | undefined);\n const spanOptions = {\n name: buildSpanName(name, attributes),\n attributes,\n kind: options.kind as SpanKindValue | undefined,\n links: options.links as SpanLink[] | undefined,\n startTime: options.startTime,\n parentSpan,\n };\n\n if (options.active === false) {\n const span = startInactiveSpan(spanOptions);\n return endSpan(span, () => callback(span, parentSpan));\n }\n\n return startSpanManual(spanOptions, span => endSpan(span, () => callback(span, parentSpan)));\n }\n}\n\nfunction dispatchEngineSpan(\n engineSpan: EngineSpan,\n allSpans: EngineSpan[],\n linkIds: Map<string, string>,\n ignoreSpanTypes: (string | RegExp)[],\n): void {\n if (shouldIgnoreSpan(engineSpan.name, ignoreSpanTypes)) {\n return;\n }\n\n const attributes = buildSpanAttributes(engineSpan.name, engineSpan.attributes);\n\n startSpanManual(\n {\n name: buildSpanName(engineSpan.name, attributes),\n attributes,\n kind: engineSpan.kind === 'client' ? SPAN_KIND.CLIENT : SPAN_KIND.INTERNAL,\n startTime: engineSpan.startTime,\n },\n span => {\n linkIds.set(engineSpan.id, span.spanContext().spanId);\n\n if (engineSpan.links) {\n span.addLinks(\n engineSpan.links.flatMap(link => {\n const linkedId = linkIds.get(link);\n if (!linkedId) {\n return [];\n }\n return {\n context: {\n spanId: linkedId,\n traceId: span.spanContext().traceId,\n traceFlags: span.spanContext().traceFlags,\n },\n };\n }),\n );\n }\n\n const children = allSpans.filter(s => s.parentId === engineSpan.id);\n for (const child of children) {\n dispatchEngineSpan(child, allSpans, linkIds, ignoreSpanTypes);\n }\n\n span.end(engineSpan.endTime);\n },\n );\n}\n\nfunction endSpan<T>(span: Span, run: () => T): T {\n let result: T;\n try {\n result = run();\n } catch (reason) {\n span.end();\n throw reason;\n }\n\n if (isPromiseLike(result)) {\n return result.then(\n value => {\n span.end();\n return value;\n },\n reason => {\n span.end();\n throw reason;\n },\n ) as T;\n }\n span.end();\n return result;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return value != null && typeof (value as Record<string, unknown>)['then'] === 'function';\n}\n\nfunction shouldIgnoreSpan(spanName: string, ignoreSpanTypes: (string | RegExp)[]): boolean {\n return ignoreSpanTypes.some(pattern => (typeof pattern === 'string' ? pattern === spanName : pattern.test(spanName)));\n}\n"],"names":[],"mappings":";;AAuBA,MAAM,aAAA,GAAgB,OAAA,CAAQ,GAAA,CAAI,sBAAA,KAA2B,MAAA;AAE7D,MAAM,qBAAA,GAAwB,CAAA,WAAA,CAAA;AAE9B,MAAM,aAAA,GAAgB,qBAAA;AAStB,SAAS,mBAAA,CAAoB,MAAc,UAAA,EAAiE;AAC1G,EAAA,MAAM,MAAA,GAAyB;AAAA,IAC7B,GAAI,UAAA;AAAA,IACJ,CAAC,gCAAgC,GAAG;AAAA,GACtC;AAEA,EAAA,IAAI,IAAA,KAAS,wBAAA,IAA4B,MAAA,CAAO,WAAW,KAAK,IAAA,EAAM;AACpE,IAAA,MAAA,CAAO,WAAW,CAAA,GAAI,QAAA;AAAA,EACxB;AAEA,EAAA,OAAO,MAAA;AACT;AAMA,SAAS,aAAA,CAAc,MAAc,UAAA,EAAoC;AACvE,EAAA,MAAM,SAAA,GAAY,WAAW,eAAe,CAAA;AAC5C,EAAA,IAAA,CAAK,SAAS,wBAAA,IAA4B,IAAA,KAAS,wBAAA,KAA6B,OAAO,cAAc,QAAA,EAAU;AAC7G,IAAA,OAAO,SAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAA;AACT;AAEO,MAAM,mBAAA,CAA6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AA,EACR;AAEA,EAAA,IAAI,aAAA,CAAc,MAAM,CAAA,EAAG;AACzB,IAAA,OAAO,MAAA,CAAO,IAAA;AAAA,MACZ,CAAA,KAAA,KAAS;AACP,QAAA,IAAA,CAAK,GAAA,EAAI;AACT,QAAA,OAAO,KAAA;AAAA,MACT,CAAA;AAAA,MACA,CAAA,MAAA,KAAU;AACR,QAAA,IAAA,CAAK,GAAA,EAAI;AACT,QAAA,MAAM,MAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,IAAA,CAAK,GAAA,EAAI;AACT,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,cAAc,KAAA,EAA+C;AACpE,EAAA,OAAO,KAAA,IAAS,IAAA,IAAQ,OAAQ,KAAA,CAAkC,MAAM,CAAA,KAAM,UAAA;AAChF;AAEA,SAAS,gBAAA,CAAiB,UAAkB,eAAA,EAA+C;AACzF,EAAA,OAAO,eAAA,CAAgB,IAAA,CAAK,CAAA,OAAA,KAAY,OAAO,OAAA,KAAY,QAAA,GAAW,OAAA,KAAY,QAAA,GAAW,OAAA,CAAQ,IAAA,CAAK,QAAQ,CAAE,CAAA;AACtH;;;;"}
@@ -1,9 +0,0 @@
1
- import { SDK_VERSION } from '@sentry/core';
2
-
3
- const VERSION = SDK_VERSION;
4
- const NAME = "@sentry/instrumentation-prisma";
5
- const MODULE_NAME = "@prisma/client";
6
- const SUPPORTED_MODULE_VERSIONS = [">=5.0.0"];
7
-
8
- export { MODULE_NAME, NAME, SUPPORTED_MODULE_VERSIONS, VERSION };
9
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../../src/integrations/tracing/prisma/vendored/constants.ts"],"sourcesContent":["/*\n * Copyright Prisma\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/prisma/prisma/tree/b6feea5565ec577545a79547d24273ccdd11b4c7/packages/instrumentation\n * - Upstream version: @prisma/instrumentation@7.8.0\n * - Replaced `import packageJson from '../package.json'` with hardcoded values\n */\n\nimport { SDK_VERSION } from '@sentry/core';\n\nexport const VERSION = SDK_VERSION;\n\nexport const NAME = '@sentry/instrumentation-prisma';\n\nexport const MODULE_NAME = '@prisma/client';\n\nexport const SUPPORTED_MODULE_VERSIONS = ['>=5.0.0'];\n"],"names":[],"mappings":";;AAYO,MAAM,OAAA,GAAU;AAEhB,MAAM,IAAA,GAAO;AAEb,MAAM,WAAA,GAAc;AAEpB,MAAM,yBAAA,GAA4B,CAAC,SAAS;;;;"}
@@ -1,24 +0,0 @@
1
- const majorVersion = "7";
2
- const GLOBAL_INSTRUMENTATION_KEY = "PRISMA_INSTRUMENTATION";
3
- const GLOBAL_VERSIONED_INSTRUMENTATION_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
4
- const globalThisWithPrismaInstrumentation = globalThis;
5
- function getGlobalTracingHelper() {
6
- const versionedGlobal = globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY];
7
- if (versionedGlobal?.helper) {
8
- return versionedGlobal.helper;
9
- }
10
- const fallbackGlobal = globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY];
11
- return fallbackGlobal?.helper;
12
- }
13
- function setGlobalTracingHelper(helper) {
14
- const globalValue = { helper };
15
- globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = globalValue;
16
- globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = globalValue;
17
- }
18
- function clearGlobalTracingHelper() {
19
- globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = void 0;
20
- globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = void 0;
21
- }
22
-
23
- export { clearGlobalTracingHelper, getGlobalTracingHelper, setGlobalTracingHelper };
24
- //# sourceMappingURL=global.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global.js","sources":["../../../../../../src/integrations/tracing/prisma/vendored/global.ts"],"sourcesContent":["/*\n * Copyright Prisma\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/prisma/prisma/tree/b6feea5565ec577545a79547d24273ccdd11b4c7/packages/instrumentation-contract\n * - Upstream version: @prisma/instrumentation-contract@7.8.0\n * - Replaced `import packageJson from '../package.json'` with hardcoded major version\n */\n\nimport type { PrismaInstrumentationGlobalValue, TracingHelper } from './types';\n\nconst majorVersion = '7';\n\nconst GLOBAL_INSTRUMENTATION_KEY = 'PRISMA_INSTRUMENTATION';\nconst GLOBAL_VERSIONED_INSTRUMENTATION_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION` as const;\n\ntype GlobalThisWithPrismaInstrumentation = typeof globalThis & {\n [GLOBAL_INSTRUMENTATION_KEY]?: PrismaInstrumentationGlobalValue;\n} & {\n [K in typeof GLOBAL_VERSIONED_INSTRUMENTATION_KEY]?: PrismaInstrumentationGlobalValue;\n};\n\nconst globalThisWithPrismaInstrumentation = globalThis as GlobalThisWithPrismaInstrumentation;\n\nexport function getGlobalTracingHelper(): TracingHelper | undefined {\n const versionedGlobal = globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY];\n\n if (versionedGlobal?.helper) {\n return versionedGlobal.helper;\n }\n\n const fallbackGlobal = globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY];\n\n return fallbackGlobal?.helper;\n}\n\nexport function setGlobalTracingHelper(helper: TracingHelper): void {\n const globalValue: PrismaInstrumentationGlobalValue = { helper };\n\n globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = globalValue;\n globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = globalValue;\n}\n\nexport function clearGlobalTracingHelper(): void {\n globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = undefined;\n globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = undefined;\n}\n"],"names":[],"mappings":"AAYA,MAAM,YAAA,GAAe,GAAA;AAErB,MAAM,0BAAA,GAA6B,wBAAA;AACnC,MAAM,oCAAA,GAAuC,IAAI,YAAY,CAAA,uBAAA,CAAA;AAQ7D,MAAM,mCAAA,GAAsC,UAAA;AAErC,SAAS,sBAAA,GAAoD;AAClE,EAAA,MAAM,eAAA,GAAkB,oCAAoC,oCAAoC,CAAA;AAEhG,EAAA,IAAI,iBAAiB,MAAA,EAAQ;AAC3B,IAAA,OAAO,eAAA,CAAgB,MAAA;AAAA,EACzB;AAEA,EAAA,MAAM,cAAA,GAAiB,oCAAoC,0BAA0B,CAAA;AAErF,EAAA,OAAO,cAAA,EAAgB,MAAA;AACzB;AAEO,SAAS,uBAAuB,MAAA,EAA6B;AAClE,EAAA,MAAM,WAAA,GAAgD,EAAE,MAAA,EAAO;AAE/D,EAAA,mCAAA,CAAoC,oCAAoC,CAAA,GAAI,WAAA;AAC5E,EAAA,mCAAA,CAAoC,0BAA0B,CAAA,GAAI,WAAA;AACpE;AAEO,SAAS,wBAAA,GAAiC;AAC/C,EAAA,mCAAA,CAAoC,oCAAoC,CAAA,GAAI,MAAA;AAC5E,EAAA,mCAAA,CAAoC,0BAA0B,CAAA,GAAI,MAAA;AACpE;;;;"}
@@ -1,31 +0,0 @@
1
- import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
2
- import { ActiveTracingHelper } from './active-tracing-helper.js';
3
- import { NAME, VERSION, MODULE_NAME, SUPPORTED_MODULE_VERSIONS } from './constants.js';
4
- import { setGlobalTracingHelper, clearGlobalTracingHelper, getGlobalTracingHelper } from './global.js';
5
-
6
- class PrismaInstrumentation extends InstrumentationBase {
7
- constructor(config = {}) {
8
- super(NAME, VERSION, config);
9
- }
10
- init() {
11
- const module = new InstrumentationNodeModuleDefinition(MODULE_NAME, SUPPORTED_MODULE_VERSIONS);
12
- return [module];
13
- }
14
- enable() {
15
- const config = this._config;
16
- setGlobalTracingHelper(
17
- new ActiveTracingHelper({
18
- ignoreSpanTypes: config.ignoreSpanTypes ?? []
19
- })
20
- );
21
- }
22
- disable() {
23
- clearGlobalTracingHelper();
24
- }
25
- isEnabled() {
26
- return getGlobalTracingHelper() !== void 0;
27
- }
28
- }
29
-
30
- export { PrismaInstrumentation };
31
- //# sourceMappingURL=instrumentation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/prisma/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright Prisma\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/prisma/prisma/tree/b6feea5565ec577545a79547d24273ccdd11b4c7/packages/instrumentation\n * - Upstream version: @prisma/instrumentation@7.8.0\n * - Replaced `@prisma/instrumentation-contract` imports with local vendored equivalents\n * - Replaced `import { VERSION, NAME, MODULE_NAME } from './constants'` with local vendored constants\n * - Removed the unused `setTracerProvider`/`tracerProvider` members; spans are created through Sentry's\n * span APIs, which resolve the active client themselves\n */\n\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { ActiveTracingHelper } from './active-tracing-helper';\nimport { MODULE_NAME, NAME, SUPPORTED_MODULE_VERSIONS, VERSION } from './constants';\nimport { clearGlobalTracingHelper, getGlobalTracingHelper, setGlobalTracingHelper } from './global';\n\nexport interface PrismaInstrumentationConfig {\n ignoreSpanTypes?: (string | RegExp)[];\n}\n\ntype Config = PrismaInstrumentationConfig & InstrumentationConfig;\n\nexport class PrismaInstrumentation extends InstrumentationBase {\n public constructor(config: Config = {}) {\n super(NAME, VERSION, config);\n }\n\n public init(): InstrumentationNodeModuleDefinition[] {\n const module = new InstrumentationNodeModuleDefinition(MODULE_NAME, SUPPORTED_MODULE_VERSIONS);\n\n return [module];\n }\n\n public enable(): void {\n const config = this._config as Config;\n\n setGlobalTracingHelper(\n new ActiveTracingHelper({\n ignoreSpanTypes: config.ignoreSpanTypes ?? [],\n }),\n );\n }\n\n public disable(): void {\n clearGlobalTracingHelper();\n }\n\n public isEnabled(): boolean {\n return getGlobalTracingHelper() !== undefined;\n }\n}\n"],"names":[],"mappings":";;;;;AAyBO,MAAM,8BAA8B,mBAAA,CAAoB;AAAA,EACtD,WAAA,CAAY,MAAA,GAAiB,EAAC,EAAG;AACtC,IAAA,KAAA,CAAM,IAAA,EAAM,SAAS,MAAM,CAAA;AAAA,EAC7B;AAAA,EAEO,IAAA,GAA8C;AACnD,IAAA,MAAM,MAAA,GAAS,IAAI,mCAAA,CAAoC,WAAA,EAAa,yBAAyB,CAAA;AAE7F,IAAA,OAAO,CAAC,MAAM,CAAA;AAAA,EAChB;AAAA,EAEO,MAAA,GAAe;AACpB,IAAA,MAAM,SAAS,IAAA,CAAK,OAAA;AAEpB,IAAA,sBAAA;AAAA,MACE,IAAI,mBAAA,CAAoB;AAAA,QACtB,eAAA,EAAiB,MAAA,CAAO,eAAA,IAAmB;AAAC,OAC7C;AAAA,KACH;AAAA,EACF;AAAA,EAEO,OAAA,GAAgB;AACrB,IAAA,wBAAA,EAAyB;AAAA,EAC3B;AAAA,EAEO,SAAA,GAAqB;AAC1B,IAAA,OAAO,wBAAuB,KAAM,MAAA;AAAA,EACtC;AACF;;;;"}
@@ -1,34 +0,0 @@
1
- import type { Instrumentation } from '@opentelemetry/instrumentation';
2
- import { PrismaInstrumentation } from './vendored/instrumentation';
3
- interface PrismaOptions {
4
- /**
5
- * @deprecated This is no longer used, v5 works out of the box.
6
- */
7
- prismaInstrumentation?: Instrumentation;
8
- /**
9
- * Configuration passed through to the {@link PrismaInstrumentation} constructor.
10
- */
11
- instrumentationConfig?: ConstructorParameters<typeof PrismaInstrumentation>[0];
12
- }
13
- export declare const instrumentPrisma: ((options?: PrismaOptions | undefined) => Instrumentation<import("@opentelemetry/instrumentation").InstrumentationConfig>) & {
14
- id: string;
15
- };
16
- /**
17
- * Adds Sentry tracing instrumentation for the [prisma](https://www.npmjs.com/package/prisma) library.
18
- * For more information, see the [`prismaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/).
19
- *
20
- * NOTE: This integration works out of the box with Prisma v6, and v7.
21
- * On Prisma versions prior to v6, add `previewFeatures = ["tracing"]` to the client generator block of your Prisma schema:
22
- *
23
- * ```
24
- * generator client {
25
- * provider = "prisma-client-js"
26
- * previewFeatures = ["tracing"]
27
- * }
28
- * ```
29
- */
30
- export declare const prismaIntegration: (options?: PrismaOptions | undefined) => import("@sentry/core").Integration & {
31
- name: "Prisma";
32
- };
33
- export {};
34
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/prisma/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAatE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AA8GnE,UAAU,aAAa;IACrB;;OAEG;IACH,qBAAqB,CAAC,EAAE,eAAe,CAAC;IACxC;;OAEG;IACH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;CAChF;AAqCD,eAAO,MAAM,gBAAgB;;CAE3B,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB;;CAgD5B,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { Span } from '@sentry/core';
2
- import type { EngineSpan, ExtendedSpanOptions, SpanCallback, TracingHelper } from './types';
3
- type Options = {
4
- ignoreSpanTypes: (string | RegExp)[];
5
- };
6
- export declare class ActiveTracingHelper implements TracingHelper {
7
- private ignoreSpanTypes;
8
- constructor({ ignoreSpanTypes }: Options);
9
- isEnabled(): boolean;
10
- getTraceParent(span?: Span): string;
11
- dispatchEngineSpans(spans: EngineSpan[]): void;
12
- getActiveContext(): Span | undefined;
13
- runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R;
14
- }
15
- export {};
16
- //# sourceMappingURL=active-tracing-helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"active-tracing-helper.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/prisma/vendored/active-tracing-helper.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAA2C,MAAM,cAAc,CAAC;AAQlF,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ5F,KAAK,OAAO,GAAG;IACb,eAAe,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACtC,CAAC;AA8BF,qBAAa,mBAAoB,YAAW,aAAa;IACvD,OAAO,CAAC,eAAe,CAAsB;gBAE1B,EAAE,eAAe,EAAE,EAAE,OAAO;IAIxC,SAAS,IAAI,OAAO;IAIpB,cAAc,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM;IAQnC,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI;IAS9C,gBAAgB,IAAI,IAAI,GAAG,SAAS;IAIpC,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,mBAAmB,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;CAgCpG"}
@@ -1,5 +0,0 @@
1
- export declare const VERSION: string;
2
- export declare const NAME = "@sentry/instrumentation-prisma";
3
- export declare const MODULE_NAME = "@prisma/client";
4
- export declare const SUPPORTED_MODULE_VERSIONS: string[];
5
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/prisma/vendored/constants.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,OAAO,QAAc,CAAC;AAEnC,eAAO,MAAM,IAAI,mCAAmC,CAAC;AAErD,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAE5C,eAAO,MAAM,yBAAyB,UAAc,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { TracingHelper } from './types';
2
- export declare function getGlobalTracingHelper(): TracingHelper | undefined;
3
- export declare function setGlobalTracingHelper(helper: TracingHelper): void;
4
- export declare function clearGlobalTracingHelper(): void;
5
- //# sourceMappingURL=global.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/prisma/vendored/global.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAoC,aAAa,EAAE,MAAM,SAAS,CAAC;AAe/E,wBAAgB,sBAAsB,IAAI,aAAa,GAAG,SAAS,CAUlE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAKlE;AAED,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C"}
@@ -1,15 +0,0 @@
1
- import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
- import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
- export interface PrismaInstrumentationConfig {
4
- ignoreSpanTypes?: (string | RegExp)[];
5
- }
6
- type Config = PrismaInstrumentationConfig & InstrumentationConfig;
7
- export declare class PrismaInstrumentation extends InstrumentationBase {
8
- constructor(config?: Config);
9
- init(): InstrumentationNodeModuleDefinition[];
10
- enable(): void;
11
- disable(): void;
12
- isEnabled(): boolean;
13
- }
14
- export {};
15
- //# sourceMappingURL=instrumentation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/prisma/vendored/instrumentation.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAK1G,MAAM,WAAW,2BAA2B;IAC1C,eAAe,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACvC;AAED,KAAK,MAAM,GAAG,2BAA2B,GAAG,qBAAqB,CAAC;AAElE,qBAAa,qBAAsB,SAAQ,mBAAmB;gBACzC,MAAM,GAAE,MAAW;IAI/B,IAAI,IAAI,mCAAmC,EAAE;IAM7C,MAAM,IAAI,IAAI;IAUd,OAAO,IAAI,IAAI;IAIf,SAAS,IAAI,OAAO;CAG5B"}
@@ -1,34 +0,0 @@
1
- import type { SpanOptions } from '@opentelemetry/api';
2
- import type { Span } from '@sentry/core';
3
- export type SpanCallback<R> = (span?: Span, parentSpan?: Span) => R;
4
- export interface ExtendedSpanOptions extends SpanOptions {
5
- /** The name of the span */
6
- name: string;
7
- internal?: boolean;
8
- /** Whether it propagates context (?=true) */
9
- active?: boolean;
10
- }
11
- export type EngineSpanId = string;
12
- export type HrTime = [number, number];
13
- export type EngineSpanKind = 'client' | 'internal';
14
- export type EngineSpan = {
15
- id: EngineSpanId;
16
- parentId: string | null;
17
- name: string;
18
- startTime: HrTime;
19
- endTime: HrTime;
20
- kind: EngineSpanKind;
21
- attributes?: Record<string, unknown>;
22
- links?: EngineSpanId[];
23
- };
24
- export interface TracingHelper {
25
- isEnabled(): boolean;
26
- getTraceParent(span?: Span): string;
27
- dispatchEngineSpans(spans: EngineSpan[]): void;
28
- getActiveContext(): Span | undefined;
29
- runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R;
30
- }
31
- export interface PrismaInstrumentationGlobalValue {
32
- helper?: TracingHelper;
33
- }
34
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/prisma/vendored/types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAA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AC,CAAC;CAC9F;AAED,MAAM,WAAW,gCAAgC;IAC/C,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB"}
@@ -1,38 +0,0 @@
1
- import type { Context, Span, SpanOptions } from '@opentelemetry/api';
2
- type V5SpanCallback<R> = (span?: Span, context?: Context) => R;
3
- type V5ExtendedSpanOptions = SpanOptions & {
4
- name: string;
5
- internal?: boolean;
6
- middleware?: boolean;
7
- active?: boolean;
8
- context?: Context;
9
- };
10
- type EngineSpanEvent = {
11
- span: boolean;
12
- spans: V5EngineSpan[];
13
- };
14
- type V5EngineSpanKind = 'client' | 'internal';
15
- type V5EngineSpan = {
16
- span: boolean;
17
- name: string;
18
- trace_id: string;
19
- span_id: string;
20
- parent_span_id: string;
21
- start_time: [number, number];
22
- end_time: [number, number];
23
- attributes?: Record<string, string>;
24
- links?: {
25
- trace_id: string;
26
- span_id: string;
27
- }[];
28
- kind: V5EngineSpanKind;
29
- };
30
- export interface PrismaV5TracingHelper {
31
- isEnabled(): boolean;
32
- getTraceParent(context?: Context): string;
33
- createEngineSpan(engineSpanEvent: EngineSpanEvent): void;
34
- getActiveContext(): Context | undefined;
35
- runInChildSpan<R>(nameOrOptions: string | V5ExtendedSpanOptions, callback: V5SpanCallback<R>): R;
36
- }
37
- export {};
38
- //# sourceMappingURL=v5-tracing-helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v5-tracing-helper.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/prisma/vendored/v5-tracing-helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAErE,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC;AAE/D,KAAK,qBAAqB,GAAG,WAAW,GAAG;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CA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context?: Context) => R;
3
- type V6ExtendedSpanOptions = SpanOptions & {
4
- name: string;
5
- internal?: boolean;
6
- middleware?: boolean;
7
- active?: boolean;
8
- context?: Context;
9
- };
10
- type V6EngineSpanId = string;
11
- type V6HrTime = [number, number];
12
- type EngineSpanKind = 'client' | 'internal';
13
- type PrismaV6EngineSpan = {
14
- id: V6EngineSpanId;
15
- parentId: string | null;
16
- name: string;
17
- startTime: V6HrTime;
18
- endTime: V6HrTime;
19
- kind: EngineSpanKind;
20
- attributes?: Record<string, unknown>;
21
- links?: V6EngineSpanId[];
22
- };
23
- export interface PrismaV6TracingHelper {
24
- isEnabled(): boolean;
25
- getTraceParent(context?: Context): string;
26
- dispatchEngineSpans(spans: PrismaV6EngineSpan[]): void;
27
- getActiveContext(): Context | undefined;
28
- runInChildSpan<R>(nameOrOptions: string | V6ExtendedSpanOptions, callback: V6SpanCallback<R>): R;
29
- }
30
- export {};
31
- //# sourceMappingURL=v6-tracing-helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v6-tracing-helper.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/prisma/vendored/v6-tracing-helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAErE,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC;AAE/D,KAAK,qBAAqB,GAAG,WAAW,GAAG;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,cAAc,GAAG,MAAM,CAAC;AAE7B,KAAK,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjC,KAAK,cAAc,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE5C,KAAK,kBAAkB,GAAG;IACxB,EAAE,EAAE,cAAc,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,QAAQ,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,SAAS,IAAI,OAAO,CAAC;IACrB,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1C,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC;IACvD,gBAAgB,IAAI,OAAO,GAAG,SAAS,CAAC;IACxC,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,qBAAqB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAClG"}
@@ -1,34 +0,0 @@
1
- import { Instrumentation } from '@opentelemetry/instrumentation';
2
- import { PrismaInstrumentation } from './vendored/instrumentation';
3
- interface PrismaOptions {
4
- /**
5
- * @deprecated This is no longer used, v5 works out of the box.
6
- */
7
- prismaInstrumentation?: Instrumentation;
8
- /**
9
- * Configuration passed through to the {@link PrismaInstrumentation} constructor.
10
- */
11
- instrumentationConfig?: ConstructorParameters<typeof PrismaInstrumentation>[0];
12
- }
13
- export declare const instrumentPrisma: ((options?: PrismaOptions | undefined) => Instrumentation<import("@opentelemetry/instrumentation").InstrumentationConfig>) & {
14
- id: string;
15
- };
16
- /**
17
- * Adds Sentry tracing instrumentation for the [prisma](https://www.npmjs.com/package/prisma) library.
18
- * For more information, see the [`prismaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/).
19
- *
20
- * NOTE: This integration works out of the box with Prisma v6, and v7.
21
- * On Prisma versions prior to v6, add `previewFeatures = ["tracing"]` to the client generator block of your Prisma schema:
22
- *
23
- * ```
24
- * generator client {
25
- * provider = "prisma-client-js"
26
- * previewFeatures = ["tracing"]
27
- * }
28
- * ```
29
- */
30
- export declare const prismaIntegration: (options?: PrismaOptions | undefined) => import("@sentry/core").Integration & {
31
- name: "Prisma";
32
- };
33
- export {};
34
- //# sourceMappingURL=index.d.ts.map
@@ -1,16 +0,0 @@
1
- import { Span } from '@sentry/core';
2
- import { EngineSpan, ExtendedSpanOptions, SpanCallback, TracingHelper } from './types';
3
- type Options = {
4
- ignoreSpanTypes: (string | RegExp)[];
5
- };
6
- export declare class ActiveTracingHelper implements TracingHelper {
7
- private ignoreSpanTypes;
8
- constructor({ ignoreSpanTypes }: Options);
9
- isEnabled(): boolean;
10
- getTraceParent(span?: Span): string;
11
- dispatchEngineSpans(spans: EngineSpan[]): void;
12
- getActiveContext(): Span | undefined;
13
- runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R;
14
- }
15
- export {};
16
- //# sourceMappingURL=active-tracing-helper.d.ts.map
@@ -1,5 +0,0 @@
1
- export declare const VERSION: string;
2
- export declare const NAME = "@sentry/instrumentation-prisma";
3
- export declare const MODULE_NAME = "@prisma/client";
4
- export declare const SUPPORTED_MODULE_VERSIONS: string[];
5
- //# sourceMappingURL=constants.d.ts.map
@@ -1,5 +0,0 @@
1
- import { TracingHelper } from './types';
2
- export declare function getGlobalTracingHelper(): TracingHelper | undefined;
3
- export declare function setGlobalTracingHelper(helper: TracingHelper): void;
4
- export declare function clearGlobalTracingHelper(): void;
5
- //# sourceMappingURL=global.d.ts.map
@@ -1,15 +0,0 @@
1
- import { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
- import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
- export interface PrismaInstrumentationConfig {
4
- ignoreSpanTypes?: (string | RegExp)[];
5
- }
6
- type Config = PrismaInstrumentationConfig & InstrumentationConfig;
7
- export declare class PrismaInstrumentation extends InstrumentationBase {
8
- constructor(config?: Config);
9
- init(): InstrumentationNodeModuleDefinition[];
10
- enable(): void;
11
- disable(): void;
12
- isEnabled(): boolean;
13
- }
14
- export {};
15
- //# sourceMappingURL=instrumentation.d.ts.map
@@ -1,37 +0,0 @@
1
- import { SpanOptions } from '@opentelemetry/api';
2
- import { Span } from '@sentry/core';
3
- export type SpanCallback<R> = (span?: Span, parentSpan?: Span) => R;
4
- export interface ExtendedSpanOptions extends SpanOptions {
5
- /** The name of the span */
6
- name: string;
7
- internal?: boolean;
8
- /** Whether it propagates context (?=true) */
9
- active?: boolean;
10
- }
11
- export type EngineSpanId = string;
12
- export type HrTime = [
13
- number,
14
- number
15
- ];
16
- export type EngineSpanKind = 'client' | 'internal';
17
- export type EngineSpan = {
18
- id: EngineSpanId;
19
- parentId: string | null;
20
- name: string;
21
- startTime: HrTime;
22
- endTime: HrTime;
23
- kind: EngineSpanKind;
24
- attributes?: Record<string, unknown>;
25
- links?: EngineSpanId[];
26
- };
27
- export interface TracingHelper {
28
- isEnabled(): boolean;
29
- getTraceParent(span?: Span): string;
30
- dispatchEngineSpans(spans: EngineSpan[]): void;
31
- getActiveContext(): Span | undefined;
32
- runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R;
33
- }
34
- export interface PrismaInstrumentationGlobalValue {
35
- helper?: TracingHelper;
36
- }
37
- //# sourceMappingURL=types.d.ts.map