@sentry/node 9.0.1 → 9.1.1-alpha.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 (49) hide show
  1. package/build/cjs/index.js +22 -22
  2. package/build/cjs/integrations/anr/index.js +1 -1
  3. package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
  4. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +272 -0
  5. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +1 -0
  6. package/build/cjs/integrations/node-fetch/index.js +85 -0
  7. package/build/cjs/integrations/node-fetch/index.js.map +1 -0
  8. package/build/cjs/nodeVersion.js +2 -0
  9. package/build/cjs/nodeVersion.js.map +1 -1
  10. package/build/cjs/sdk/index.js +6 -6
  11. package/build/cjs/sdk/index.js.map +1 -1
  12. package/build/cjs/utils/baggage.js +36 -0
  13. package/build/cjs/utils/baggage.js.map +1 -0
  14. package/build/esm/index.js +1 -1
  15. package/build/esm/integrations/anr/index.js +1 -1
  16. package/build/esm/integrations/anr/worker-script.js +2 -2
  17. package/build/esm/integrations/local-variables/local-variables-async.js +1 -1
  18. package/build/esm/integrations/local-variables/worker-script.js +2 -2
  19. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +270 -0
  20. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +1 -0
  21. package/build/esm/integrations/node-fetch/index.js +83 -0
  22. package/build/esm/integrations/node-fetch/index.js.map +1 -0
  23. package/build/esm/nodeVersion.js +2 -1
  24. package/build/esm/nodeVersion.js.map +1 -1
  25. package/build/esm/package.json +1 -1
  26. package/build/esm/sdk/index.js +1 -1
  27. package/build/esm/utils/baggage.js +34 -0
  28. package/build/esm/utils/baggage.js.map +1 -0
  29. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +51 -0
  30. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +1 -0
  31. package/build/{types-ts3.8/integrations/node-fetch.d.ts → types/integrations/node-fetch/index.d.ts} +23 -15
  32. package/build/types/integrations/node-fetch/index.d.ts.map +1 -0
  33. package/build/types/integrations/node-fetch/types.d.ts +32 -0
  34. package/build/types/integrations/node-fetch/types.d.ts.map +1 -0
  35. package/build/types/nodeVersion.d.ts +1 -0
  36. package/build/types/nodeVersion.d.ts.map +1 -1
  37. package/build/types/utils/baggage.d.ts +6 -0
  38. package/build/types/utils/baggage.d.ts.map +1 -0
  39. package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +51 -0
  40. package/build/{types/integrations/node-fetch.d.ts → types-ts3.8/integrations/node-fetch/index.d.ts} +23 -15
  41. package/build/types-ts3.8/integrations/node-fetch/types.d.ts +31 -0
  42. package/build/types-ts3.8/nodeVersion.d.ts +1 -0
  43. package/build/types-ts3.8/utils/baggage.d.ts +6 -0
  44. package/package.json +4 -4
  45. package/build/cjs/integrations/node-fetch.js +0 -132
  46. package/build/cjs/integrations/node-fetch.js.map +0 -1
  47. package/build/esm/integrations/node-fetch.js +0 -130
  48. package/build/esm/integrations/node-fetch.js.map +0 -1
  49. package/build/types/integrations/node-fetch.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/integrations/node-fetch/index.ts"],"sourcesContent":["import type { UndiciInstrumentationConfig } from '@opentelemetry/instrumentation-undici';\nimport { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici';\nimport type { IntegrationFn } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, defineIntegration, getClient } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport type { NodeClient } from '../../sdk/client';\nimport type { NodeClientOptions } from '../../types';\nimport type { SentryNodeFetchInstrumentationOptions } from './SentryNodeFetchInstrumentation';\nimport { SentryNodeFetchInstrumentation } from './SentryNodeFetchInstrumentation';\n\nconst INTEGRATION_NAME = 'NodeFetch';\n\ninterface NodeFetchOptions {\n /**\n * Whether breadcrumbs should be recorded for requests.\n * Defaults to true\n */\n breadcrumbs?: boolean;\n\n /**\n * If set to false, do not emit any spans.\n * This will ensure that the default UndiciInstrumentation from OpenTelemetry is not setup,\n * only the Sentry-specific instrumentation for breadcrumbs & trace propagation is applied.\n *\n * If `skipOpenTelemetrySetup: true` is configured, this defaults to `false`, otherwise it defaults to `true`.\n */\n spans?: boolean;\n\n /**\n * Do not capture spans or breadcrumbs for outgoing fetch requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n */\n ignoreOutgoingRequests?: (url: string) => boolean;\n}\n\nconst instrumentOtelNodeFetch = generateInstrumentOnce<UndiciInstrumentationConfig>(INTEGRATION_NAME, config => {\n return new UndiciInstrumentation(config);\n});\n\nconst instrumentSentryNodeFetch = generateInstrumentOnce<SentryNodeFetchInstrumentationOptions>(\n `${INTEGRATION_NAME}.sentry`,\n config => {\n return new SentryNodeFetchInstrumentation(config);\n },\n);\n\nconst _nativeNodeFetchIntegration = ((options: NodeFetchOptions = {}) => {\n return {\n name: 'NodeFetch',\n setupOnce() {\n const instrumentSpans = _shouldInstrumentSpans(options, getClient<NodeClient>()?.getOptions());\n\n // This is the \"regular\" OTEL instrumentation that emits spans\n if (instrumentSpans) {\n const instrumentationConfig = getConfigWithDefaults(options);\n instrumentOtelNodeFetch(instrumentationConfig);\n }\n\n // This is the Sentry-specific instrumentation that creates breadcrumbs & propagates traces\n // This must be registered after the OTEL one, to ensure that the core trace propagation logic takes presedence\n // Otherwise, the sentry-trace header may be set multiple times\n instrumentSentryNodeFetch(options);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const nativeNodeFetchIntegration = defineIntegration(_nativeNodeFetchIntegration);\n\n// Matching the behavior of the base instrumentation\nfunction getAbsoluteUrl(origin: string, path: string = '/'): string {\n const url = `${origin}`;\n\n if (url.endsWith('/') && path.startsWith('/')) {\n return `${url}${path.slice(1)}`;\n }\n\n if (!url.endsWith('/') && !path.startsWith('/')) {\n return `${url}/${path.slice(1)}`;\n }\n\n return `${url}${path}`;\n}\n\nfunction _shouldInstrumentSpans(options: NodeFetchOptions, clientOptions: Partial<NodeClientOptions> = {}): boolean {\n // If `spans` is passed in, it takes precedence\n // Else, we by default emit spans, unless `skipOpenTelemetrySetup` is set to `true`\n return typeof options.spans === 'boolean' ? options.spans : !clientOptions.skipOpenTelemetrySetup;\n}\n\nfunction getConfigWithDefaults(options: Partial<NodeFetchOptions> = {}): UndiciInstrumentationConfig {\n const instrumentationConfig = {\n requireParentforSpans: false,\n ignoreRequestHook: request => {\n const url = getAbsoluteUrl(request.origin, request.path);\n const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;\n const shouldIgnore = _ignoreOutgoingRequests && url && _ignoreOutgoingRequests(url);\n\n return !!shouldIgnore;\n },\n startSpanHook: () => {\n return {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.node_fetch',\n };\n },\n } satisfies UndiciInstrumentationConfig;\n\n return instrumentationConfig;\n}\n"],"names":[],"mappings":";;;;;AAUA,MAAM,gBAAA,GAAmB,WAAW;;AAyBpC,MAAM,0BAA0B,sBAAsB,CAA8B,gBAAgB,EAAE,UAAU;AAChH,EAAE,OAAO,IAAI,qBAAqB,CAAC,MAAM,CAAC;AAC1C,CAAC,CAAC;;AAEF,MAAM,yBAAA,GAA4B,sBAAsB;AACxD,EAAE,CAAC,EAAA,gBAAA,CAAA,OAAA,CAAA;AACA,EAAA,MAAA,IAAA;AACA,IAAA,OAAA,IAAA,8BAAA,CAAA,MAAA,CAAA;AACA,GAAA;AACA,CAAA;;AAEA,MAAA,2BAAA,IAAA,CAAA,OAAA,GAAA,EAAA,KAAA;AACA,EAAA,OAAA;AACA,IAAA,IAAA,EAAA,WAAA;AACA,IAAA,SAAA,GAAA;AACA,MAAA,MAAA,eAAA,GAAA,sBAAA,CAAA,OAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,CAAA;;AAE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MAAA,GAAA,GAAA,cAAA,CAAA,OAAA,CAAA,MAAA,EAAA,OAAA,CAAA,IAAA,CAAA;AACA,MAAA,MAAA,uBAAA,GAAA,OAAA,CAAA,sBAAA;AACA,MAAA,MAAA,YAAA,GAAA,uBAAA,IAAA,GAAA,IAAA,uBAAA,CAAA,GAAA,CAAA;;AAEA,MAAA,OAAA,CAAA,CAAA,YAAA;AACA,KAAA;AACA,IAAA,aAAA,EAAA,MAAA;AACA,MAAA,OAAA;AACA,QAAA,CAAA,gCAAA,GAAA,2BAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA;;AAEA,EAAA,OAAA,qBAAA;AACA;;;;"}
