Skip to content

feat(o11y): add record_polling_attributes macro#5838

Open
haphungw wants to merge 2 commits into
googleapis:mainfrom
haphungw:feat-macro-record-polling-attributes
Open

feat(o11y): add record_polling_attributes macro#5838
haphungw wants to merge 2 commits into
googleapis:mainfrom
haphungw:feat-macro-record-polling-attributes

Conversation

@haphungw
Copy link
Copy Markdown
Contributor

@haphungw haphungw commented Jun 3, 2026

Introduce the record_polling_attributes! macro to google-cloud-lro to encapsulate the boilerplate required for injecting LRO telemetry attributes (e.g., poll attempt count) into the active span.

For googleapis/librarian#6275

@haphungw haphungw changed the title feat(o11y): add record_polling_attributes macro feat(o11y): add record_polling_attributes macro Jun 3, 2026
@haphungw haphungw requested a review from westarle June 3, 2026 22:37
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/lro/src/internal/tracing.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.89%. Comparing base (1059b90) to head (c6c4d38).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haphungw haphungw marked this pull request as ready for review June 4, 2026 18:07
@haphungw haphungw requested a review from a team as a code owner June 4, 2026 18:07
@haphungw haphungw force-pushed the feat-macro-record-polling-attributes branch from 167c3e0 to c6c4d38 Compare June 4, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant