Skip to content

Commit 589b8d4

Browse files
committed
fixup! fixup! MON-3500: Enable sending exemplars over RW in UWM
1 parent 332b7f5 commit 589b8d4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/e2e/config_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ func TestUserWorkloadMonitorPrometheusK8Config(t *testing.T) {
619619
datacenter: eu-west
620620
remoteWrite:
621621
- url: "https://test.remotewrite.com/api/write"
622+
sendExemplars: true
622623
volumeClaimTemplate:
623624
spec:
624625
resources:
@@ -687,6 +688,10 @@ func TestUserWorkloadMonitorPrometheusK8Config(t *testing.T) {
687688
name: "assert query log file value is set and correct",
688689
assertion: assertQueryLogValueEquals(f.UserWorkloadMonitoringNs, crName, "/tmp/test.log"),
689690
},
691+
{
692+
name: "assert exemplars are enabled",
693+
assertion: assertExemplarsEnabled(f.UserWorkloadMonitoringNs),
694+
},
690695
} {
691696
t.Run(tc.name, tc.assertion)
692697
}
@@ -1079,3 +1084,24 @@ func assertQueryLogValueEquals(namespace, crName, value string) func(t *testing.
10791084
}
10801085
}
10811086
}
1087+
1088+
func assertExemplarsEnabled(namespace string) func(t *testing.T) {
1089+
return func(t *testing.T) {
1090+
err := framework.Poll(time.Second, time.Minute*5, func() error {
1091+
prom, err := f.MonitoringClient.Prometheuses(namespace).Get(context.Background(), "user-workload", metav1.GetOptions{})
1092+
if err != nil {
1093+
t.Fatal("failed to get required prometheus cr", err)
1094+
}
1095+
exemplarStorageFeatureFlag := "exemplar-storage"
1096+
for _, enabledFeature := range prom.Spec.EnableFeatures {
1097+
if enabledFeature == "exemplar-storage" {
1098+
return nil
1099+
}
1100+
}
1101+
return fmt.Errorf("expected %s feature to be enabled", exemplarStorageFeatureFlag)
1102+
})
1103+
if err != nil {
1104+
t.Fatal(err)
1105+
}
1106+
}
1107+
}

0 commit comments

Comments
 (0)