Skip to content

Commit

Permalink
tests: Fix dashboard check when fluent-bit disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
TeddyAndrieux committed Mar 29, 2024
1 parent 0e58dbd commit cabbe5f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 33 deletions.
68 changes: 36 additions & 32 deletions tests/post/steps/files/grafana_dashboard_uids.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
{
"Alertmanager / Overview": "alertmanager-overview",
"Kubernetes / API server": "09ec8aa1e996d6ffcd6817bbaff4db1b",
"Kubernetes / Networking / Cluster": "ff635a025bcfea7bc3dd4f508990a3e9",
"Kubernetes / Controller Manager": "72e0e05bef5099e5f049b05fdc429ed4",
"etcd": "c2f4e12cdf69feb95caa41a5a1b423d9",
"CoreDNS": "vkQ0UHxik",
"Kubernetes / Compute Resources / Cluster": "efa86fd1d0c121a26444b636a3f509a8",
"Kubernetes / Compute Resources / Namespace (Pods)": "85a562078cdf77779eaa1add43ccec1e",
"Kubernetes / Compute Resources / Node (Pods)": "200ac8fdbfbb74b39aff88118e4d1c2c",
"Kubernetes / Compute Resources / Pod": "6581e46e4e5c7ba40a07646395ef7b23",
"Kubernetes / Compute Resources / Workload": "a164a7f0339f99e89cea5cb47e9be617",
"Kubernetes / Compute Resources / Namespace (Workloads)": "a87fb0d919ec0ea5f6543124e16c42a5",
"Kubernetes / Compute Resources / Multi-Cluster": "b59e6c9f2fcbe2e16d77fc492374cc4f",
"Kubernetes / Kubelet": "3138fa155d5915769fbded898ac09fd9",
"Kubernetes / Networking / Namespace (Pods)": "8b7a8b326d7a6f1f04244066368c67af",
"Kubernetes / Networking / Namespace (Workload)": "bbb2a765a623ae38130206c7d94a160f",
"Node Exporter / USE Method / Cluster": "3e97d1d02672cdd0861f4c97c64f89b2",
"Node Exporter / USE Method / Node": "fac67cfbe174d3ef53eb473d73d9212f",
"Node Exporter / Nodes": "fa49a4706d07a042595b664c87fb33ea",
"Nodes (Detailed)": "node-exporter-full",
"Kubernetes / Persistent Volumes": "919b92a8e8041bd567af9edab12c840c",
"Kubernetes / Networking / Pod": "7a18067ce943a40ae25454675c19ff5c",
"Prometheus / Overview": "prometheus-overview",
"Kubernetes / Proxy": "632e265de029684c40b21cb76bca4f94",
"Kubernetes / Scheduler": "2e6b6a3b4bddf1427b3a55aa1311c656",
"Kubernetes / Networking / Workload": "728bf77cc1166d2f3133bf25846876cc",
"Loki": "g6fe30815b172c9da7e813c15ddfe607",
"Logs": "a7e130cb82be229d6f3edbfd0a438001",
"fluent-bit": "d557c8f6-cac1-445f-8ade-4c351a9076b1",
"NGINX Ingress Controller": "nginx",
"NGINX Ingress Request Handling Performance": "4GFbkOsZk",
"Grafana Overview": "6be0s85Mk"
"all": {
"Alertmanager / Overview": "alertmanager-overview",
"Kubernetes / API server": "09ec8aa1e996d6ffcd6817bbaff4db1b",
"Kubernetes / Networking / Cluster": "ff635a025bcfea7bc3dd4f508990a3e9",
"Kubernetes / Controller Manager": "72e0e05bef5099e5f049b05fdc429ed4",
"etcd": "c2f4e12cdf69feb95caa41a5a1b423d9",
"CoreDNS": "vkQ0UHxik",
"Kubernetes / Compute Resources / Cluster": "efa86fd1d0c121a26444b636a3f509a8",
"Kubernetes / Compute Resources / Namespace (Pods)": "85a562078cdf77779eaa1add43ccec1e",
"Kubernetes / Compute Resources / Node (Pods)": "200ac8fdbfbb74b39aff88118e4d1c2c",
"Kubernetes / Compute Resources / Pod": "6581e46e4e5c7ba40a07646395ef7b23",
"Kubernetes / Compute Resources / Workload": "a164a7f0339f99e89cea5cb47e9be617",
"Kubernetes / Compute Resources / Namespace (Workloads)": "a87fb0d919ec0ea5f6543124e16c42a5",
"Kubernetes / Compute Resources / Multi-Cluster": "b59e6c9f2fcbe2e16d77fc492374cc4f",
"Kubernetes / Kubelet": "3138fa155d5915769fbded898ac09fd9",
"Kubernetes / Networking / Namespace (Pods)": "8b7a8b326d7a6f1f04244066368c67af",
"Kubernetes / Networking / Namespace (Workload)": "bbb2a765a623ae38130206c7d94a160f",
"Node Exporter / USE Method / Cluster": "3e97d1d02672cdd0861f4c97c64f89b2",
"Node Exporter / USE Method / Node": "fac67cfbe174d3ef53eb473d73d9212f",
"Node Exporter / Nodes": "fa49a4706d07a042595b664c87fb33ea",
"Nodes (Detailed)": "node-exporter-full",
"Kubernetes / Persistent Volumes": "919b92a8e8041bd567af9edab12c840c",
"Kubernetes / Networking / Pod": "7a18067ce943a40ae25454675c19ff5c",
"Prometheus / Overview": "prometheus-overview",
"Kubernetes / Proxy": "632e265de029684c40b21cb76bca4f94",
"Kubernetes / Scheduler": "2e6b6a3b4bddf1427b3a55aa1311c656",
"Kubernetes / Networking / Workload": "728bf77cc1166d2f3133bf25846876cc",
"Loki": "g6fe30815b172c9da7e813c15ddfe607",
"Logs": "a7e130cb82be229d6f3edbfd0a438001",
"NGINX Ingress Controller": "nginx",
"NGINX Ingress Request Handling Performance": "4GFbkOsZk",
"Grafana Overview": "6be0s85Mk"
},
"fluent-bit": {
"fluent-bit": "d557c8f6-cac1-445f-8ade-4c351a9076b1"
}
}
6 changes: 5 additions & 1 deletion tests/post/steps/test_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,14 @@ def check_grafana_dashboards(host, grafana_api):
pytest.fail(f"Failed to read file {DASHBOARD_UIDS_FILE}: {exc!s}")

try:
expected_dashboards = json.loads(expected_dashboards_str)
expected_dashboards_json = json.loads(expected_dashboards_str)
except json.JSONDecodeError as exc:
pytest.fail(f"Failed to decode JSON from {DASHBOARD_UIDS_FILE}: {exc!s}")

expected_dashboards = expected_dashboards_json["all"]
if utils.get_pillar(host, "addons:fluent-bit:enabled"):
expected_dashboards.update(expected_dashboards_json["fluent-bit"])

uid_mismatches = []
extra_dashboards = []
missing_dashboards = list(expected_dashboards.keys())
Expand Down

0 comments on commit cabbe5f

Please sign in to comment.