You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test: query for $ and $$ label for CRs and external labels (#1050)
[comment]: # (Note that your PR title should follow the conventional
commit format: https://conventionalcommits.org/en/v1.0.0/#summary)
# PR Description
Add to the query tests to check for $ and $$ labels on PodMonitor and
ServiceMonitor and to check for external labels
"node_name_double_dollar_sign": ".+", // Legacy backwards compatibility for $$NODE_NAME when single $ was not supported
278
+
"node_ip_double_dollar_sign": "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}", // Legacy backwards compatibility for $$NODE_IP when single $ was not supported
279
+
}),
280
+
Entry("Relabeling with dollar signs & external labels for PodMonitor", "default/referenceapp", "up", map[string]string{
281
+
"double_dollar_sign": "\\$1", // PodMonitor does not have the legacy backwards compatibility for $$1
282
+
"single_dollar_sign": "prometheus-reference-app", // $1 does work for PodMonitor
283
+
"external_label_1": "external_label_value",
284
+
"external_label_123": "external_label_value",
285
+
}),
286
+
Entry("Relabeling with dollar signs & external labels for ServiceMonitor", "prometheus-reference-service", "up", map[string]string{
287
+
"double_dollar_sign": "\\$1", // ServiceMonitor does not have the legacy backwards compatibility for $$1
288
+
"single_dollar_sign": "prometheus-reference-app", // $1 does work for ServiceMonitor
289
+
"external_label_1": "external_label_value",
290
+
"external_label_123": "external_label_value",
291
+
}),
292
+
Entry("External labels are applied from ReplicaSet Configmap", "prometheus_ref_app", "up", map[string]string{
293
+
"external_label_1": "external_label_value",
294
+
"external_label_123": "external_label_value",
295
+
}),
296
+
Entry("External labels are applied from DaemonSet Configmap", "node-configmap", "up", map[string]string{
297
+
"external_label_1": "external_label_value",
298
+
"external_label_123": "external_label_value",
274
299
}),
275
-
Entry("Metric relabeling with $NODE_NAME and $NODE_IP", "node-configmap", "up", []string{
276
-
"node_name_single_dollar_sign",
277
-
"node_ip_single_dollar_sign",
278
-
"node_name_double_dollar_sign",
279
-
"node_ip_double_dollar_sign",
300
+
Entry("External labels are applied from Windows DaemonSet Configmap", "windows-node-configmap", "up", map[string]string{
Copy file name to clipboardexpand all lines: otelcollector/test/test-cluster-yamls/configmaps/ama-metrics-prometheus-config-node-windows-configmap.yaml
0 commit comments