@@ -10,6 +10,7 @@ Library ../../resources/loki.py
10
10
Resource ../../resources/kubeconfig.resource
11
11
Resource ../../resources/common.resource
12
12
Resource ../../resources/systemd.resource
13
+ Resource ../../resources/observability.resource
13
14
14
15
Suite Setup Setup Suite And Prepare Test Host
15
16
Suite Teardown Teardown Suite And Revert Test Host
@@ -31,15 +32,9 @@ Host Metrics Are Exported
31
32
... \ [0 -9]+, "metrics": [0-9]+, "data points": [0-9]+}
32
33
Pattern Should Appear In Log Output ${JOURNAL_CUR } ${pattern } unit="microshift-observability"
33
34
34
- Check Prometheus Query
35
- ... ${PROMETHEUS_HOST }
36
- ... ${PROMETHEUS_PORT }
37
- ... system_cpu_time_seconds_total{cpu="cpu0",state="idle"}
38
-
39
- Check Prometheus Exporter
40
- ... ${USHIFT_HOST }
41
- ... ${PROM_EXPORTER_PORT }
42
- ... system_cpu_time_seconds_total{cpu="cpu0",state="idle"}
35
+ Set Test Variable ${METRIC } system_cpu_time_seconds_total{cpu="cpu0",state="idle"}
36
+ Check Prometheus Query ${PROMETHEUS_HOST } ${PROMETHEUS_PORT } ${METRIC }
37
+ Check Prometheus Exporter ${USHIFT_HOST } ${PROM_EXPORTER_PORT } ${METRIC }
43
38
44
39
Kube Metrics Are Exported
45
40
[Documentation] The opentelemetry-collector should be able to export kube metrics.
@@ -49,25 +44,13 @@ Kube Metrics Are Exported
49
44
... \ [0 -9]+, "metrics": [0-9]+, "data points": [0-9]+}
50
45
Pattern Should Appear In Log Output ${JOURNAL_CUR } ${pattern } unit="microshift-observability"
51
46
52
- Check Prometheus Query
53
- ... ${PROMETHEUS_HOST }
54
- ... ${PROMETHEUS_PORT }
55
- ... container_cpu_time_seconds_total
56
-
57
- Check Prometheus Exporter
58
- ... ${USHIFT_HOST }
59
- ... ${PROM_EXPORTER_PORT }
60
- ... container_cpu_time_seconds_total
61
-
62
- Check Prometheus Query
63
- ... ${PROMETHEUS_HOST }
64
- ... ${PROMETHEUS_PORT }
65
- ... k8s_pod_cpu_time_seconds_total
47
+ Set Test Variable ${METRIC } container_cpu_time_seconds_total
48
+ Check Prometheus Query ${PROMETHEUS_HOST } ${PROMETHEUS_PORT } ${METRIC }
49
+ Check Prometheus Exporter ${USHIFT_HOST } ${PROM_EXPORTER_PORT } ${METRIC }
66
50
67
- Check Prometheus Exporter
68
- ... ${USHIFT_HOST }
69
- ... ${PROM_EXPORTER_PORT }
70
- ... k8s_pod_cpu_time_seconds_total
51
+ Set Test Variable ${METRIC } k8s_pod_cpu_time_seconds_total
52
+ Check Prometheus Query ${PROMETHEUS_HOST } ${PROMETHEUS_PORT } ${METRIC }
53
+ Check Prometheus Exporter ${USHIFT_HOST } ${PROM_EXPORTER_PORT } ${METRIC }
71
54
72
55
Journald Logs Are Exported
73
56
[Documentation] The opentelemetry-collector should be able to export logs to journald.
@@ -78,10 +61,7 @@ Journald Logs Are Exported
78
61
... \ "log records": [0-9]+\\}
79
62
Pattern Should Appear In Log Output ${JOURNAL_CUR } ${pattern } unit="microshift-observability"
80
63
81
- Check Loki Query
82
- ... ${LOKI_HOST }
83
- ... ${LOKI_PORT }
84
- ... {job="journald",exporter="OTLP"}
64
+ Check Loki Query ${LOKI_HOST } ${LOKI_PORT } {job="journald",exporter="OTLP"}
85
65
86
66
Kube Events Logs Are Exported
87
67
[Documentation] The opentelemetry-collector should be able to export logs to journald.
@@ -92,10 +72,7 @@ Kube Events Logs Are Exported
92
72
... \ "log records": [0-9]+\\}
93
73
Pattern Should Appear In Log Output ${JOURNAL_CUR } ${pattern } unit="microshift-observability"
94
74
95
- Check Loki Query
96
- ... ${LOKI_HOST }
97
- ... ${LOKI_PORT }
98
- ... {job="kube_events",exporter="OTLP"}
75
+ Check Loki Query ${LOKI_HOST } ${LOKI_PORT } {job="kube_events",exporter="OTLP"}
99
76
100
77
Logs Should Not Contain Receiver Errors
101
78
[Documentation] Internal receiver errors are not treated as fatal. Typically these are due to a misconfiguration
@@ -110,6 +87,8 @@ Logs Should Not Contain Receiver Errors
110
87
Setup Suite And Prepare Test Host
111
88
[Documentation] The service starts after MicroShift starts and thus will start generating pertinent log data
112
89
... right away. When the suite is executed, immediately get the cursor for the microshift-observability unit.
90
+ Start Prometheus Server
91
+ Start Loki Server
113
92
Setup Suite
114
93
Check Required Observability Variables
115
94
Set Test OTEL Configuration
@@ -153,6 +132,8 @@ Teardown Suite And Revert Test Host
153
132
[Documentation] Set back original OTEL config and teardown Suite
154
133
Set Back Original OTEL Configuration
155
134
Teardown Suite
135
+ Stop Loki Server
136
+ Stop Prometheus Server
156
137
157
138
Set Back Original OTEL Configuration
158
139
[Documentation] Set Back Original OTEL Configuration
0 commit comments