fix(core): include command name on all telemetry events#34949
Conversation
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.
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 78826e7
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
✅ 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.
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>
## 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)
|
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. |
Current Behavior
The command name (e.g.,
build,test,generate) is only sent as thedt(document title) parameter onpage_viewevents. All other telemetry events likerun_completedandproject_graph_computedhave 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
dtparameter with the command name. The Rust telemetry background thread stores the page title when apage_viewis received and automatically injects it into all subsequent events in the same process.Related Issue(s)
N/A — internal analytics improvement