@sentry/node 10.0.0-alpha.1 → 10.0.0-beta.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 (56) hide show
  1. package/build/cjs/index.js +2 -0
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/tracing/fastify/index.js +57 -11
  4. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  5. package/build/cjs/integrations/tracing/firebase/firebase.js +32 -0
  6. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -0
  7. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +41 -0
  8. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -0
  9. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +295 -0
  10. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -0
  11. package/build/cjs/integrations/tracing/index.js +3 -0
  12. package/build/cjs/integrations/tracing/index.js.map +1 -1
  13. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +15 -2
  14. package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  15. package/build/esm/index.js +1 -0
  16. package/build/esm/index.js.map +1 -1
  17. package/build/esm/integrations/tracing/fastify/index.js +57 -11
  18. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  19. package/build/esm/integrations/tracing/firebase/firebase.js +29 -0
  20. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -0
  21. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +39 -0
  22. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -0
  23. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +292 -0
  24. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -0
  25. package/build/esm/integrations/tracing/index.js +3 -0
  26. package/build/esm/integrations/tracing/index.js.map +1 -1
  27. package/build/esm/integrations/tracing/vercelai/instrumentation.js +16 -3
  28. package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  29. package/build/esm/package.json +1 -1
  30. package/build/types/index.d.ts +1 -0
  31. package/build/types/index.d.ts.map +1 -1
  32. package/build/types/integrations/tracing/fastify/index.d.ts +38 -2
  33. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  34. package/build/types/integrations/tracing/firebase/firebase.d.ts +6 -0
  35. package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -0
  36. package/build/types/integrations/tracing/firebase/index.d.ts +2 -0
  37. package/build/types/integrations/tracing/firebase/index.d.ts.map +1 -0
  38. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +19 -0
  39. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +1 -0
  40. package/build/types/integrations/tracing/firebase/otel/index.d.ts +3 -0
  41. package/build/types/integrations/tracing/firebase/otel/index.d.ts.map +1 -0
  42. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +23 -0
  43. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +1 -0
  44. package/build/types/integrations/tracing/firebase/otel/types.d.ts +86 -0
  45. package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +1 -0
  46. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  47. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +1 -1
  48. package/build/types-ts3.8/index.d.ts +1 -0
  49. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +38 -2
  50. package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +6 -0
  51. package/build/types-ts3.8/integrations/tracing/firebase/index.d.ts +2 -0
  52. package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +19 -0
  53. package/build/types-ts3.8/integrations/tracing/firebase/otel/index.d.ts +3 -0
  54. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +23 -0
  55. package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +86 -0
  56. package/package.json +5 -5
