Skip to content
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