Skip to content

Commit 171ff75

Browse files
mergify[bot]pchila
andauthoredNov 28, 2024
Increase failure threshold for agent monitoring inputs from 2 to 5 (#6160) (#6165)
(cherry picked from commit 7190978) Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
1 parent aee5c86 commit 171ff75

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
 

‎internal/pkg/agent/application/monitoring/v1_monitor.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ const (
6464
defaultMetricsCollectionInterval = 60 * time.Second
6565

6666
// metricset stream failure threshold before the stream is marked as DEGRADED
67-
// to avoid marking the agent degraded for transient errors, we set the default threshold to 2
68-
defaultMetricsStreamFailureThreshold = uint(2)
67+
// to avoid marking the agent degraded for transient errors, we set the default threshold to 5
68+
defaultMetricsStreamFailureThreshold = uint(5)
6969
)
7070

7171
var (

‎internal/pkg/agent/application/monitoring/v1_monitor_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
263263
agentInfo, err := info.NewAgentInfo(context.Background(), false)
264264
require.NoError(t, err, "Error creating agent info")
265265

266-
sampleFiveErrorsStreamThreshold := uint(5)
266+
sampleSevenErrorsStreamThreshold := uint(7)
267267
sampleTenErrorsStreamThreshold := uint(10)
268268

269269
tcs := []struct {
@@ -307,7 +307,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
307307
HTTP: &monitoringcfg.MonitoringHTTPConfig{
308308
Enabled: false,
309309
},
310-
FailureThreshold: &sampleFiveErrorsStreamThreshold,
310+
FailureThreshold: &sampleSevenErrorsStreamThreshold,
311311
},
312312
},
313313
policy: map[string]any{
@@ -323,7 +323,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
323323
"default": map[string]any{},
324324
},
325325
},
326-
expectedThreshold: sampleFiveErrorsStreamThreshold,
326+
expectedThreshold: sampleSevenErrorsStreamThreshold,
327327
},
328328
{
329329
name: "policy failure threshold uint",
@@ -334,7 +334,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
334334
HTTP: &monitoringcfg.MonitoringHTTPConfig{
335335
Enabled: false,
336336
},
337-
FailureThreshold: &sampleFiveErrorsStreamThreshold,
337+
FailureThreshold: &sampleSevenErrorsStreamThreshold,
338338
},
339339
},
340340
policy: map[string]any{
@@ -362,7 +362,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
362362
HTTP: &monitoringcfg.MonitoringHTTPConfig{
363363
Enabled: false,
364364
},
365-
FailureThreshold: &sampleFiveErrorsStreamThreshold,
365+
FailureThreshold: &sampleSevenErrorsStreamThreshold,
366366
},
367367
},
368368
policy: map[string]any{
@@ -390,7 +390,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
390390
HTTP: &monitoringcfg.MonitoringHTTPConfig{
391391
Enabled: false,
392392
},
393-
FailureThreshold: &sampleFiveErrorsStreamThreshold,
393+
FailureThreshold: &sampleSevenErrorsStreamThreshold,
394394
},
395395
},
396396
policy: map[string]any{

0 commit comments

Comments
 (0)