-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KNET-12362] Produce V3 API - Improve visibility around produce-record errors #1300
base: master
Are you sure you want to change the base?
Conversation
…annot work on local testings)
…records in one single request
…henRequestLogHasAggregatedErrorCodes, modify variable/function names, avoided hard coding "Codes=", corresponding changes to tests
…roduceActionTest accrodingly
…ceRecordErrorCounter
[KNET-12362] Produce V3 API - Improve visibility around produce-record errors
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great that Kafka REST continues to receive attention and improvements, especially for its newest significant API, the Produce v3!
I have one comment about the error counting structure.
kafka-rest/src/main/java/io/confluent/kafkarest/requestlog/CustomLog.java
Outdated
Show resolved
Hide resolved
…Counter, add cutom matcher for easymocking ProduceErrorCounter
[Update] Remove `equals` and `hashCode` methods of ProduceRecordError…
kafka-rest/src/main/java/io/confluent/kafkarest/response/StreamingResponse.java
Outdated
Show resolved
Hide resolved
kafka-rest/src/main/java/io/confluent/kafkarest/response/StreamingResponse.java
Outdated
Show resolved
Hide resolved
kafka-rest/src/main/java/io/confluent/kafkarest/response/StreamingResponse.java
Show resolved
Hide resolved
kafka-rest/src/test/java/io/confluent/kafkarest/integration/CustomLogIntegrationTest.java
Show resolved
Hide resolved
kafka-rest/src/test/java/io/confluent/kafkarest/integration/CustomLogIntegrationTest.java
Outdated
Show resolved
Hide resolved
One last question from me - did you test this in our cloud environment @wcheng92 ? |
[Update] Remove counting error codes for 200
[Update] Fixed assertion caused by counting 200 error code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
A single http requests to produce V3 API can contain many produce-records. A record receipt is returned for each record, each with its own error-code. For example see the produce example to produce a batch of records - Kafka REST APIs for Confluent Cloud | Confluent Documentation
Using the above example, REST log would like below with status 200(OK) -
10.1.1.158 - - [14/Nov/2023:19:20:40 +0000] "POST /kafka/v3/clusters/lkc-m8j07q/topics/apac.consumer.AddCalculatedAttributes.v1/records HTTP/1.1" 200 196 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 Hutool" 503 -
Whereas clearly the user’s request had errors(sometimes 5xx). There is no visibility about these record-level error codes, which hinders oncall ability to answer customer’s question like “did the produce API request failed/succeeded for all records, or subset of records?”. This should be improved
Solution
Add a summarised counts of different error-codes in REST request log,
Codes=401:1,503:1
as in example section below.Example
Before -
10.1.1.158 - - [14/Nov/2023:19:20:40 +0000] "POST /kafka/v3/clusters/lkc-m8j07q/topics/apac.consumer.AddCalculatedAttributes.v1/records HTTP/1.1" 200 196 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 Hutool" 503 -
Now -
10.1.1.158 - - [14/Nov/2023:19:20:40 +0000] "POST /kafka/v3/clusters/lkc-m8j07q/topics/apac.consumer.AddCalculatedAttributes.v1/records HTTP/1.1" 200 196 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 Hutool" 503 - Codes=401:1,503:1