Skip to content

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

Merged
haphungw merged 1 commit into
googleapis:mainfrom
haphungw:fix-discovery-lro-error
Jun 10, 2026
Merged

feat(o11y): add error extraction to DiscoveryOperation and fix macro compatibility#5843
haphungw merged 1 commit into
googleapis:mainfrom
haphungw:fix-discovery-lro-error

Conversation

@haphungw

@haphungw haphungw commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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.

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

Copy link
Copy Markdown

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

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.89%. Comparing base (817555e) to head (4bd7f1d).

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.89%   -0.01%     
==========================================
  Files         227      227              
  Lines       57992    57995       +3     
==========================================
  Hits        56773    56773              
- Misses       1219     1222       +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

@westarle westarle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please add tests for these?

@haphungw haphungw force-pushed the fix-discovery-lro-error branch from 9b46cbc to fb1154e Compare June 8, 2026 16:44

@westarle westarle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not seeing the tests yet, maybe missing a commit?

Comment thread src/lro/src/internal/tracing.rs Outdated
@haphungw haphungw force-pushed the fix-discovery-lro-error branch 4 times, most recently from be40ce2 to b11158f Compare June 10, 2026 16:26

@westarle westarle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this LGTM but I would like another Rust team member to review adding a dep from lro to gaxi before merging.

@haphungw haphungw force-pushed the fix-discovery-lro-error branch from 1298ce0 to 4bd7f1d Compare June 10, 2026 20:20
@haphungw haphungw changed the title feat(o11y): add error extraction to DiscoveryOperation and fix macro compatibility feat(o11y): add error extraction to DiscoveryOperation and fix macro compatibility Jun 10, 2026
@haphungw haphungw enabled auto-merge (squash) June 10, 2026 20:38
@haphungw haphungw disabled auto-merge June 10, 2026 20:39
@haphungw haphungw enabled auto-merge (squash) June 10, 2026 20:39
@haphungw haphungw merged commit 094bf6d into googleapis:main Jun 10, 2026
37 checks passed
@haphungw haphungw deleted the fix-discovery-lro-error branch June 10, 2026 20:41
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.

2 participants