Skip to content

Commit 3b7d7a3

Browse files
committed
feat(o11y): add record_polling_attributes macro
1 parent c745edb commit 3b7d7a3

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/lro/src/internal/tracing.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@ impl LroRecorder {
8989
}
9090
}
9191

92+
/// Injects LRO-specific telemetry attributes into the active span.
93+
#[macro_export]
94+
#[doc(hidden)]
95+
macro_rules! record_polling_attributes {
96+
($span:expr) => {
97+
#[cfg(google_cloud_unstable_tracing)]
98+
{
99+
if let Ok(attempt) = $crate::POLL_ATTEMPT_COUNT.try_with(|c| *c) {
100+
$span.record("gcp.longrunning.poll_attempt_count", attempt);
101+
$span.record("gcp.longrunning.done", false);
102+
}
103+
}
104+
};
105+
}
106+
92107
/// Decorate a poller with tracing information.
93108
#[derive(Clone, Debug)]
94109
pub struct Tracing<P> {

0 commit comments

Comments
 (0)