feat(server-utils): Migrate FirebaseInstrumentation to orchestrion#22141
Merged
Conversation
Member
Author
|
This depends on nodejs/orchestrion-js#90 being released (and subsequently released in tracing-hooks etc), as we need to target hashed files: |
Contributor
size-limit report 📦
|
mydea
force-pushed
the
feat/firebase-orchestrion
branch
from
July 13, 2026 09:58
8aabf34 to
24d1c33
Compare
mydea
force-pushed
the
feat/firebase-orchestrion
branch
from
July 15, 2026 07:53
24d1c33 to
19a4eeb
Compare
mydea
force-pushed
the
feat/firebase-orchestrion
branch
from
July 15, 2026 10:57
19a4eeb to
99dca08
Compare
mydea
added a commit
that referenced
this pull request
Jul 15, 2026
This bumps orchestrion dependencies: * `"@apm-js-collab/code-transformer-bundler-plugins": "^0.6.0"` * `"@apm-js-collab/tracing-hooks": "^0.12.0"` which basically just updates those to use `"@apm-js-collab/code-transformer": "^0.18.0"` as deps. Required for #22141
mydea
force-pushed
the
feat/firebase-orchestrion
branch
from
July 15, 2026 14:04
538303f to
6c63b54
Compare
mydea
force-pushed
the
feat/firebase-orchestrion
branch
2 times, most recently
from
July 17, 2026 08:01
6cbf56b to
785badf
Compare
nicohrubec
force-pushed
the
feat/firebase-orchestrion
branch
from
July 21, 2026 07:31
2caa029 to
ffea8e1
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b0358a6. Configure here.
nicohrubec
marked this pull request as ready for review
July 21, 2026 08:13
nicohrubec
requested review from
andreiborza,
chargome and
nicohrubec
and removed request for
a team and
nicohrubec
July 21, 2026 08:13
andreiborza
reviewed
Jul 21, 2026
nicohrubec
force-pushed
the
feat/firebase-orchestrion
branch
from
July 21, 2026 08:43
b0358a6 to
4aeccc2
Compare
chargome
approved these changes
Jul 21, 2026
chargome
left a comment
Member
There was a problem hiding this comment.
Looks good, just the tests and some convention follow ups!
|
|
||
| describe('firebaseChannelIntegration', () => { | ||
| beforeAll(() => { | ||
| installTestAsyncContextStrategy(); |
Member
There was a problem hiding this comment.
Let's remove tests that depend on this and move to integration tests
andreiborza
approved these changes
Jul 21, 2026
Adds an orchestrion diagnostics-channel `Firebase` integration in
`@sentry/server-utils`, replacing the `InstrumentationBase` approach when
`experimentalUseDiagnosticsChannelInjection()` is enabled (swapping in 1:1 for
the OTel `Firebase` integration by name).
- Firestore: subscribes to `orchestrion:@firebase/firestore:{add,get,set,delete}-doc`
and emits the same `db.query` spans via `bindTracingChannelToSpan`, with a
distinct `auto.firebase.orchestrion.firestore` origin.
- firebase-functions: subscribes to `orchestrion:firebase-functions:*` and
rewraps the handler argument of each `onX(...)` registration in the channel's
`start` so the returned cloud function opens a SERVER span + error boundary on
invocation, with `auto.firebase.orchestrion.functions` origin.
Closes #20919
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
firebase >=12.8 (firestore >=4.10) moved addDoc/getDocs/setDoc/deleteDoc into a hash-named shared chunk, so orchestrion's exact-path filePath match no longer hit them and no firestore spans were emitted. Use a RegExp filePath matching both the old `index.node.*` and new `common-<hash>.node.*` chunks. Also align the functions span op assertion with `function.firebase`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… disable Remove the unused `DocumentData` type, the unread `FirestoreSettings.ssl` and `FirestoreLike.settings` members, and narrow the `toJSON` return to what `buildAttributes` actually reads. Switching the `FirebaseOptions` index signature to `unknown` lets the file drop its `no-explicit-any` eslint-disable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`getPortAndAddress` is a line-for-line port of the OTel firestore parser but its 9-case unit suite wasn't ported alongside it. Bring the IPv4/IPv6/host edge cases over, plus a missing-`host` case the guard clause handles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Turbopack requires loader options to be JSON-serializable, so a RegExp `module.filePath` (used by the firestore config) was silently dropped and no firestore channels were injected under Turbopack — while webpack, which passes the config in-process, worked. Encode via `serializeInstrumentations` at the Turbopack boundary; the loader revives the RegExp on the other side. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… tests Drop the SDK-setup harness (installTestAsyncContextStrategy + setupOnce + tracingChannel round-trip) and call the exported functions directly. Tests that only existed to exercise the channel wiring are removed: the deleteDoc error lifecycle is generic bind behavior already covered in tracing-channel.test.ts, and the missing-reference / parent-selection cases live in the instrumentFirebase closure (covered by the orchestrion e2e). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nicohrubec
force-pushed
the
feat/firebase-orchestrion
branch
from
July 21, 2026 10:59
275c399 to
f5e200b
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Rewrites the
Firebaseintegration offInstrumentationBaseto an orchestrion diagnostics-channel listener in@sentry/server-utils, following the mysql (#20900) and graphql (#21885) migrations. The channel-based integration reuses the OTelFirebasename, so opting in viaexperimentalUseDiagnosticsChannelInjection()swaps it in 1:1 for the OTel one (which stays the default).Firestore — subscribes to
orchestrion:@firebase/firestore:{add,get,set,delete}-doc(injected into firestore's liteaddDoc/getDocs/setDoc/deleteDoc) and emits the samedb.queryclient spans viabindTracingChannelToSpan, with a distinctauto.firebase.orchestrion.firestoreorigin.firebase-functions — the
onX(...)provider functions register a handler and return synchronously, so the span can't be bound to the registration call. Instead the channelstartsubscriber rewraps the handler argument (orchestrion forwards the mutated args array to the real call), so the returned cloud function opens aSERVERspan + error boundary on invocation, withauto.firebase.orchestrion.functionsorigin.The
node-firebasee2e firestore suite additionally runs withE2E_ORCHESTRION=trueto assert the orchestrion origin.Closes #20919