confluentinc / kafka-connect-elasticsearch

Kafka Connect Elasticsearch connector
Other
15 stars 436 forks source link

Log when there are too many requests errors #737

Open yeikel opened 11 months ago

yeikel commented 11 months ago

When TOO_MANY_REQUESTS happen, the connector does not seem to log this as the error is bubbled up to Kafka connect instead

It would be useful if we could log that type of failures as an error as well similar to how we long it when there are timeouts


org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception. at 
org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:618) at 
org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:334) at 
org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:235) at 
org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:204) at 
org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:201) at 
org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:256) at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at 
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at 
java.base/java.lang.Thread.run(Thread.java:829) Caused by: org.apache.kafka.connect.errors.ConnectException: Indexing record failed. at 
io.confluent.connect.elasticsearch.ElasticsearchClient.handleResponse(ElasticsearchClient.java:639) at 
io.confluent.connect.elasticsearch.ElasticsearchClient$1.afterBulk(ElasticsearchClient.java:428) at 
org.elasticsearch.action.bulk.BulkRequestHandler$1.onResponse(BulkRequestHandler.java:59) at 
org.elasticsearch.action.bulk.BulkRequestHandler$1.onResponse(BulkRequestHandler.java:56) at 
org.elasticsearch.action.ActionListener$RunAfterActionListener.onResponse(ActionListener.java:341) at 
org.elasticsearch.action.bulk.Retry$RetryHandler.finishHim(Retry.java:168) at 
org.elasticsearch.action.bulk.Retry$RetryHandler.onResponse(Retry.java:112) at 
org.elasticsearch.action.bulk.Retry$RetryHandler.onResponse(Retry.java:71) at 
io.confluent.connect.elasticsearch.ElasticsearchClient.lambda$null$1(ElasticsearchClient.java:214) ... 5 more Caused by: java.lang.Throwable: Response status: 'TOO_MANY_REQUESTS', Index: 'xxx', Document Id: yyyy'. ... 14 more