alpakka icon indicating copy to clipboard operation
alpakka copied to clipboard

Elasticsearch connector should log stacktrace when failure in flow

Open kkoteeswaran opened this issue 2 years ago • 1 comments

Versions used

Scala2.12, Akka 2.6.20, Alapakka Elasticsearch Connector 3.0.4.

Akka version: Akka 2.6.20

Expected Behavior

When there is a failure returned from Elasticsearch in the flow, the entire stacktrace should be logged to help us identify the root cause and remediate.

Actual Behavior

Only the exception is logged. For example:

akkaAddress: akka://job-manager akkaSource: ElasticsearchSimpleFlowStage$StageLogic(akka://job-manager) akkaTimestamp: 21:52:49.005UTC akkaUid: 4755885413838281407 level: ERROR logger_name: akka.stream.alpakka.elasticsearch.impl.ElasticsearchSimpleFlowStage$StageLogic message: Received error from elastic after having already processed 0 documents. Error: java.lang.RuntimeException: Request failed for POST https://query-elasticsearch-prod1.es.eastus2.azure.elastic-cloud.com:9243/_bulk In this case, there were no status code returned from elastic so full stacktrace would have helped.

Relevant logs

https://github.com/akka/alpakka/blob/6494e86c08372db65aeab480a1dad1d241a3ec8e/elasticsearch/src/main/scala/akka/stream/alpakka/elasticsearch/impl/ElasticsearchSimpleFlowStage.scala#L123

Reproducible Test Case

Please provide a PR with a failing test.

If the issue is more complex or requires configuration, please provide a link to a project that reproduces the issue.

kkoteeswaran avatar Jun 09 '23 18:06 kkoteeswaran

I'm not sure how much more information there might be available after posting to Elasticsearch. Would you be in a position to suggest an improvement?

ennru avatar Jun 16 '23 09:06 ennru