Repository navigation
feat(o11y): add record_polling_attributes macro - #5838
Conversation
record_polling_attributes macro
There was a problem hiding this comment.
Code Review
This pull request introduces a new macro, record_polling_attributes, to inject LRO-specific telemetry attributes into the active span. The review feedback points out that the macro evaluates the $span expression twice when the google_cloud_unstable_tracing feature is enabled, which could lead to side effects, and ignores it when disabled, potentially triggering unused variable warnings. A refactoring is suggested to bind $span to a local reference and handle the disabled case safely.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5838 +/- ##
=======================================
Coverage 97.89% 97.89%
=======================================
Files 226 226
Lines 57713 57713
=======================================
+ Hits 56496 56497 +1
+ Misses 1217 1216 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
167c3e0 to
c6c4d38
Compare
westarle
left a comment
There was a problem hiding this comment.
please fix the comments before submitting
| async fn record_polling_attributes_macro() { | ||
| let guard = google_cloud_test_utils::test_layer::TestLayer::initialize(); | ||
|
|
||
| let span = tracing::info_span!( |
There was a problem hiding this comment.
is there a macro to create the span? It might help to make sure you've put the attribute names consistently to use that (or create it)
There was a problem hiding this comment.
good suggestion, i added one
668283d to
e210d47
Compare
aca37f9 to
a6c1347
Compare
Introduce the
record_polling_attributes!macro togoogle-cloud-lroto encapsulate the boilerplate required for injecting LRO telemetry attributes (e.g., poll attempt count) into the active span.For googleapis/librarian#6275