@@ -0,0 +1,23 @@
1
+ import type { Tracer } from '@opentelemetry/api';
2
+ import { InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
+ import type { unwrap as shimmerUnwrap, wrap as shimmerWrap } from 'shimmer';
4
+ import type { FirebaseInstrumentationConfig, FirestoreSettings } from '../types';
5
+ /**
6
+ *
7
+ * @param tracer - Opentelemetry Tracer
8
+ * @param firestoreSupportedVersions - supported version of firebase/firestore
9
+ * @param wrap - reference to native instrumentation wrap function
10
+ * @param unwrap - reference to native instrumentation wrap function
11
+ */
12
+ export declare function patchFirestore(tracer: Tracer, firestoreSupportedVersions: string[], wrap: typeof shimmerWrap, unwrap: typeof shimmerUnwrap, config: FirebaseInstrumentationConfig): InstrumentationNodeModuleDefinition;
13
+ /**
14
+ * Gets the server address and port attributes from the Firestore settings.
15
+ * It's best effort to extract the address and port from the settings, especially for IPv6.
16
+ * @param span - The span to set attributes on.
17
+ * @param settings - The Firestore settings containing host information.
18
+ */
19
+ export declare function getPortAndAddress(settings: FirestoreSettings): {
20
+ address?: string;
21
+ port?: number;
22
+ };
23
+ //# sourceMappingURL=firestore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../../../../../../src/integrations/tracing/firebase/otel/patches/firestore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EACL,mCAAmC,EAIpC,MAAM,gCAAgC,CAAC;AAUxC,OAAO,KAAK,EAAE,MAAM,IAAI,aAAa,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5E,OAAO,KAAK,EAOV,6BAA6B,EAE7B,iBAAiB,EAQlB,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,0BAA0B,EAAE,MAAM,EAAE,EACpC,IAAI,EAAE,OAAO,WAAW,EACxB,MAAM,EAAE,OAAO,aAAa,EAC5B,MAAM,EAAE,6BAA6B,GACpC,mCAAmC,CA+CrC;AA2JD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,GAAG;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAwCA"}
@@ -0,0 +1,86 @@
1
+ import type { Span } from '@opentelemetry/api';
2
+ import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
3
+ export interface FirebaseOptions {
4
+ [key: string]: any;
5
+ apiKey?: string;
6
+ authDomain?: string;
7
+ databaseURL?: string;
8
+ projectId?: string;
9
+ storageBucket?: string;
10
+ messagingSenderId?: string;
11
+ appId?: string;
12
+ measurementId?: string;
13
+ }
14
+ export interface FirebaseApp {
15
+ name: string;
16
+ options: FirebaseOptions;
17
+ automaticDataCollectionEnabled: boolean;
18
+ delete(): Promise<void>;
19
+ }
20
+ export interface DocumentData {
21
+ [field: string]: any;
22
+ }
23
+ export type WithFieldValue<T> = T;
24
+ export type PartialWithFieldValue<T> = Partial<T>;
25
+ export interface SetOptions {
26
+ merge?: boolean;
27
+ mergeFields?: (string | number | symbol)[];
28
+ }
29
+ export interface DocumentReference<T = DocumentData, U extends DocumentData = DocumentData> {
30
+ id: string;
31
+ firestore: {
32
+ app: FirebaseApp;
33
+ settings: FirestoreSettings;
34
+ useEmulator: (host: string, port: number) => void;
35
+ toJSON: () => {
36
+ app: FirebaseApp;
37
+ settings: FirestoreSettings;
38
+ };
39
+ };
40
+ type: 'collection' | 'document' | string;
41
+ path: string;
42
+ parent: CollectionReference<T, U>;
43
+ }
44
+ export interface CollectionReference<T = DocumentData, U extends DocumentData = DocumentData> {
45
+ id: string;
46
+ firestore: {
47
+ app: FirebaseApp;
48
+ settings: FirestoreSettings;
49
+ useEmulator: (host: string, port: number) => void;
50
+ toJSON: () => {
51
+ app: FirebaseApp;
52
+ settings: FirestoreSettings;
53
+ };
54
+ };
55
+ type: string;
56
+ path: string;
57
+ parent: DocumentReference<T, U> | null;
58
+ }
59
+ export interface QuerySnapshot<T = DocumentData, U extends DocumentData = DocumentData> {
60
+ docs: Array<DocumentReference<T, U>>;
61
+ size: number;
62
+ empty: boolean;
63
+ }
64
+ export interface FirestoreSettings {
65
+ host?: string;
66
+ ssl?: boolean;
67
+ ignoreUndefinedProperties?: boolean;
68
+ cacheSizeBytes?: number;
69
+ experimentalForceLongPolling?: boolean;
70
+ experimentalAutoDetectLongPolling?: boolean;
71
+ useFetchStreams?: boolean;
72
+ }
73
+ /**
74
+ * Firebase Auto Instrumentation
75
+ */
76
+ export interface FirebaseInstrumentationConfig extends InstrumentationConfig {
77
+ firestoreSpanCreationHook?: FirestoreSpanCreationHook;
78
+ }
79
+ export interface FirestoreSpanCreationHook {
80
+ (span: Span): void;
81
+ }
82
+ export type GetDocsType<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> = (query: CollectionReference<AppModelType, DbModelType>) => Promise<QuerySnapshot<AppModelType, DbModelType>>;
83
+ export type SetDocType<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> = ((reference: DocumentReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>) => Promise<void>) & ((reference: DocumentReference<AppModelType, DbModelType>, data: PartialWithFieldValue<AppModelType>, options: SetOptions) => Promise<void>);
84
+ export type AddDocType<AppModelType, DbModelType extends DocumentData> = (reference: CollectionReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>) => Promise<DocumentReference<AppModelType, DbModelType>>;
85
+ export type DeleteDocType<AppModelType, DbModelType extends DocumentData> = (reference: DocumentReference<AppModelType, DbModelType>) => Promise<void>;
86
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/firebase/otel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,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AAE,iBAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,KACpD,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAwBhD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAwB9D;AAED;;GAEG;AAEH,wBAAgB,wCAAwC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,CA0BzG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAyBhD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAyB9D;AAED;;GAEG;AAEH,wBAAgB,wCAAwC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,CA2BzG"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/vercelai/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAuC,MAAM,gCAAgC,CAAC;AAyB1G,UAAU,gBAAgB;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,2BAA2B,EAAE,gBAAgB,GAAG,SAAS,EACzD,sBAAsB,EAAE,gBAAgB,EACxC,0BAA0B,EAAE,OAAO,GAAG,SAAS,EAC/C,uBAAuB,EAAE,OAAO,GAC/B;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAoBnD;AAED;;;;;GAKG;AACH,qBAAa,6BAA8B,SAAQ,mBAAmB;IACpE,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAsB;gBAErB,MAAM,GAAE,qBAA0B;IAIrD;;OAEG;IACI,IAAI,IAAI,+BAA+B;IAK9C;;;OAGG;IACI,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAQlD;;OAEG;IACH,OAAO,CAAC,MAAM;CAuDf"}
1
+ {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/vercelai/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAuC,MAAM,gCAAgC,CAAC;AA+B1G,UAAU,gBAAgB;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,2BAA2B,EAAE,gBAAgB,GAAG,SAAS,EACzD,sBAAsB,EAAE,gBAAgB,EACxC,0BAA0B,EAAE,OAAO,GAAG,SAAS,EAC/C,uBAAuB,EAAE,OAAO,GAC/B;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAoBnD;AAED;;;;;GAKG;AACH,qBAAa,6BAA8B,SAAQ,mBAAmB;IACpE,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAsB;gBAErB,MAAM,GAAE,qBAA0B;IAIrD;;OAEG;IACI,IAAI,IAAI,+BAA+B;IAK9C;;;OAGG;IACI,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAQlD;;OAEG;IACH,OAAO,CAAC,MAAM;CAoEf"}
@@ -25,6 +25,7 @@ export { amqplibIntegration } from './integrations/tracing/amqplib';
25
25
  export { vercelAIIntegration } from './integrations/tracing/vercelai';
26
26
  export { openAIIntegration } from './integrations/tracing/openai';
27
27
  export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, } from './integrations/featureFlagShims';
