Skip to content

Commit c70eb38

Browse files
Merge pull request openshift#24565 from lilic/add-telemetry-cap
test/extended/prometheus: Catch when we exceed the limit of series sent
2 parents 0ef478f + c17b415 commit c70eb38

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

test/extended/prometheus/prometheus.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ var _ = g.Describe("[Feature:Prometheus][Late] Alerts", func() {
4747
e2e.Failf("Prometheus could not be located on this cluster, failing prometheus test")
4848
}
4949
})
50+
5051
g.It("shouldn't report any alerts in firing state apart from Watchdog and AlertmanagerReceiversNotConfigured", func() {
5152
if len(os.Getenv("TEST_UNSUPPORTED_ALLOW_VERSION_SKEW")) > 0 {
5253
e2e.Skipf("Test is disabled to allow cluster components to have different versions, and skewed versions trigger multiple other alerts")
@@ -62,6 +63,7 @@ var _ = g.Describe("[Feature:Prometheus][Late] Alerts", func() {
6263
}
6364
runQueries(tests, oc, ns, execPod.Name, url, bearerToken)
6465
})
66+
6567
g.It("should have a Watchdog alert in firing state the entire cluster run", func() {
6668
oc.SetupProject()
6769
ns := oc.Namespace()
@@ -76,6 +78,27 @@ var _ = g.Describe("[Feature:Prometheus][Late] Alerts", func() {
7678

7779
e2e.Logf("Watchdog alert is firing")
7880
})
81+
82+
g.It("shouldn't exceed the 500 series limit of total series sent via telemetry from each cluster", func() {
83+
if !hasPullSecret(oc.AdminKubeClient(), "cloud.openshift.com") {
84+
e2e.Skipf("Telemetry is disabled")
85+
}
86+
oc.SetupProject()
87+
ns := oc.Namespace()
88+
89+
execPod := exutil.CreateCentosExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil)
90+
defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(execPod.Name, metav1.NewDeleteOptions(1)) }()
91+
92+
tests := map[string]bool{
93+
// We want to limit the number of total series sent, the cluster:telemetry_selected_series:count
94+
// rule contains the count of the all the series that are sent via telemetry.
95+
`max_over_time(cluster:telemetry_selected_series:count[2h]) >= 500`: false,
96+
}
97+
runQueries(tests, oc, ns, execPod.Name, url, bearerToken)
98+
99+
e2e.Logf("Total number of series sent via telemetry is below the limit")
100+
})
101+
79102
})
80103

81104
var _ = g.Describe("[Feature:Prometheus][Conformance] Prometheus", func() {

test/extended/util/annotate/generated/zz_generated.annotations.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)