Skip to content

fix(core): include command name on all telemetry events#34949

Merged
FrozenPandaz merged 2 commits into
masterfrom
fix/telemetry-command-on-events
Mar 23, 2026
Merged

fix(core): include command name on all telemetry events#34949
FrozenPandaz merged 2 commits into
masterfrom
fix/telemetry-command-on-events

Conversation

@FrozenPandaz
Copy link
Copy Markdown
Contributor

Current Behavior

The command name (e.g., build, test, generate) is only sent as the dt (document title) parameter on page_view events. All other telemetry events like run_completed and project_graph_computed have no command context, making it impossible to correlate them with the command that triggered them in Google Analytics.

Expected Behavior

All telemetry events include the dt parameter with the command name. The Rust telemetry background thread stores the page title when a page_view is received and automatically injects it into all subsequent events in the same process.

Related Issue(s)

N/A — internal analytics improvement

Previously, the command name was only sent as `dt` (document title) on
page_view events. Other events like run_completed and
project_graph_computed had no command context. This stores the page
title from the first page_view and injects it into all subsequent
events automatically on the Rust telemetry background thread.
@FrozenPandaz FrozenPandaz requested a review from a team as a code owner March 21, 2026 15:20
@FrozenPandaz FrozenPandaz requested a review from AgentEnder March 21, 2026 15:20
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 21, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 78826e7
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69bf8de1ffebdd000868551b
😎 Deploy Preview https://deploy-preview-34949--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 21, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 78826e7
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69bf8de15ecbc2000871c8bc
😎 Deploy Preview https://deploy-preview-34949--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Mar 21, 2026

View your CI Pipeline Execution ↗ for commit 78826e7

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 48m 34s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 8s View ↗
nx-cloud record -- pnpm nx conformance:check ✅ Succeeded 8s View ↗
nx build workspace-plugin ✅ Succeeded 3m 16s View ↗
nx-cloud record -- nx format:check ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-22 07:32:30 UTC

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ The fix from Nx Cloud was applied

We fixed a cargo fmt formatting failure introduced by the PR's addition of the current_page_title parameter to enqueue_event. The call inside drain_channels exceeded the line length limit and needed to be split into multi-line format to satisfy cargo fmt --check.

Warning

We could not verify this fix.

Suggested Fix changes
diff --git a/packages/nx/src/native/telemetry/service.rs b/packages/nx/src/native/telemetry/service.rs
index 1015ecf81a..2aa685f362 100644
--- a/packages/nx/src/native/telemetry/service.rs
+++ b/packages/nx/src/native/telemetry/service.rs
@@ -306,7 +306,12 @@ fn drain_channels(
     page_view_queue: &mut Vec<ParameterMap>,
 ) {
     while let Ok(event) = event_rx.try_recv() {
-        enqueue_event(event, user_params, current_page_title.as_deref(), event_queue);
+        enqueue_event(
+            event,
+            user_params,
+            current_page_title.as_deref(),
+            event_queue,
+        );
     }
     while let Ok(page_view) = page_view_rx.try_recv() {
         *current_page_title = Some(page_view.title.clone());

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.

Revert fix via Nx Cloud  

View interactive diff ↗

➡️ This fix was applied by Jason Jean

🎓 Learn more about Self-Healing CI on nx.dev

Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
@FrozenPandaz FrozenPandaz enabled auto-merge (squash) March 22, 2026 18:21
@FrozenPandaz FrozenPandaz merged commit 7e64e4a into master Mar 23, 2026
24 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/telemetry-command-on-events branch March 23, 2026 19:31
FrozenPandaz added a commit that referenced this pull request Mar 26, 2026
## Current Behavior

The command name (e.g., `build`, `test`, `generate`) is only sent as the
`dt` (document title) parameter on `page_view` events. All other
telemetry events like `run_completed` and `project_graph_computed` have
no command context, making it impossible to correlate them with the
command that triggered them in Google Analytics.

## Expected Behavior

All telemetry events include the `dt` parameter with the command name.
The Rust telemetry background thread stores the page title when a
`page_view` is received and automatically injects it into all subsequent
events in the same process.

## Related Issue(s)

N/A — internal analytics improvement

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
(cherry picked from commit 7e64e4a)
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants