Skip to content

Commit

Permalink
Fix bulker error attributes to be ECS complient (#3034) (#3035)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7f8cd5c)

Co-authored-by: Michel Laterman <[email protected]>
  • Loading branch information
mergify[bot] and michel-laterman authored Oct 12, 2023
1 parent e456245 commit 513e55b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: bug-fix

# Change summary; a 80ish characters long description of the change.
summary: Fix bulker error message attribute to be ECS complient

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
#description:

# Affected component; a word indicating the component this changeset affects.
component:

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
#pr: https://github.com/owner/repo/1234

# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
issue: 3033
4 changes: 2 additions & 2 deletions internal/pkg/bulk/opApiKey.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (b *Bulker) flushUpdateAPIKey(ctx context.Context, queue queueT) error {
idsPerBatch := b.getIDsCountPerBatch(len(role), maxKeySize)
ids := idsPerRole[hash]
if idsPerBatch <= 0 {
log.Error().Str("err", "request too large").Msg("No API Key ID could fit request size for bulk update")
log.Error().Str("error.message", "request too large").Msg("No API Key ID could fit request size for bulk update")
log.Debug().
RawJSON("role", role).
Strs("ids", ids).
Expand Down Expand Up @@ -224,7 +224,7 @@ func (b *Bulker) flushUpdateAPIKey(ctx context.Context, queue queueT) error {
defer res.Body.Close()
}
if res.IsError() {
log.Error().Str("err", res.String()).Msg("Error in bulk API Key update result to Elasticsearch")
log.Error().Str("error.message", res.String()).Msg("Error in bulk API Key update result to Elasticsearch")
return parseError(res)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/opBulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (b *Bulker) flushBulk(ctx context.Context, queue queueT) error {
}

if res.IsError() {
log.Error().Str("mod", kModBulk).Str("err", res.String()).Msg("Fail BulkRequest result")
log.Error().Str("mod", kModBulk).Str("error.message", res.String()).Msg("Fail BulkRequest result")
return parseError(res)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/opRead.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (b *Bulker) flushRead(ctx context.Context, queue queueT) error {
}

if res.IsError() {
log.Warn().Str("mod", kModBulk).Str("err", res.String()).Msg("bulker.flushRead: Error in mget request result to Elasticsearch")
log.Warn().Str("mod", kModBulk).Str("error.message", res.String()).Msg("bulker.flushRead: Error in mget request result to Elasticsearch")
return parseError(res)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/bulk/opSearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (b *Bulker) flushSearch(ctx context.Context, queue queueT) error {
}

if res.IsError() {
log.Warn().Str("mod", kModBulk).Str("err", res.String()).Msg("bulker.flushSearch: Fail writeMsearchBody")
log.Warn().Str("mod", kModBulk).Str("error.message", res.String()).Msg("bulker.flushSearch: Fail writeMsearchBody")
return parseError(res)
}

Expand Down

0 comments on commit 513e55b

Please sign in to comment.