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

Tests: Don't check remote_write_requests on spokes #1433

Merged
merged 2 commits into from
May 14, 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
1 change: 0 additions & 1 deletion examples/export/v1beta2/custom-certs/observability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ spec:
advanced:
retentionConfig:
blockDuration: 3h
cleanupInterval: 6m
deleteDelay: 50h
retentionInLocal: 5d
retentionResolution1h: 31d
Expand Down
1 change: 0 additions & 1 deletion examples/export/v1beta2/observability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ spec:
advanced:
retentionConfig:
blockDuration: 3h
cleanupInterval: 6m
deleteDelay: 50h
retentionInLocal: 5d
retentionResolution1h: 31d
Expand Down
1 change: 0 additions & 1 deletion examples/mco/e2e/v1beta2/custom-certs/observability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ spec:
advanced:
retentionConfig:
blockDuration: 3h
cleanupInterval: 6m
deleteDelay: 50h
retentionInLocal: 5d
retentionResolution1h: 31d
Expand Down
1 change: 0 additions & 1 deletion examples/mco/e2e/v1beta2/observability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ spec:
advanced:
retentionConfig:
blockDuration: 3h
cleanupInterval: 6m
deleteDelay: 50h
retentionInLocal: 5d
retentionResolution1h: 31d
Expand Down
62 changes: 34 additions & 28 deletions tests/pkg/tests/observability_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,42 @@ var _ = Describe("Observability:", func() {
yamlB,
)).NotTo(HaveOccurred())

// Get name of the hub cluster
hubClusterName := "local-cluster"
for _, cluster := range testOptions.ManagedClusters {
if cluster.BaseDomain == testOptions.HubCluster.BaseDomain {
hubClusterName = cluster.Name
}
}

By("Waiting for metrics acm_remote_write_requests_total on grafana console")
Eventually(func() error {
for _, cluster := range clusters {
query := fmt.Sprintf("acm_remote_write_requests_total{cluster=\"%s\"} offset 1m", cluster)
err, _ := utils.ContainManagedClusterMetric(
testOptions,
query,
[]string{`"__name__":"acm_remote_write_requests_total"`},
)
if err != nil {
return err
}
err, _ = utils.ContainManagedClusterMetric(
testOptions,
query,
[]string{`"__name__":"acm_remote_write_requests_total"`,
`"code":"200`, `"name":"thanos-receiver"`},
)
if err != nil {
return errors.New("metrics not forwarded to thanos-receiver")
}
err, _ = utils.ContainManagedClusterMetric(
testOptions,
query,
[]string{`"__name__":"acm_remote_write_requests_total"`,
`"code":"204`, `"name":"victoriametrics"`},
)
if err != nil {
return errors.New("metrics not forwarded to victoriametrics")
}
query := fmt.Sprintf("acm_remote_write_requests_total{cluster=\"%s\"} offset 1m", hubClusterName)
err, _ := utils.ContainManagedClusterMetric(
testOptions,
query,
[]string{`"__name__":"acm_remote_write_requests_total"`},
)
if err != nil {
return err
}
err, _ = utils.ContainManagedClusterMetric(
testOptions,
query,
[]string{`"__name__":"acm_remote_write_requests_total"`,
`"code":"200`, `"name":"thanos-receiver"`},
)
if err != nil {
return errors.New("metrics not forwarded to thanos-receiver")
}
err, _ = utils.ContainManagedClusterMetric(
testOptions,
query,
[]string{`"__name__":"acm_remote_write_requests_total"`,
`"code":"204`, `"name":"victoriametrics"`},
)
if err != nil {
return errors.New("metrics not forwarded to victoriametrics")
}
return nil
}, EventuallyTimeoutMinute*20, EventuallyIntervalSecond*5).Should(Succeed())
Expand Down