@@ -2,6 +2,7 @@ import { parseSemver } from '@sentry/core';
2
2
 
3
3
  const NODE_VERSION = parseSemver(process.versions.node) ;
4
4
  const NODE_MAJOR = NODE_VERSION.major;
5
+ const NODE_MINOR = NODE_VERSION.minor;
5
6
 
6
- export { NODE_MAJOR, NODE_VERSION };
7
+ export { NODE_MAJOR, NODE_MINOR, NODE_VERSION };
7
8
  //# sourceMappingURL=nodeVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeVersion.js","sources":["../../src/nodeVersion.ts"],"sourcesContent":["import { parseSemver } from '@sentry/core';\n\nexport const NODE_VERSION = parseSemver(process.versions.node) as { major: number; minor: number; patch: number };\nexport const NODE_MAJOR = NODE_VERSION.major;\n"],"names":[],"mappings":";;AAEO,MAAM,YAAa,GAAE,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAE;AAClD,MAAA,UAAA,GAAa,YAAY,CAAC;;;;"}
1
+ {"version":3,"file":"nodeVersion.js","sources":["../../src/nodeVersion.ts"],"sourcesContent":["import { parseSemver } from '@sentry/core';\n\nexport const NODE_VERSION = parseSemver(process.versions.node) as { major: number; minor: number; patch: number };\nexport const NODE_MAJOR = NODE_VERSION.major;\nexport const NODE_MINOR = NODE_VERSION.minor;\n"],"names":[],"mappings":";;AAEO,MAAM,YAAa,GAAE,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAE;AAClD,MAAA,UAAA,GAAa,YAAY,CAAC;AAC1B,MAAA,UAAA,GAAa,YAAY,CAAC;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"9.0.1","sideEffects":false}
1
+ {"type":"module","version":"9.1.1-alpha.0","sideEffects":false}
@@ -8,7 +8,7 @@ import { contextLinesIntegration } from '../integrations/contextlines.js';
8
8
  import { httpIntegration } from '../integrations/http/index.js';
9
9
  import { localVariablesIntegration } from '../integrations/local-variables/index.js';
10
10
  import { modulesIntegration } from '../integrations/modules.js';
11
- import { nativeNodeFetchIntegration } from '../integrations/node-fetch.js';
11
+ import { nativeNodeFetchIntegration } from '../integrations/node-fetch/index.js';
12
12
  import { onUncaughtExceptionIntegration } from '../integrations/onuncaughtexception.js';
13
13
  import { onUnhandledRejectionIntegration } from '../integrations/onunhandledrejection.js';
14
14
  import { processSessionIntegration } from '../integrations/processSession.js';
@@ -0,0 +1,34 @@
1
+ import { parseBaggageHeader, objectToBaggageHeader } from '@sentry/core';
2
+
3
+ /**
4
+ * Merge two baggage headers into one, where the existing one takes precedence.
5
+ * The order of the existing baggage will be preserved, and new entries will be added to the end.
6
+ */
7
+ function mergeBaggageHeaders(
8
+ existing,
9
+ baggage,
10
+ ) {
11
+ if (!existing) {
12
+ return baggage;
13
+ }
14
+
15
+ const existingBaggageEntries = parseBaggageHeader(existing);
16
+ const newBaggageEntries = parseBaggageHeader(baggage);
17
+
18
+ if (!newBaggageEntries) {
19
+ return existing;
20
+ }
21
+
22
+ // Existing entries take precedence, ensuring order remains stable for minimal changes
23
+ const mergedBaggageEntries = { ...existingBaggageEntries };
24
+ Object.entries(newBaggageEntries).forEach(([key, value]) => {
25
+ if (!mergedBaggageEntries[key]) {
26
+ mergedBaggageEntries[key] = value;
27
+ }
28
+ });
29
+
30
+ return objectToBaggageHeader(mergedBaggageEntries);
31
+ }
32
+
33
+ export { mergeBaggageHeaders };
34
+ //# sourceMappingURL=baggage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baggage.js","sources":["../../../src/utils/baggage.ts"],"sourcesContent":["import { objectToBaggageHeader, parseBaggageHeader } from '@sentry/core';\n\n/**\n * Merge two baggage headers into one, where the existing one takes precedence.\n * The order of the existing baggage will be preserved, and new entries will be added to the end.\n */\nexport function mergeBaggageHeaders<Existing extends string | string[] | number | undefined>(\n existing: Existing,\n baggage: string,\n): string | undefined | Existing {\n if (!existing) {\n return baggage;\n }\n\n const existingBaggageEntries = parseBaggageHeader(existing);\n const newBaggageEntries = parseBaggageHeader(baggage);\n\n if (!newBaggageEntries) {\n return existing;\n }\n\n // Existing entries take precedence, ensuring order remains stable for minimal changes\n const mergedBaggageEntries = { ...existingBaggageEntries };\n Object.entries(newBaggageEntries).forEach(([key, value]) => {\n if (!mergedBaggageEntries[key]) {\n mergedBaggageEntries[key] = value;\n }\n });\n\n return objectToBaggageHeader(mergedBaggageEntries);\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACO,SAAS,mBAAmB;AACnC,EAAE,QAAQ;AACV,EAAE,OAAO;AACT,EAAiC;AACjC,EAAE,IAAI,CAAC,QAAQ,EAAE;AACjB,IAAI,OAAO,OAAO;AAClB;;AAEA,EAAE,MAAM,sBAAuB,GAAE,kBAAkB,CAAC,QAAQ,CAAC;AAC7D,EAAE,MAAM,iBAAkB,GAAE,kBAAkB,CAAC,OAAO,CAAC;;AAEvD,EAAE,IAAI,CAAC,iBAAiB,EAAE;AAC1B,IAAI,OAAO,QAAQ;AACnB;;AAEA;AACA,EAAE,MAAM,oBAAqB,GAAE,EAAE,GAAG,wBAAwB;AAC5D,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AAC9D,IAAI,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE;AACpC,MAAM,oBAAoB,CAAC,GAAG,CAAA,GAAI,KAAK;AACvC;AACA,GAAG,CAAC;;AAEJ,EAAE,OAAO,qBAAqB,CAAC,oBAAoB,CAAC;AACpD;;;;"}
@@ -0,0 +1,51 @@
1
+ import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationBase } from '@opentelemetry/instrumentation';
3
+ export type SentryNodeFetchInstrumentationOptions = InstrumentationConfig & {
4
+ /**
5
+ * Whether breadcrumbs should be recorded for requests.
6
+ *
7
+ * @default `true`
8
+ */
9
+ breadcrumbs?: boolean;
10
+ /**
11
+ * Do not capture breadcrumbs or inject headers for outgoing fetch requests to URLs where the given callback returns `true`.
12
+ * The same option can be passed to the top-level httpIntegration where it controls both, breadcrumb and
13
+ * span creation.
14
+ *
15
+ * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
16
+ */
17
+ ignoreOutgoingRequests?: (url: string) => boolean;
18
+ };
19
+ /**
20
+ * This custom node-fetch instrumentation is used to instrument outgoing fetch requests.
21
+ * It does not emit any spans.
22
+ *
23
+ * The reason this is isolated from the OpenTelemetry instrumentation is that users may overwrite this,
24
+ * which would lead to Sentry not working as expected.
25
+ *
26
+ * This is heavily inspired & adapted from:
27
+ * https://github.com/open-telemetry/opentelemetry-js-contrib/blob/28e209a9da36bc4e1f8c2b0db7360170ed46cb80/plugins/node/instrumentation-undici/src/undici.ts
28
+ */
29
+ export declare class SentryNodeFetchInstrumentation extends InstrumentationBase<SentryNodeFetchInstrumentationOptions> {
30
+ private _channelSubs;
31
+ private _propagationDecisionMap;
32
+ constructor(config?: SentryNodeFetchInstrumentationOptions);
33
+ /** No need to instrument files/modules. */
34
+ init(): void;
35
+ /** Disable the instrumentation. */
36
+ disable(): void;
37
+ /** Enable the instrumentation. */
38
+ enable(): void;
39
+ /**
40
+ * This method is called when a request is created.
41
+ * You can still mutate the request here before it is sent.
42
+ */
43
+ private _onRequestCreated;
44
+ /**
45
+ * This method is called when a response is received.
46
+ */
47
+ private _onResponseHeaders;
48
+ /** Subscribe to a diagnostics channel. */
49
+ private _subscribeToChannel;
50
+ }
51
+ //# sourceMappingURL=SentryNodeFetchInstrumentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SentryNodeFetchInstrumentation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/node-fetch/SentryNodeFetchInstrumentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAgBrE,MAAM,MAAM,qCAAqC,GAAG,qBAAqB,GAAG;IAC1E;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnD,CAAC;AAOF;;;;;;;;;GASG;AACH,qBAAa,8BAA+B,SAAQ,mBAAmB,CAAC,qCAAqC,CAAC;IAG5G,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,uBAAuB,CAA0B;gBAEtC,MAAM,GAAE,qCAA0C;IAMrE,2CAA2C;IACpC,IAAI,IAAI,IAAI;IAInB,mCAAmC;IAC5B,OAAO,IAAI,IAAI;IAMtB,kCAAkC;IAC3B,MAAM,IAAI,IAAI;IAyBrB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAyEzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAsB1B,0CAA0C;IAC1C,OAAO,CAAC,mBAAmB;CAuB5B"}
@@ -1,15 +1,23 @@
1
- interface NodeFetchOptions {
2
- /**
3
- * Whether breadcrumbs should be recorded for requests.
4
- * Defaults to true
5
- */
6
- breadcrumbs?: boolean;
7
- /**
8
- * Do not capture spans or breadcrumbs for outgoing fetch requests to URLs where the given callback returns `true`.
9
- * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
10
- */
11
- ignoreOutgoingRequests?: (url: string) => boolean;
12
- }
13
- export declare const nativeNodeFetchIntegration: (options?: NodeFetchOptions | undefined) => import("@sentry/core").Integration;
14
- export {};
15
- //# sourceMappingURL=node-fetch.d.ts.map
1
+ interface NodeFetchOptions {
2
+ /**
3
+ * Whether breadcrumbs should be recorded for requests.
4
+ * Defaults to true
5
+ */
6
+ breadcrumbs?: boolean;
7
+ /**
8
+ * If set to false, do not emit any spans.
9
+ * This will ensure that the default UndiciInstrumentation from OpenTelemetry is not setup,
10
+ * only the Sentry-specific instrumentation for breadcrumbs & trace propagation is applied.
11
+ *
12
+ * If `skipOpenTelemetrySetup: true` is configured, this defaults to `false`, otherwise it defaults to `true`.
13
+ */
14
+ spans?: boolean;
15
+ /**
16
+ * Do not capture spans or breadcrumbs for outgoing fetch requests to URLs where the given callback returns `true`.
17
+ * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
18
+ */
19
+ ignoreOutgoingRequests?: (url: string) => boolean;
20
+ }
21
+ export declare const nativeNodeFetchIntegration: (options?: NodeFetchOptions | undefined) => import("@sentry/core").Integration;
22
+ export {};
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/node-fetch/index.ts"],"names":[],"mappings":"AAYA,UAAU,gBAAgB;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnD;AAiCD,eAAO,MAAM,0BAA0B,gFAAiD,CAAC"}
@@ -0,0 +1,32 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /**
4
+ * Vendored from https://github.com/open-telemetry/opentelemetry-js-contrib/blob/28e209a9da36bc4e1f8c2b0db7360170ed46cb80/plugins/node/instrumentation-undici/src/types.ts
5
+ */
6
+ export interface UndiciRequest {
7
+ origin: string;
8
+ method: string;
9
+ path: string;
10
+ /**
11
+ * Serialized string of headers in the form `name: value\r\n` for v5
12
+ * Array of strings v6
13
+ */
14
+ headers: string | string[];
15
+ /**
16
+ * Helper method to add headers (from v6)
17
+ */
18
+ addHeader: (name: string, value: string) => void;
19
+ throwOnError: boolean;
20
+ completed: boolean;
21
+ aborted: boolean;
22
+ idempotent: boolean;
23
+ contentLength: number | null;
24
+ contentType: string | null;
25
+ body: unknown;
26
+ }
27
+ export interface UndiciResponse {
28
+ headers: Buffer[];
29
+ statusCode: number;
30
+ statusText: string;
31
+ }
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/integrations/node-fetch/types.ts"],"names":[],"mappings":";;AAgBA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -4,4 +4,5 @@ export declare const NODE_VERSION: {
4
4
  patch: number;
5
5
  };
