feat(logging): new telemetry design MONGOSH-3408, MONGOSH-3376, MONGOSH-3406#2751
Merged
Conversation
…y-aggregation # Conflicts: # docs/tracking-plan.md # package-lock.json # packages/logging/package.json # packages/logging/src/analytics-helpers.spec.ts # packages/logging/src/analytics-helpers.ts # packages/logging/src/index.ts # packages/logging/src/logging-and-telemetry.spec.ts # packages/logging/src/logging-and-telemetry.ts # packages/logging/src/telemetry-events.ts # packages/logging/src/types.ts
addaleax
reviewed
Jun 30, 2026
nbbeeken
self-requested a review
July 13, 2026 14:20
nbbeeken
requested changes
Jul 13, 2026
nbbeeken
left a comment
Collaborator
There was a problem hiding this comment.
small things, looks really good!
nbbeeken
approved these changes
Jul 17, 2026
…y-aggregation # Conflicts: # docs/tracking-plan.md
nbbeeken
requested changes
Jul 20, 2026
nbbeeken
reviewed
Jul 20, 2026
nbbeeken
reviewed
Jul 21, 2026
nbbeeken
requested changes
Jul 21, 2026
nbbeeken
approved these changes
Jul 21, 2026
nbbeeken
approved these changes
Jul 21, 2026
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.
TelemetryClientknows about the endpoint URL and HTTP format.Identify(device and OS traits),New Connection(connection metadata including topology type, SRV, CSFLE), andSession Ended(aggregated session summary emitted once at close).SessionTelemetryStateas the user works, command counts split byREPLvsrc/evalcontext, error count, snippet count, startup timings, sequence of commands capped at 100, and flushed into a single end-of-session event. The event is only emitted for interactive sessions or identified agentic sessions. Containerized non-interactive non-agentic runs are excluded.get-os-info.tsimplementation is replaced with the shared@mongodb-js/get-os-infopackage.device_idas the sole telemetry user identifier. RemoveuserIdandtelemetryAnonymousId(config fields, validators, payload, and themongosh:new-user/mongosh:update-userbus events).ThrottledAnalyticscross-session throttle state ondevice_idinstead ofanonymousId.telemetryEndpointas aCliUserConfigoption (with URL validator) carrying the production default. Allow resolving the endpoint as override viaMONGOSH_TELEMETRY_ENDPOINTenv variable.IS_MONGOSH_EVERGREEN_CIguard and theanalyticsOptions/alwaysEnableconstructor option (endpoint overrides now via env or config, consistent withupdateURL).new-userflow is gone). Defer setup errors until logging is in place.packages/cli-repl/src/setup-analytics.ts(setupTelemetryAnalytics()+AnalyticsOptions), leavingsetupAnalytics()a thin wrapper.cli-repl.spec.tsinto newcli-repl-telemetry.spec.ts(fake-server integration),cli-repl-logging.spec.ts(logging config), andsetup-analytics.spec.ts(pure-function unit tests); kept log-based unit tests incli-repl.spec.ts.CliReplinstance in a top-levelafterEachso per-test resources (driver connections, log writers, process listeners) don't accumulate - the full cli-repl suite now runs within the default heap instead of OOMing.logging,cli-repl,types, ande2especs and the cli-repl README for the new telemetry model.