feat(o11y): add record_polling_attributes macro#5838
Open
haphungw wants to merge 2 commits into
Open
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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