Skip to content

Accept custom interceptors in ConfigClient and AsyncConfigClient#105

Merged
zeevdr merged 2 commits into
mainfrom
feat/custom-interceptors
May 25, 2026
Merged

Accept custom interceptors in ConfigClient and AsyncConfigClient#105
zeevdr merged 2 commits into
mainfrom
feat/custom-interceptors

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 25, 2026

Summary

  • Enables injection of custom gRPC interceptors (logging, tracing, metrics) without monkeypatching either client
  • For ConfigClient, user interceptors are placed outermost in the grpc.intercept_channel chain so they wrap around the SDK's internal auth interceptor
  • For AsyncConfigClient, interceptors are forwarded to the grpc.aio channel constructor

Test plan

  • ConfigClient: custom interceptor appears in intercept_channel call args
  • ConfigClient: user interceptors are ordered before AuthInterceptor (outermost)
  • ConfigClient: custom interceptors work when no auth metadata is configured
  • AsyncConfigClient: interceptors kwarg forwarded to create_aio_channel
  • AsyncConfigClient: None default when no interceptors provided
  • AsyncConfigClient: multiple interceptors preserved in order
  • All 252 existing tests still pass, 97.53% coverage

Closes #68

…figClient

Both clients now accept an optional `interceptors` list for injecting
logging, tracing, or metrics interceptors without monkeypatching.

For ConfigClient, user-supplied interceptors are placed outermost in the
grpc.intercept_channel chain (before the internal AuthInterceptor).
For AsyncConfigClient, interceptors are forwarded to the grpc.aio channel
constructor.

Closes #68

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr added this to the Beta Readiness milestone May 25, 2026
@zeevdr zeevdr added size: S Quick win — a few hours or less priority: P2 Nice-to-have labels May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr merged commit 073a514 into main May 25, 2026
13 checks passed
@zeevdr zeevdr deleted the feat/custom-interceptors branch May 25, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P2 Nice-to-have size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accept custom interceptors in ConfigClient / AsyncConfigClient

1 participant