6
6
  export declare const NODE_MAJOR: number;
7
+ export declare const NODE_MINOR: number;
7
8
  //# sourceMappingURL=nodeVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeVersion.d.ts","sourceRoot":"","sources":["../../src/nodeVersion.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;WAAkD,MAAM;WAAS,MAAM;WAAS,MAAM;CAAE,CAAC;AAClH,eAAO,MAAM,UAAU,QAAqB,CAAC"}
1
+ {"version":3,"file":"nodeVersion.d.ts","sourceRoot":"","sources":["../../src/nodeVersion.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;WAAkD,MAAM;WAAS,MAAM;WAAS,MAAM;CAAE,CAAC;AAClH,eAAO,MAAM,UAAU,QAAqB,CAAC;AAC7C,eAAO,MAAM,UAAU,QAAqB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Merge two baggage headers into one, where the existing one takes precedence.
3
+ * The order of the existing baggage will be preserved, and new entries will be added to the end.
4
+ */
5
+ export declare function mergeBaggageHeaders<Existing extends string | string[] | number | undefined>(existing: Existing, baggage: string): string | undefined | Existing;
6
+ //# sourceMappingURL=baggage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baggage.d.ts","sourceRoot":"","sources":["../../../src/utils/baggage.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,EACzF,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,GAAG,QAAQ,CAqB/B"}
@@ -0,0 +1,51 @@
1
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationBase } from '@opentelemetry/instrumentation';
3
+ export type SentryNodeFetchInstrumentationOptions = InstrumentationConfig & {
4
+ /**
5
+ * Whether breadcrumbs should be recorded for requests.
6
+ *
7
+ * @default `true`
8
+ */
9
+ breadcrumbs?: boolean;
10
+ /**
11
+ * Do not capture breadcrumbs or inject headers for outgoing fetch requests to URLs where the given callback returns `true`.
12
+ * The same option can be passed to the top-level httpIntegration where it controls both, breadcrumb and
13
+ * span creation.
14
+ *
15
+ * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
16
+ */
17
+ ignoreOutgoingRequests?: (url: string) => boolean;
18
+ };
19
+ /**
20
+ * This custom node-fetch instrumentation is used to instrument outgoing fetch requests.
21
+ * It does not emit any spans.
22
+ *
23
+ * The reason this is isolated from the OpenTelemetry instrumentation is that users may overwrite this,
24
+ * which would lead to Sentry not working as expected.
25
+ *
26
+ * This is heavily inspired & adapted from:
27
+ * https://github.com/open-telemetry/opentelemetry-js-contrib/blob/28e209a9da36bc4e1f8c2b0db7360170ed46cb80/plugins/node/instrumentation-undici/src/undici.ts
28
+ */
29
+ export declare class SentryNodeFetchInstrumentation extends InstrumentationBase<SentryNodeFetchInstrumentationOptions> {
30
+ private _channelSubs;
31
+ private _propagationDecisionMap;
32
+ constructor(config?: SentryNodeFetchInstrumentationOptions);
33
+ /** No need to instrument files/modules. */
34
+ init(): void;
35
+ /** Disable the instrumentation. */
36
+ disable(): void;
37
+ /** Enable the instrumentation. */
38
+ enable(): void;
39
+ /**
40
+ * This method is called when a request is created.
41
+ * You can still mutate the request here before it is sent.
42
+ */
43
+ private _onRequestCreated;
44
+ /**
45
+ * This method is called when a response is received.
46
+ */
47
+ private _onResponseHeaders;
48
+ /** Subscribe to a diagnostics channel. */
49
+ private _subscribeToChannel;
50
+ }
51
+ //# sourceMappingURL=SentryNodeFetchInstrumentation.d.ts.map
@@ -1,15 +1,23 @@
1
- interface NodeFetchOptions {
2
- /**
3
- * Whether breadcrumbs should be recorded for requests.
4
- * Defaults to true
5
- */
6
- breadcrumbs?: boolean;
7
- /**
8
- * Do not capture spans or breadcrumbs for outgoing fetch requests to URLs where the given callback returns `true`.
9
- * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
10
- */
11
- ignoreOutgoingRequests?: (url: string) => boolean;
12
- }
13
- export declare const nativeNodeFetchIntegration: (options?: NodeFetchOptions | undefined) => import("@sentry/core").Integration;
14
- export {};
15
- //# sourceMappingURL=node-fetch.d.ts.map
1
+ interface NodeFetchOptions {
2
+ /**
3
+ * Whether breadcrumbs should be recorded for requests.
4
+ * Defaults to true
5
+ */
6
+ breadcrumbs?: boolean;
7
+ /**
8
+ * If set to false, do not emit any spans.
9
+ * This will ensure that the default UndiciInstrumentation from OpenTelemetry is not setup,
10
+ * only the Sentry-specific instrumentation for breadcrumbs & trace propagation is applied.
11
+ *
12
+ * If `skipOpenTelemetrySetup: true` is configured, this defaults to `false`, otherwise it defaults to `true`.
13
+ */
14
+ spans?: boolean;
15
+ /**
16
+ * Do not capture spans or breadcrumbs for outgoing fetch requests to URLs where the given callback returns `true`.
17
+ * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
18
+ */
19
+ ignoreOutgoingRequests?: (url: string) => boolean;
20
+ }
21
+ export declare const nativeNodeFetchIntegration: (options?: NodeFetchOptions | undefined) => import("@sentry/core").Integration;
22
+ export {};
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,31 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * Vendored from https://github.com/open-telemetry/opentelemetry-js-contrib/blob/28e209a9da36bc4e1f8c2b0db7360170ed46cb80/plugins/node/instrumentation-undici/src/types.ts
4
+ */
5
+ export interface UndiciRequest {
6
+ origin: string;
7
+ method: string;
8
+ path: string;
9
+ /**
10
+ * Serialized string of headers in the form `name: value\r\n` for v5
11
+ * Array of strings v6
12
+ */
13
+ headers: string | string[];
14
+ /**
15
+ * Helper method to add headers (from v6)
16
+ */
17
+ addHeader: (name: string, value: string) => void;
18
+ throwOnError: boolean;
19
+ completed: boolean;
20
+ aborted: boolean;
21
+ idempotent: boolean;
22
+ contentLength: number | null;
23
+ contentType: string | null;
24
+ body: unknown;
25
+ }
26
+ export interface UndiciResponse {
27
+ headers: Buffer[];
28
+ statusCode: number;
29
+ statusText: string;
30
+ }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -4,4 +4,5 @@ export declare const NODE_VERSION: {
4
4
  patch: number;
5
5
  };
6
6
  export declare const NODE_MAJOR: number;
7
+ export declare const NODE_MINOR: number;
7
8
  //# sourceMappingURL=nodeVersion.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Merge two baggage headers into one, where the existing one takes precedence.
3
+ * The order of the existing baggage will be preserved, and new entries will be added to the end.
4
+ */
5
+ export declare function mergeBaggageHeaders<Existing extends string | string[] | number | undefined>(existing: Existing, baggage: string): string | undefined | Existing;
6
+ //# sourceMappingURL=baggage.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "9.0.1",
3
+ "version": "9.1.1-alpha.0",
4
4
  "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -88,7 +88,7 @@
88
88
  "@opentelemetry/instrumentation-mongoose": "0.46.0",
89
89
  "@opentelemetry/instrumentation-mysql": "0.45.0",
90
90
  "@opentelemetry/instrumentation-mysql2": "0.45.0",
91
- "@opentelemetry/instrumentation-pg": "0.50.0",
91
+ "@opentelemetry/instrumentation-pg": "0.51.0",
92
92
  "@opentelemetry/instrumentation-redis-4": "0.46.0",
93
93
  "@opentelemetry/instrumentation-tedious": "0.18.0",
94
94
  "@opentelemetry/instrumentation-undici": "0.10.0",
@@ -96,8 +96,8 @@
96
96
  "@opentelemetry/sdk-trace-base": "^1.30.1",
97
97
  "@opentelemetry/semantic-conventions": "^1.28.0",
98
98
  "@prisma/instrumentation": "6.2.1",
99
- "@sentry/core": "9.0.1",
100
- "@sentry/opentelemetry": "9.0.1",
99
+ "@sentry/core": "9.1.1-alpha.0",
100
+ "@sentry/opentelemetry": "9.1.1-alpha.0",
101
101
  "import-in-the-middle": "^1.12.0"
102
102
  },
