Skip to content

feat(o11y): add error extraction to DiscoveryOperation and fix macro compatibility#5843

Open
haphungw wants to merge 3 commits into
googleapis:mainfrom
haphungw:fix-discovery-lro-error
Open

feat(o11y): add error extraction to DiscoveryOperation and fix macro compatibility#5843
haphungw wants to merge 3 commits into
googleapis:mainfrom
haphungw:fix-discovery-lro-error

Conversation

@haphungw
Copy link
Copy Markdown
Contributor

@haphungw haphungw commented Jun 4, 2026

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.

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 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.

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

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.88%. Comparing base (1059b90) to head (9b46cbc).

Files with missing lines Patch % Lines
src/lro/src/internal/discovery.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5843      +/-   ##
==========================================
- Coverage   97.89%   97.88%   -0.01%     
==========================================
  Files         226      226              
  Lines       57713    57716       +3     
==========================================
  Hits        56496    56496              
- Misses       1217     1220       +3     

☔ 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 force-pushed the fix-discovery-lro-error branch from b50f550 to 9b46cbc Compare June 4, 2026 20:07
@haphungw haphungw marked this pull request as ready for review June 4, 2026 21:19
@haphungw haphungw requested a review from a team as a code owner June 4, 2026 21:19
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