Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/es/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ func (c *Configuration) NewClient(logger *zap.Logger, metricsFactory metrics.Fac
sm.Emit(err, duration)

if err != nil {
failed := 0
if response.Failed() != nil {
failed = len(response.Failed())
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failed := len(response.Failed()) is sufficient, since len(nil) == 0

total := len(requests)
logger.Error("Elasticsearch could not process bulk request", zap.Error(err),
zap.Any("response", response))
zap.Any("response", response), zap.Int("failed_number", failed),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • let's put one arg per line, including error
  • rename to request_count and failed_count
  • I would order the fields: request_count, failed_count, error, response

zap.Int("requests_number", total))
}
}).
BulkSize(c.BulkSize).
Expand Down