Skip to content

Commit f1731f5

Browse files
authored
Add bulk indexing failure log entry to ignores (#17774)
1 parent 262af21 commit f1731f5

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

integrationservertest/internal/asserts/apm_logs.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ import (
3232
// for displaying information.
3333
type APMLogEntry struct {
3434
Timestamp time.Time `json:"@timestamp"`
35-
Message string
36-
LogLogger string `json:"log.logger"`
35+
Message string `json:"message"`
36+
LogLogger string `json:"log.logger"`
37+
Service struct {
38+
// Version shows which version this log entry came from.
39+
Version string `json:"version"`
40+
} `json:"service"`
3741
}
3842

3943
func ZeroAPMLogs(t *testing.T, resp search.Response) {

integrationservertest/logs_filters.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ func (e apmErrorLogs) ToQueries() []types.Query {
3636
}
3737

3838
var (
39+
// This error seems to happen occasionally in-between upgrades.
40+
// On upgrade, the APM server gets restarted while metrics are not fully flushed,
41+
// causing this error to occur.
42+
bulkIndexingFailed = apmErrorLog(types.Query{
43+
MatchPhrase: map[string]types.MatchPhraseQuery{
44+
"message": {Query: "bulk indexing request failed"},
45+
},
46+
})
47+
3948
tlsHandshakeError = apmErrorLog(types.Query{
4049
MatchPhrasePrefix: map[string]types.MatchPhrasePrefixQuery{
4150
"message": {Query: "http: TLS handshake error from 127.0.0.1:"},

integrationservertest/standalone_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ func managed7Runner(fromVersion7, toVersion8, toVersion9 ech.Version, config upg
154154
addIndexTemplateTracesError,
155155
},
156156
APMErrorLogsIgnored: apmErrorLogs{
157+
bulkIndexingFailed,
157158
tlsHandshakeError,
158159
esReturnedUnknown503,
159160
refreshCache403,
@@ -215,6 +216,7 @@ func managed8Runner(fromVersion7, toVersion8, toVersion9 ech.Version, config upg
215216
eventLoopShutdown,
216217
},
217218
APMErrorLogsIgnored: apmErrorLogs{
219+
bulkIndexingFailed,
218220
tlsHandshakeError,
219221
esReturnedUnknown503,
220222
refreshCache403,
@@ -261,6 +263,7 @@ func managed9Runner(fromVersion7, toVersion8, toVersion9 ech.Version, config upg
261263
eventLoopShutdown,
262264
},
263265
APMErrorLogsIgnored: apmErrorLogs{
266+
bulkIndexingFailed,
264267
tlsHandshakeError,
265268
esReturnedUnknown503,
266269
refreshCache503,

integrationservertest/upgrade_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ func buildTestSteps(t *testing.T, versions ech.Versions, config upgradeTestConfi
162162
// unrelated to our test.
163163
steps = append(steps, checkErrorLogsStep{
164164
APMErrorLogsIgnored: apmErrorLogs{
165+
bulkIndexingFailed,
165166
tlsHandshakeError,
166167
esReturnedUnknown503,
167168
refreshCache403,

0 commit comments

Comments
 (0)