28
+ export { firebaseIntegration } from './integrations/tracing/firebase';
28
29
  export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, } from './sdk';
29
30
  export { initOpenTelemetry, preloadOpenTelemetry } from './sdk/initOtel';
30
31
  export { getAutoPerformanceIntegrations } from './integrations/tracing';
@@ -1,6 +1,40 @@
1
1
  import { Instrumentation, InstrumentationConfig } from '@opentelemetry/instrumentation';
2
2
  import { FastifyInstance, FastifyReply, FastifyRequest } from './types';
3
3
  import { FastifyInstrumentationV3 } from './v3/instrumentation';
4
+ /**
5
+ * Options for the Fastify integration.
6
+ *
7
+ * `shouldHandleError` - Callback method deciding whether error should be captured and sent to Sentry
8
+ * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.
9
+ * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.
10
+ *
11
+ * @example
12
+ *
13
+ * ```javascript
14
+ * Sentry.init({
15
+ * integrations: [
16
+ * Sentry.fastifyIntegration({
17
+ * shouldHandleError(_error, _request, reply) {
18
+ * return reply.statusCode >= 500;
19
+ * },
20
+ * });
21
+ * },
22
+ * });
23
+ * ```
24
+ *
25
+ */
26
+ interface FastifyIntegrationOptions {
27
+ /**
28
+ * Callback method deciding whether error should be captured and sent to Sentry
29
+ * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.
30
+ * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.
31
+ *
32
+ * @param error Captured Fastify error
33
+ * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)
34
+ * @param reply Fastify reply (or any object containing at least statusCode)
35
+ */
36
+ shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;
37
+ }
4
38
  interface FastifyHandlerOptions {
5
39
  /**
6
40
  * Callback method deciding whether error should be captured and sent to Sentry
@@ -11,6 +45,7 @@ interface FastifyHandlerOptions {
11
45
  *
12
46
  * @example
13
47
  *
48
+ *
14
49
  * ```javascript
15
50
  * setupFastifyErrorHandler(app, {
16
51
  * shouldHandleError(_error, _request, reply) {
@@ -19,6 +54,7 @@ interface FastifyHandlerOptions {
19
54
  * });
20
55
  * ```
21
56
  *
57
+ *
22
58
  * If using TypeScript, you can cast the request and reply to get full type safety.
23
59
  *
24
60
  * ```typescript
@@ -38,7 +74,7 @@ interface FastifyHandlerOptions {
38
74
  export declare const instrumentFastifyV3: ((options?: unknown) => FastifyInstrumentationV3) & {
39
75
  id: string;
40
76
  };
41
- export declare const instrumentFastify: ((options?: unknown) => Instrumentation<InstrumentationConfig & FastifyHandlerOptions>) & {
77
+ export declare const instrumentFastify: ((options?: unknown) => Instrumentation<InstrumentationConfig & FastifyIntegrationOptions>) & {
42
78
  id: string;
43
79
  };
44
80
  /**
@@ -57,7 +93,7 @@ export declare const instrumentFastify: ((options?: unknown) => Instrumentation<
57
93
  * })
58
94
  * ```
59
95
  */
60
- export declare const fastifyIntegration: () => import("@sentry/core").Integration;
96
+ export declare const fastifyIntegration: (options?: Partial<FastifyIntegrationOptions> | undefined) => import("@sentry/core").Integration;
61
97
  /**
62
98
  * Add an Fastify error handler to capture errors to Sentry.
63
99
  *
@@ -0,0 +1,6 @@
1
+ import { FirebaseInstrumentation } from './otel';
2
+ export declare const instrumentFirebase: ((options?: unknown) => FirebaseInstrumentation) & {
3
+ id: string;
4
+ };
5
+ export declare const firebaseIntegration: () => import("@sentry/core").Integration;
6
+ //# sourceMappingURL=firebase.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './firebase';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { InstrumentationNodeModuleDefinition, InstrumentationBase } from '@opentelemetry/instrumentation';
2
+ import { FirebaseInstrumentationConfig } from './types';
3
+ /**
4
+ * Instrumentation for Firebase services, specifically Firestore.
5
+ */
6
+ export declare class FirebaseInstrumentation extends InstrumentationBase<FirebaseInstrumentationConfig> {
7
+ constructor(config?: FirebaseInstrumentationConfig);
8
+ /**
9
+ * sets config
10
+ * @param config
11
+ */
12
+ setConfig(config?: FirebaseInstrumentationConfig): void;
13
+ /**
14
+ *
15
+ * @protected
16
+ */
17
+ protected init(): InstrumentationNodeModuleDefinition | InstrumentationNodeModuleDefinition[] | void;
18
+ }
19
+ //# sourceMappingURL=firebaseInstrumentation.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './firebaseInstrumentation';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { Tracer } from '@opentelemetry/api';
2
+ import { InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
+ import { unwrap as shimmerUnwrap, wrap as shimmerWrap } from 'shimmer';
4
+ import { FirebaseInstrumentationConfig, FirestoreSettings } from '../types';
5
+ /**
6
+ *
7
+ * @param tracer - Opentelemetry Tracer
8
+ * @param firestoreSupportedVersions - supported version of firebase/firestore
9
+ * @param wrap - reference to native instrumentation wrap function
10
+ * @param unwrap - reference to native instrumentation wrap function
11
+ */
12
+ export declare function patchFirestore(tracer: Tracer, firestoreSupportedVersions: string[], wrap: typeof shimmerWrap, unwrap: typeof shimmerUnwrap, config: FirebaseInstrumentationConfig): InstrumentationNodeModuleDefinition;
13
+ /**
14
+ * Gets the server address and port attributes from the Firestore settings.
15
+ * It's best effort to extract the address and port from the settings, especially for IPv6.
16
+ * @param span - The span to set attributes on.
17
+ * @param settings - The Firestore settings containing host information.
18
+ */
19
+ export declare function getPortAndAddress(settings: FirestoreSettings): {
20
+ address?: string;
21
+ port?: number;
22
+ };
23
+ //# sourceMappingURL=firestore.d.ts.map
@@ -0,0 +1,86 @@
1
+ import { Span } from '@opentelemetry/api';
2
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
3
+ export interface FirebaseOptions {
4
+ [key: string]: any;
5
+ apiKey?: string;
6
+ authDomain?: string;
7
+ databaseURL?: string;
8
+ projectId?: string;
9
+ storageBucket?: string;
10
+ messagingSenderId?: string;
11
+ appId?: string;
12
+ measurementId?: string;
13
+ }
14
+ export interface FirebaseApp {
15
+ name: string;
16
+ options: FirebaseOptions;
17
+ automaticDataCollectionEnabled: boolean;
18
+ delete(): Promise<void>;
19
+ }
20
+ export interface DocumentData {
21
+ [field: string]: any;
22
+ }
23
+ export type WithFieldValue<T> = T;
24
+ export type PartialWithFieldValue<T> = Partial<T>;
25
+ export interface SetOptions {
26
+ merge?: boolean;
27
+ mergeFields?: (string | number | symbol)[];
28
+ }
29
+ export interface DocumentReference<T = DocumentData, U extends DocumentData = DocumentData> {
30
+ id: string;
31
+ firestore: {
32
+ app: FirebaseApp;
33
+ settings: FirestoreSettings;
34
+ useEmulator: (host: string, port: number) => void;
35
+ toJSON: () => {
36
+ app: FirebaseApp;
37
+ settings: FirestoreSettings;
38
+ };
39
+ };
40
+ type: 'collection' | 'document' | string;
41
+ path: string;
42
+ parent: CollectionReference<T, U>;
43
+ }
44
+ export interface CollectionReference<T = DocumentData, U extends DocumentData = DocumentData> {
45
+ id: string;
46
+ firestore: {
47
+ app: FirebaseApp;
48
+ settings: FirestoreSettings;
49
+ useEmulator: (host: string, port: number) => void;
50
+ toJSON: () => {
51
+ app: FirebaseApp;
52
+ settings: FirestoreSettings;
53
+ };
54
+ };
55
+ type: string;
56
+ path: string;
57
+ parent: DocumentReference<T, U> | null;
58
+ }
59
+ export interface QuerySnapshot<T = DocumentData, U extends DocumentData = DocumentData> {
60
+ docs: Array<DocumentReference<T, U>>;
61
+ size: number;
62
+ empty: boolean;
63
+ }
64
+ export interface FirestoreSettings {
65
+ host?: string;
66
+ ssl?: boolean;
67
+ ignoreUndefinedProperties?: boolean;
68
+ cacheSizeBytes?: number;
69
+ experimentalForceLongPolling?: boolean;
70
+ experimentalAutoDetectLongPolling?: boolean;
71
+ useFetchStreams?: boolean;
72
+ }
73
+ /**
74
+ * Firebase Auto Instrumentation
75
+ */
76
+ export interface FirebaseInstrumentationConfig extends InstrumentationConfig {
77
+ firestoreSpanCreationHook?: FirestoreSpanCreationHook;
78
+ }
79
+ export interface FirestoreSpanCreationHook {
80
+ (span: Span): void;
81
+ }
82
+ export type GetDocsType<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> = (query: CollectionReference<AppModelType, DbModelType>) => Promise<QuerySnapshot<AppModelType, DbModelType>>;
83
+ export type SetDocType<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> = ((reference: DocumentReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>) => Promise<void>) & ((reference: DocumentReference<AppModelType, DbModelType>, data: PartialWithFieldValue<AppModelType>, options: SetOptions) => Promise<void>);
84
+ export type AddDocType<AppModelType, DbModelType extends DocumentData> = (reference: CollectionReference<AppModelType, DbModelType>, data: WithFieldValue<AppModelType>) => Promise<DocumentReference<AppModelType, DbModelType>>;
85
+ export type DeleteDocType<AppModelType, DbModelType extends DocumentData> = (reference: DocumentReference<AppModelType, DbModelType>) => Promise<void>;
86
+ //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "10.0.0-alpha.1",
3
+ "version": "10.0.0-beta.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",
@@ -94,10 +94,10 @@
94
94
  "@opentelemetry/resources": "^2.0.0",
95
95
  "@opentelemetry/sdk-trace-base": "^2.0.0",
96
96
  "@opentelemetry/semantic-conventions": "^1.34.0",
97
- "@prisma/instrumentation": "6.11.1",
98
- "@sentry/core": "10.0.0-alpha.1",
99
- "@sentry/node-core": "10.0.0-alpha.1",
100
- "@sentry/opentelemetry": "10.0.0-alpha.1",
97
+ "@prisma/instrumentation": "6.12.0",
98
+ "@sentry/core": "10.0.0-beta.0",
99
+ "@sentry/node-core": "10.0.0-beta.0",
100
+ "@sentry/opentelemetry": "10.0.0-beta.0",
101
101
  "import-in-the-middle": "^1.14.2",
102
102
  "minimatch": "^9.0.0"
103
103
  },