From a320d18da96ca8cccf253e486022d600ff9c1757 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Fri, 1 May 2026 18:19:22 +0200 Subject: [PATCH] fix: use otel.status_message for OTLP Status.message on failed jobs (#8995) tracing-opentelemetry only recognizes otel.status_code and otel.status_message as fields that map to the OTLP Status proto. The previously-used otel.status_description fell through to the generic attribute recorder, leaving Status.message unset and preventing OTLP consumers from filtering spans on error status. Co-authored-by: Claude Opus 4.7 (1M context) --- backend/windmill-worker/src/result_processor.rs | 6 +++--- backend/windmill-worker/src/worker.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/windmill-worker/src/result_processor.rs b/backend/windmill-worker/src/result_processor.rs index 87205b993d..30acb913df 100644 --- a/backend/windmill-worker/src/result_processor.rs +++ b/backend/windmill-worker/src/result_processor.rs @@ -112,7 +112,7 @@ async fn process_jc( script_hash = field::Empty, otel.name = field::Empty, otel.status_code = "ERROR", - otel.status_description = field::Empty, + otel.status_message = field::Empty, success = %success, error.message = field::Empty, error.name = field::Empty, @@ -167,11 +167,11 @@ async fn process_jc( span.record("error.message", result_error.message.as_str()); span.record("error.name", result_error.name.as_str()); span.record( - "otel.status_description", + "otel.status_message", crate::worker::truncate_description(&result_error.message).as_str(), ); } else { - span.record("otel.status_description", "Job failed"); + span.record("otel.status_message", "Job failed"); } } diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index 8abe0912b2..f062837d4b 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -1342,7 +1342,7 @@ pub fn create_span_with_name( script_hash = field::Empty, otel.name = field::Empty, otel.status_code = field::Empty, - otel.status_description = field::Empty, + otel.status_message = field::Empty, ); let rj = arc_job.flow_innermost_root_job.unwrap_or(arc_job.id); @@ -1382,12 +1382,12 @@ pub fn create_span_with_name( span } -/// Max characters of an error message copied into the `otel.status_description` +/// Max characters of an error message copied into the `otel.status_message` /// span attribute. Prevents a single verbose failure from blowing up the span /// payload on OTLP exporters. const STATUS_DESCRIPTION_MAX_LEN: usize = 512; -/// Record `otel.status_code` / `otel.status_description` on the current span +/// Record `otel.status_code` / `otel.status_message` on the current span /// when a job fails. Called from inside the `.instrument(job_span)` future so /// that `Span::current()` resolves to the `"job"` span created by /// `create_span_with_name`. @@ -1402,7 +1402,7 @@ pub(crate) fn record_job_span_status(result: &windmill_common::error::Result