Skip to content

feat: add support for gRPC client interceptors in ClientConfig#360

Merged
NguyenHoangSon96 merged 9 commits intomainfrom
feat/support-passing-interceptor
Feb 26, 2026
Merged

feat: add support for gRPC client interceptors in ClientConfig#360
NguyenHoangSon96 merged 9 commits intomainfrom
feat/support-passing-interceptor

Conversation

@NguyenHoangSon96
Copy link
Contributor

@NguyenHoangSon96 NguyenHoangSon96 commented Feb 24, 2026

Closes #

Proposed Changes

  • Support passing interceptor functions to the Flight client.
  • Add test case.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@NguyenHoangSon96 NguyenHoangSon96 added this to the 1.8.0 milestone Feb 24, 2026
@NguyenHoangSon96 NguyenHoangSon96 self-assigned this Feb 24, 2026
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.26%. Comparing base (db93077) to head (ec69587).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...va/com/influxdb/v3/client/config/ClientConfig.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #360      +/-   ##
==========================================
- Coverage   87.27%   87.26%   -0.01%     
==========================================
  Files          20       20              
  Lines        1336     1343       +7     
  Branches      227      229       +2     
==========================================
+ Hits         1166     1172       +6     
  Misses         81       81              
- Partials       89       90       +1     

☔ View full report in Codecov by Sentry.
📢 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.

@alespour
Copy link
Contributor

LGTM, let's ask Copilot now...

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for gRPC client interceptors in the ClientConfig, allowing users to pass custom interceptor functions to the Flight client for query operations. This enables use cases like custom header injection, logging, monitoring, or request modification at the gRPC layer.

Changes:

  • Added interceptors field to ClientConfig with getter and builder method
  • Updated FlightSqlClient to apply interceptors to the NettyChannelBuilder when configured
  • Added test case demonstrating header injection via an interceptor

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
CHANGELOG.md Documents the new feature for version 1.9.0
src/main/java/com/influxdb/v3/client/config/ClientConfig.java Adds interceptors field, getter, builder method, and updates equals/hashCode
src/main/java/com/influxdb/v3/client/internal/FlightSqlClient.java Applies interceptors to NettyChannelBuilder when creating FlightClient
src/test/java/com/influxdb/v3/client/internal/FlightSqlClientTest.java Adds test case verifying interceptor functionality with custom header injection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@alespour alespour left a comment

Choose a reason for hiding this comment

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

LGTM, please check Copilot review, mostly nit picks.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/main/java/com/influxdb/v3/client/config/ClientConfig.java:418

  • The toString() method should include the interceptors field for consistency with other configuration fields. Most configuration fields like headers, defaultTags, sslRootsFilePath, and disableGRPCCompression are included in the string representation for debugging purposes. Add a line to include interceptors in the string representation.
    @Override
    public String toString() {
        return new StringJoiner(", ", ClientConfig.class.getSimpleName() + "ClientConfig[", "]")
                .add("host='" + host + "'")
                .add("organization='" + organization + "'")
                .add("database='" + database + "'")
                .add("writePrecision=" + writePrecision)
                .add("gzipThreshold=" + gzipThreshold)
                .add("writeNoSync=" + writeNoSync)
                .add("timeout=" + timeout)
                .add("writeTimeout=" + writeTimeout)
                .add("queryTimeout=" + queryTimeout)
                .add("allowHttpRedirects=" + allowHttpRedirects)
                .add("disableServerCertificateValidation=" + disableServerCertificateValidation)
                .add("proxy=" + proxy)
                .add("proxyUrl=" + proxyUrl)
                .add("authenticator=" + authenticator)
                .add("headers=" + headers)
                .add("defaultTags=" + defaultTags)
                .add("sslRootsFilePath=" + sslRootsFilePath)
                .add("disableGRPCCompression=" + disableGRPCCompression)
                .toString();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NguyenHoangSon96 NguyenHoangSon96 merged commit 5ea6c2c into main Feb 26, 2026
14 checks passed
@NguyenHoangSon96 NguyenHoangSon96 deleted the feat/support-passing-interceptor branch February 26, 2026 07:25
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.

3 participants