Repository navigation
telemetry [13]: introduce command error reporting helpers - #778
bfjelds (bfjelds) wants to merge 1 commit into
Conversation
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
CLI failure telemetry remains incomplete, and ACL detection failures are incorrectly reported as negative results.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds expanded telemetry for command failures, servicing lifecycle events, and startup context.
Changes:
- Adds correlated
command_errormetrics for CLI and gRPC operations. - Adds manual rollback and runtime-update lifecycle metrics.
- Enriches startup telemetry with ACL detection and system uptime.
File summaries
| File | Description |
|---|---|
Cargo.toml |
Enables Nix time APIs. |
docs/Reference/Agent-Configuration.md |
Documents command-error telemetry. |
crates/trident/src/main.rs |
Instruments CLI servicing commands. |
crates/trident/src/lib.rs |
Re-exports instrumentation and enriches startup metrics. |
crates/trident/src/logging/operation_context.rs |
Implements and tests command-error reporting. |
crates/trident/src/server/tridentserver/mod.rs |
Instruments gRPC servicing commands. |
crates/trident/src/engine/runtime_update.rs |
Emits runtime-update success. |
crates/trident/src/engine/manual_rollback/mod.rs |
Emits rollback start and runtime success. |
crates/trident/src/engine/manual_rollback/utils.rs |
Makes rollback request kinds loggable. |
crates/trident_api/src/error.rs |
Exposes error-origin locations. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a97f856 to
a2e921d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
CLI startup events lose correlation metadata, and runtime-update success is omitted from persisted metrics archives.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Correlation-ID pre-warming creates missing datastores and bypasses the host-provisioning guard for several CLI commands.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Balanced
f6f0da6 to
5e7b215
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Initial install/update telemetry can remain uncorrelated, and runtime rollback persistence is duplicated.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
crates/trident/src/main.rs:202
- Issue: The missing-datastore check also skips pre-warming for
installandupdate, so the first such CLI invocation still emitscommand_startwithout acorrelation_id. Evidence: Those commands are intentionally exempt from the provisioning guard below, andTrident::newcreates the ID only afterrun_commandhas already emittedcommand_start. Suggestion: Skip creation only for commands that require an existing datastore; allow install/update to create and attach the ID before enteringrun_command.
if !agent_config.datastore_path().exists() {
return Ok(None);
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Balanced
5e7b215 to
e6ac4c4
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Several non-servicing CLI failures still bypass the promised command_error telemetry.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Balanced
e6ac4c4 to
79b5d01
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Read-only and response-encoded gRPC failures remain outside the new command-error instrumentation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Balanced
79b5d01 to
ee0bf7c
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d0e7cadc-8f44-443f-affe-6ce8e856a218 Copilot-Session: 43cb811b-f191-4d90-852f-e3373041ca11

Description
Add correlated command_error helpers with structured errors, panic handling, deduplication, and captured reboot context.
Rationale
Extracted from #778 to make the telemetry stack easier to review. Combined changes are unchanged.
Validation
cargo test --locked --manifest-path /home/bfjelds/mjolnir-sandbox/trident-telemetry-split778-20261025-1743/Cargo.toml -p trident -p osutils -p trident_api --features trident/grpc-preview,trident/dangerous-options,trident_api/documentation -- command_kind:: logging:: cli:: engine::context:: config::host::tests virt::/home/bfjelds/mjolnir-sandbox.Related PRs in stack: