Skip to content

Commit 225ff97

Browse files
committed
ES storage: logging number of total and failed requests
Signed-off-by: Tomasz Adamski <tomasz.adamski@gmail.com>
1 parent 2793aa8 commit 225ff97

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/es/config/config.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,14 @@ func (c *Configuration) NewClient(logger *zap.Logger, metricsFactory metrics.Fac
7979
sm.Emit(err, duration)
8080

8181
if err != nil {
82+
failed := 0
83+
if response.Failed() != nil {
84+
failed = len(response.Failed())
85+
}
86+
total := len(requests)
8287
logger.Error("Elasticsearch could not process bulk request", zap.Error(err),
83-
zap.Any("response", response))
88+
zap.Any("response", response), zap.Int("failed_number", failed),
89+
zap.Int("requests_number", total))
8490
}
8591
}).
8692
BulkSize(c.BulkSize).

0 commit comments

Comments
 (0)