feat(o11y): add error extraction to DiscoveryOperation and fix macro compatibility#5843
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an error method to the DiscoveryOperation trait and adds helper macros record_discovery_polling_result! and record_polling_attributes! to handle telemetry and span attribute recording for Discovery LROs. The reviewer pointed out a macro hazard in record_discovery_polling_result! where arguments are evaluated multiple times, and suggested binding them to local references first to prevent unexpected behavior or performance issues.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5843 +/- ##
==========================================
- Coverage 97.89% 97.89% -0.01%
==========================================
Files 227 227
Lines 57992 57995 +3
==========================================
Hits 56773 56773
- Misses 1219 1222 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b50f550 to
9b46cbc
Compare
westarle
left a comment
There was a problem hiding this comment.
Could you please add tests for these?
9b46cbc to
fb1154e
Compare
westarle
left a comment
There was a problem hiding this comment.
I'm not seeing the tests yet, maybe missing a commit?
be40ce2 to
b11158f
Compare
westarle
left a comment
There was a problem hiding this comment.
this LGTM but I would like another Rust team member to review adding a dep from lro to gaxi before merging.
1298ce0 to
4bd7f1d
Compare
DiscoveryOperation and fix macro compatibility
Introduce telemetry injections for Discovery LROs.
This ensures Discovery LROs can record rich error details upon completion, matching the behavior of standard LROs, and provides a cleaner interface for code generation.
Used at googleapis/librarian#6304.