Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the legacy monitoring wrapper while preserving tracing-before-Sentry initialization and migrating supported services to @fxa/shared/otel.
Changes:
- Replaces wrapper usage with direct tracing and Sentry initialization.
- Migrates tracing imports and build paths.
- Updates auth-server monitoring tests.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/fxa-shared/package.json |
Removes the monitoring export. |
packages/fxa-shared/monitoring/index.ts |
Deletes the legacy wrapper. |
packages/fxa-profile-server/lib/monitoring.js |
Initializes tracing and Sentry directly. |
packages/fxa-event-broker/tsconfig.build.json |
Adds shared-library path mappings. |
packages/fxa-event-broker/src/monitoring.ts |
Uses the shared OTEL library. |
packages/fxa-event-broker/src/main.ts |
Migrates the tracing import. |
packages/fxa-event-broker/src/config.ts |
Uses shared tracing configuration. |
packages/fxa-customs-server/lib/monitoring.js |
Initializes tracing and Sentry directly. |
packages/fxa-auth-server/lib/routes/index.js |
Migrates tracing utilities. |
packages/fxa-auth-server/lib/monitoring.spec.ts |
Tests direct initialization and ordering. |
packages/fxa-auth-server/lib/monitoring.js |
Replaces wrapper initialization. |
packages/fxa-auth-server/config/index.ts |
Uses shared tracing configuration. |
packages/fxa-auth-server/bin/key_server.js |
Migrates the tracing provider import. |
packages/fxa-admin-panel/server/lib/monitoring.ts |
Replaces wrapper initialization. |
packages/fxa-admin-panel/server/config/index.ts |
Uses shared tracing configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| import mozLog from 'mozlog'; | ||
|
|
||
| import { initTracing } from 'fxa-shared/tracing/node-tracing'; | ||
| import { initTracing } from '@fxa/shared/otel'; |
## Because - `main.ts` imports `./monitoring`, which already starts tracing. Then `bootstrap()` calls `initTracing` a second time. - The new `@fxa/shared/otel` implementation logs a `Tracing already initialized!` warning on a repeat call. The event-broker prints that warning on every startup. ## This pull request - Removes the second `initTracing` call and its import from `main.ts`. - Removes the `mozlog` import, which the removed call was the only user of. The package still depends on `mozlog` through `monitoring.ts`. - Keeps `import './monitoring';` first, so tracing still starts before the framework loads. ## Issue that this pull request solves Closes: https://mozilla-hub.atlassian.net/browse/FXA-10645
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.
Because
main.tsimports./monitoring, which already starts tracing. Thenbootstrap()callsinitTracinga second time.@fxa/shared/otelimplementation logs aTracing already initialized!warning on a repeat call. The event-broker prints that warning on every startup.This pull request
initTracingcall and its import frommain.ts.mozlogimport, which the removed call was the only user of. The package still depends onmozlogthroughmonitoring.ts.import './monitoring';first, so tracing still starts before the framework loads.Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-10645
Checklist
Put an
xin the boxes that applyHow to review (Optional)
packages/fxa-event-broker/src/main.ts.main.ts, thenmonitoring.tsto confirm tracing still starts there../monitoringmust stay first.Screenshots (Optional)
None. This change does not touch the user interface.
Other information (Optional)
nx run fxa-event-broker:test-unit: 61 passed, 0 failed.nx lint fxa-event-broker: exit 0.fxa-admin-serveralready follows this pattern. Itsmain.tsimports./monitoringand never callsinitTracingitself.