influxdata / influxdb-client-java

InfluxDB 2 JVM Based Clients
https://influxdata.github.io/influxdb-client-java/
MIT License
431 stars 129 forks source link

feat: better expose HTTP Error header information in error handling on write #745

Closed karel-rehor closed 1 month ago

karel-rehor commented 1 month ago

Proposed Changes

Http Headers are already part of InfluxException. In the WriteApi they can be accessed with an EventListener. With WriteApiBlocking they get thrown in write method calls.

Note that Cloud v3 and OSS v2 handle exceptional streamed or batched data on the server side a little bit differently. It appears that with v3 cloud batches of data that include some invalid records along with valid ones, will still write the valid records and return a success HTTP status code. OSS v2 on the other hand returns an error status triggering an exception.

Checklist

codecov-commenter commented 1 month ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.50%. Comparing base (7b39e0c) to head (3824efe). Report is 9 commits behind head on master.

Files Patch % Lines
.../influxdb/client/write/events/WriteErrorEvent.java 77.77% 1 Missing and 1 partial :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #745 +/- ## ============================================ - Coverage 88.51% 88.50% -0.02% + Complexity 786 785 -1 ============================================ Files 174 174 Lines 7195 7203 +8 Branches 405 405 ============================================ + Hits 6369 6375 +6 - Misses 696 697 +1 - Partials 130 131 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.