-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(server-utils): Migrate FirebaseInstrumentation to orchestrion
#22141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
195e8b3
feat(server-utils): Migrate `FirebaseInstrumentation` to orchestrion
mydea 4fb81b2
some fixes
mydea de43341
change things
mydea e9128bb
fix(server-utils): Match firestore lite across firebase build layouts
nicohrubec 69cd11f
refactor(server-utils): Drop dead firestore types and no-explicit-any…
nicohrubec 230353e
test(server-utils): Port getPortAndAddress tests to orchestrion firebase
nicohrubec 9c65bd0
fix(nextjs): Serialize RegExp filePath for Turbopack orchestrion loader
nicohrubec f5e200b
test(server-utils): Rewrite firebase orchestrion tests as direct unit…
nicohrubec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 13 additions & 1 deletion
14
dev-packages/e2e-tests/test-applications/node-firebase/firestore-app/src/init.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,22 @@ | ||
| import * as Sentry from '@sentry/node'; | ||
|
|
||
| // When `E2E_ORCHESTRION=true`, exercise the diagnostics-channel injection path (the orchestrion-based | ||
| // `Firebase` integration) instead of the OTel one. Opting in before `init()` is enough: this file is | ||
| // imported before `app.ts` imports `firebase/firestore/lite`, so the channel-injection hooks are | ||
| // installed before firestore loads. | ||
| const useOrchestrion = process.env.E2E_ORCHESTRION === 'true'; | ||
|
|
||
| if (useOrchestrion) { | ||
| Sentry.experimentalUseDiagnosticsChannelInjection(); | ||
| } | ||
|
|
||
| Sentry.init({ | ||
| dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
| release: '1.0', | ||
| tracesSampleRate: 1.0, | ||
| integrations: [Sentry.firebaseIntegration()], | ||
| integrations: useOrchestrion | ||
| ? [Sentry.diagnosticsChannelInjectionIntegrations().firebaseIntegration()] | ||
| : [Sentry.firebaseIntegration()], | ||
| defaultIntegrations: false, | ||
| tunnel: `http://localhost:3031/`, // proxy server | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 32 additions & 90 deletions
122
dev-packages/e2e-tests/test-applications/node-firebase/tests/transactions.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/server-utils/src/integrations/tracing-channel/firebase/firestore-types.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // Minimal structural types inlined from `firebase/app` and `firebase/firestore`, kept just wide enough | ||
| // for the attributes the subscriber reads off a Firestore reference. Inlined (rather than imported) so | ||
| // `@sentry/server-utils` needs no firebase dependency. | ||
|
|
||
| export interface FirebaseOptions { | ||
| [key: string]: unknown; | ||
| apiKey?: string; | ||
| projectId?: string; | ||
| appId?: string; | ||
| messagingSenderId?: string; | ||
| storageBucket?: string; | ||
| } | ||
|
|
||
| export interface FirebaseApp { | ||
| name: string; | ||
| options: FirebaseOptions; | ||
| } | ||
|
|
||
| export interface FirestoreSettings { | ||
| host?: string; | ||
| } | ||
|
|
||
| interface FirestoreLike { | ||
| app: FirebaseApp; | ||
| toJSON: () => { settings?: FirestoreSettings }; | ||
| } | ||
|
|
||
| export interface DocumentReference { | ||
| id: string; | ||
| firestore: FirestoreLike; | ||
| type: string; | ||
| path: string; | ||
| parent: CollectionReference | null; | ||
| } | ||
|
|
||
| export interface CollectionReference { | ||
| id: string; | ||
| firestore: FirestoreLike; | ||
| type: string; | ||
| path: string; | ||
| parent: DocumentReference | null; | ||
| } | ||
|
|
||
| export type FirestoreReference = CollectionReference | DocumentReference; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.