diff --git a/src/lro/src/internal/tracing.rs b/src/lro/src/internal/tracing.rs index 4d054b8bbf..8e53398331 100644 --- a/src/lro/src/internal/tracing.rs +++ b/src/lro/src/internal/tracing.rs @@ -98,6 +98,28 @@ impl LroRecorder { } } +/// Injects LRO-specific telemetry attributes into the active span. +#[macro_export] +#[doc(hidden)] +macro_rules! record_polling_attributes { + ($span:expr) => { + #[cfg(google_cloud_unstable_tracing)] + { + if let Some(recorder) = $crate::LroRecorder::current() { + if let Some(attempt) = recorder.attempt_count() { + let span = &$span; + span.record("gcp.longrunning.poll_attempt_count", attempt); + span.record("gcp.longrunning.done", false); + } + } + } + #[cfg(not(google_cloud_unstable_tracing))] + { + let _ = &$span; + } + }; +} + /// Decorate a poller with tracing information. #[derive(Clone, Debug)] pub struct Tracing
{