103
103
  "devDependencies": {
@@ -1,132 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const instrumentation = require('@opentelemetry/instrumentation');
4
- const instrumentationUndici = require('@opentelemetry/instrumentation-undici');
5
- const core = require('@sentry/core');
6
- const opentelemetry = require('@sentry/opentelemetry');
7
-
8
- const _nativeNodeFetchIntegration = ((options = {}) => {
9
- const _breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;
10
- const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;
11
-
12
- return {
13
- name: 'NodeFetch',
14
- setupOnce() {
15
- const propagationDecisionMap = new core.LRUMap(100);
16
-
17
- const instrumentation$1 = new instrumentationUndici.UndiciInstrumentation({
18
- requireParentforSpans: false,
19
- ignoreRequestHook: request => {
20
- const url = getAbsoluteUrl(request.origin, request.path);
21
- const shouldIgnore = _ignoreOutgoingRequests && url && _ignoreOutgoingRequests(url);
22
-
23
- if (shouldIgnore) {
24
- return true;
25
- }
26
-
27
- // If span recording is disabled, we still want to propagate traces
28
- // So we do that manually here, matching what the instrumentation does otherwise
29
- if (!core.hasSpansEnabled()) {
30
- const tracePropagationTargets = core.getClient()?.getOptions().tracePropagationTargets;
31
- const addedHeaders = opentelemetry.shouldPropagateTraceForUrl(url, tracePropagationTargets, propagationDecisionMap)
32
- ? core.getTraceData()
33
- : {};
34
-
35
- const requestHeaders = request.headers;
36
- if (Array.isArray(requestHeaders)) {
37
- Object.entries(addedHeaders).forEach(headers => requestHeaders.push(...headers));
38
- } else {
39
- request.headers += Object.entries(addedHeaders)
40
- .map(([k, v]) => `${k}: ${v}\r\n`)
41
- .join('');
42
- }
43
-
44
- // Prevent starting a span for this request
45
- return true;
46
- }
47
-
48
- return false;
49
- },
50
- startSpanHook: () => {
51
- return {
52
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.node_fetch',
53
- };
54
- },
55
- responseHook: (_, { request, response }) => {
56
- if (_breadcrumbs) {
57
- addRequestBreadcrumb(request, response);
58
- }
59
- },
60
- });
61
-
62
- instrumentation.registerInstrumentations({ instrumentations: [instrumentation$1] });
63
- },
64
- };
65
- }) ;
66
-
67
- const nativeNodeFetchIntegration = core.defineIntegration(_nativeNodeFetchIntegration);
68
-
69
- /** Add a breadcrumb for outgoing requests. */
70
- function addRequestBreadcrumb(request, response) {
71
- const data = getBreadcrumbData(request);
72
- const statusCode = response.statusCode;
73
- const level = core.getBreadcrumbLogLevelFromHttpStatusCode(statusCode);
74
-
75
- core.addBreadcrumb(
76
- {
77
- category: 'http',
78
- data: {
79
- status_code: statusCode,
80
- ...data,
81
- },
82
- type: 'http',
83
- level,
84
- },
85
- {
86
- event: 'response',
87
- request,
88
- response,
89
- },
90
- );
91
- }
92
-
93
- function getBreadcrumbData(request) {
94
- try {
95
- const url = new URL(request.path, request.origin);
96
- const parsedUrl = core.parseUrl(url.toString());
97
-
98
- const data = {
99
- url: core.getSanitizedUrlString(parsedUrl),
100
- 'http.method': request.method || 'GET',
101
- };
102
-
103
- if (parsedUrl.search) {
104
- data['http.query'] = parsedUrl.search;
105
- }
106
- if (parsedUrl.hash) {
107
- data['http.fragment'] = parsedUrl.hash;
108
- }
109
-
110
- return data;
111
- } catch {
112
- return {};
113
- }
114
- }
115
-
116
- // Matching the behavior of the base instrumentation
117
- function getAbsoluteUrl(origin, path = '/') {
118
- const url = `${origin}`;
119
-
120
- if (url.endsWith('/') && path.startsWith('/')) {
121
- return `${url}${path.slice(1)}`;
122
- }
123
-
124
- if (!url.endsWith('/') && !path.startsWith('/')) {
125
- return `${url}/${path.slice(1)}`;
126
- }
127
-
128
- return `${url}${path}`;
129
- }
130
-
131
- exports.nativeNodeFetchIntegration = nativeNodeFetchIntegration;
132
- //# sourceMappingURL=node-fetch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-fetch.js","sources":["../../../src/integrations/node-fetch.ts"],"sourcesContent":["import { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport type { UndiciRequest, UndiciResponse } from '@opentelemetry/instrumentation-undici';\nimport { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici';\nimport type { IntegrationFn, SanitizedRequestData } from '@sentry/core';\nimport {\n LRUMap,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n addBreadcrumb,\n defineIntegration,\n getBreadcrumbLogLevelFromHttpStatusCode,\n getClient,\n getSanitizedUrlString,\n getTraceData,\n hasSpansEnabled,\n parseUrl,\n} from '@sentry/core';\nimport { shouldPropagateTraceForUrl } from '@sentry/opentelemetry';\n\ninterface NodeFetchOptions {\n /**\n * Whether breadcrumbs should be recorded for requests.\n * Defaults to true\n */\n breadcrumbs?: boolean;\n\n /**\n * Do not capture spans or breadcrumbs for outgoing fetch requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n */\n ignoreOutgoingRequests?: (url: string) => boolean;\n}\n\nconst _nativeNodeFetchIntegration = ((options: NodeFetchOptions = {}) => {\n const _breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;\n\n return {\n name: 'NodeFetch',\n setupOnce() {\n const propagationDecisionMap = new LRUMap<string, boolean>(100);\n\n const instrumentation = new UndiciInstrumentation({\n requireParentforSpans: false,\n ignoreRequestHook: request => {\n const url = getAbsoluteUrl(request.origin, request.path);\n const shouldIgnore = _ignoreOutgoingRequests && url && _ignoreOutgoingRequests(url);\n\n if (shouldIgnore) {\n return true;\n }\n\n // If span recording is disabled, we still want to propagate traces\n // So we do that manually here, matching what the instrumentation does otherwise\n if (!hasSpansEnabled()) {\n const tracePropagationTargets = getClient()?.getOptions().tracePropagationTargets;\n const addedHeaders = shouldPropagateTraceForUrl(url, tracePropagationTargets, propagationDecisionMap)\n ? getTraceData()\n : {};\n\n const requestHeaders = request.headers;\n if (Array.isArray(requestHeaders)) {\n Object.entries(addedHeaders).forEach(headers => requestHeaders.push(...headers));\n } else {\n request.headers += Object.entries(addedHeaders)\n .map(([k, v]) => `${k}: ${v}\\r\\n`)\n .join('');\n }\n\n // Prevent starting a span for this request\n return true;\n }\n\n return false;\n },\n startSpanHook: () => {\n return {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.node_fetch',\n };\n },\n responseHook: (_, { request, response }) => {\n if (_breadcrumbs) {\n addRequestBreadcrumb(request, response);\n }\n },\n });\n\n registerInstrumentations({ instrumentations: [instrumentation] });\n },\n };\n}) satisfies IntegrationFn;\n\nexport const nativeNodeFetchIntegration = defineIntegration(_nativeNodeFetchIntegration);\n\n/** Add a breadcrumb for outgoing requests. */\nfunction addRequestBreadcrumb(request: UndiciRequest, response: UndiciResponse): void {\n const data = getBreadcrumbData(request);\n const statusCode = response.statusCode;\n const level = getBreadcrumbLogLevelFromHttpStatusCode(statusCode);\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: statusCode,\n ...data,\n },\n type: 'http',\n level,\n },\n {\n event: 'response',\n request,\n response,\n },\n );\n}\n\nfunction getBreadcrumbData(request: UndiciRequest): Partial<SanitizedRequestData> {\n try {\n const url = new URL(request.path, request.origin);\n const parsedUrl = parseUrl(url.toString());\n\n const data: Partial<SanitizedRequestData> = {\n url: getSanitizedUrlString(parsedUrl),\n 'http.method': request.method || 'GET',\n };\n\n if (parsedUrl.search) {\n data['http.query'] = parsedUrl.search;\n }\n if (parsedUrl.hash) {\n data['http.fragment'] = parsedUrl.hash;\n }\n\n return data;\n } catch {\n return {};\n }\n}\n\n// Matching the behavior of the base instrumentation\nfunction getAbsoluteUrl(origin: string, path: string = '/'): string {\n const url = `${origin}`;\n\n if (url.endsWith('/') && path.startsWith('/')) {\n return `${url}${path.slice(1)}`;\n }\n\n if (!url.endsWith('/') && !path.startsWith('/')) {\n return `${url}/${path.slice(1)}`;\n }\n\n return `${url}${path}`;\n}\n"],"names":["LRUMap","instrumentation","UndiciInstrumentation","hasSpansEnabled","getClient","shouldPropagateTraceForUrl","getTraceData","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","registerInstrumentations","defineIntegration","getBreadcrumbLogLevelFromHttpStatusCode","addBreadcrumb","parseUrl","getSanitizedUrlString"],"mappings":";;;;;;;AAgCA,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAAqB,EAAE,KAAK;AACzE,EAAE,MAAM,YAAA,GAAe,OAAO,OAAO,CAAC,WAAA,KAAgB,WAAA,GAAc,IAAA,GAAO,OAAO,CAAC,WAAW;AAC9F,EAAE,MAAM,uBAAA,GAA0B,OAAO,CAAC,sBAAsB;;AAEhE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,WAAW;AACrB,IAAI,SAAS,GAAG;AAChB,MAAM,MAAM,sBAAuB,GAAE,IAAIA,WAAM,CAAkB,GAAG,CAAC;;AAErE,MAAM,MAAMC,iBAAA,GAAkB,IAAIC,2CAAqB,CAAC;AACxD,QAAQ,qBAAqB,EAAE,KAAK;AACpC,QAAQ,iBAAiB,EAAE,OAAA,IAAW;AACtC,UAAU,MAAM,GAAA,GAAM,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC;AAClE,UAAU,MAAM,YAAa,GAAE,uBAAwB,IAAG,OAAO,uBAAuB,CAAC,GAAG,CAAC;;AAE7F,UAAU,IAAI,YAAY,EAAE;AAC5B,YAAY,OAAO,IAAI;AACvB;;AAEA;AACA;AACA,UAAU,IAAI,CAACC,oBAAe,EAAE,EAAE;AAClC,YAAY,MAAM,uBAAwB,GAAEC,cAAS,EAAE,EAAE,UAAU,EAAE,CAAC,uBAAuB;AAC7F,YAAY,MAAM,eAAeC,wCAA0B,CAAC,GAAG,EAAE,uBAAuB,EAAE,sBAAsB;AAChH,gBAAgBC,iBAAY;AAC5B,gBAAgB,EAAE;;AAElB,YAAY,MAAM,cAAA,GAAiB,OAAO,CAAC,OAAO;AAClD,YAAY,IAA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