Skip to content

Commit

Permalink
Increase failure threshold for agent monitoring inputs from 2 to 5 (#…
Browse files Browse the repository at this point in the history
…6160)

(cherry picked from commit 7190978)
  • Loading branch information
pchila authored and mergify[bot] committed Nov 28, 2024
1 parent 1d3a12a commit 0dbd5db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/agent/application/monitoring/v1_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ const (
defaultMetricsCollectionInterval = 60 * time.Second

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

var (
Expand Down
12 changes: 6 additions & 6 deletions internal/pkg/agent/application/monitoring/v1_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
agentInfo, err := info.NewAgentInfo(context.Background(), false)
require.NoError(t, err, "Error creating agent info")

sampleFiveErrorsStreamThreshold := uint(5)
sampleSevenErrorsStreamThreshold := uint(7)
sampleTenErrorsStreamThreshold := uint(10)

tcs := []struct {
Expand Down Expand Up @@ -307,7 +307,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
HTTP: &monitoringcfg.MonitoringHTTPConfig{
Enabled: false,
},
FailureThreshold: &sampleFiveErrorsStreamThreshold,
FailureThreshold: &sampleSevenErrorsStreamThreshold,
},
},
policy: map[string]any{
Expand All @@ -323,7 +323,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
"default": map[string]any{},
},
},
expectedThreshold: sampleFiveErrorsStreamThreshold,
expectedThreshold: sampleSevenErrorsStreamThreshold,
},
{
name: "policy failure threshold uint",
Expand All @@ -334,7 +334,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
HTTP: &monitoringcfg.MonitoringHTTPConfig{
Enabled: false,
},
FailureThreshold: &sampleFiveErrorsStreamThreshold,
FailureThreshold: &sampleSevenErrorsStreamThreshold,
},
},
policy: map[string]any{
Expand Down Expand Up @@ -362,7 +362,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
HTTP: &monitoringcfg.MonitoringHTTPConfig{
Enabled: false,
},
FailureThreshold: &sampleFiveErrorsStreamThreshold,
FailureThreshold: &sampleSevenErrorsStreamThreshold,
},
},
policy: map[string]any{
Expand Down Expand Up @@ -390,7 +390,7 @@ func TestMonitoringConfigMetricsFailureThreshold(t *testing.T) {
HTTP: &monitoringcfg.MonitoringHTTPConfig{
Enabled: false,
},
FailureThreshold: &sampleFiveErrorsStreamThreshold,
FailureThreshold: &sampleSevenErrorsStreamThreshold,
},
},
policy: map[string]any{
Expand Down

0 comments on commit 0dbd5db

Please sign in to comment.