-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ES storage: logging number of total and failed requests #902
ES storage: logging number of total and failed requests #902
Conversation
Signed-off-by: Tomasz Adamski <tomasz.adamski@gmail.com>
756b01e
to
225ff97
Compare
hm, I've noticed that we are already logging response. Should we remove it also as it may contain the same number of entries as requests? |
Codecov Report
@@ Coverage Diff @@
## master #902 +/- ##
=======================================
Coverage 99.96% 99.96%
=======================================
Files 126 126
Lines 6072 6072
=======================================
Hits 6070 6070
Misses 2 2 Continue to review full report at Codecov.
|
pkg/es/config/config.go
Outdated
failed := 0 | ||
if response.Failed() != nil { | ||
failed = len(response.Failed()) | ||
} |
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.
failed := len(response.Failed())
is sufficient, since len(nil) == 0
pkg/es/config/config.go
Outdated
logger.Error("Elasticsearch could not process bulk request", zap.Error(err), | ||
zap.Any("response", response)) | ||
zap.Any("response", response), zap.Int("failed_number", failed), |
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.
- 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
Signed-off-by: Tomasz Adamski <tomasz.adamski@gmail.com>
32c8068
to
c8dfec8
Compare
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.
lgtm, thx
Plz, review it as I am not golang native ;)
Which problem is this PR solving?
Short description of the changes