From 9196167d480e190a41595ccf79fd9221bee95a87 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Tue, 8 Sep 2026 21:42:39 +0000 Subject: [PATCH] telemetry: add stream_image_success completion metric stream_image_start fires with no matching completion signal. Added stream_image_success, fired in Trident::stream_image() once the underlying install() call returns Ok, mirroring the existing _start metric. (clean_install_finalized was considered for the streaming clean-install completion gap too, but dropped -- the clean_install/finalize_clean_install functions are already #[tracing::instrument]-ed spans, which already give start/end + duration for free; an additional boolean metric would just be redundant with that.) --- crates/trident/src/lib.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/trident/src/lib.rs b/crates/trident/src/lib.rs index 123f91528..68b24845a 100644 --- a/crates/trident/src/lib.rs +++ b/crates/trident/src/lib.rs @@ -908,7 +908,17 @@ impl Trident { self.host_config = Some(config); self.is_stream_image = true; - self.install(datastore, Operations::all(), false, Some(image)) + // `stream_image_start` above marks the beginning of a streamed + // install; mirror it with a completion signal here so streaming + // failures/successes are distinguishable in telemetry without + // relying on the downstream `clean_install_*` metrics (which are + // specific to the clean-install engine step, not the streaming + // entry point as a whole). + let result = self.install(datastore, Operations::all(), false, Some(image)); + if result.is_ok() { + tracing::info!(metric_name = "stream_image_success", value = true); + } + result } pub fn commit(