Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.17](backport #6160) Increase failure threshold for agent monitoring inputs from 2 to 5 #6166

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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