Skip to content

Commit

Permalink
fix(grafana): Fix dashboard Hubble pod-flow-workload dashboard (#1341)
Browse files Browse the repository at this point in the history
# Description

* fix pod-flow-workload Hubble dashboard

## Related Issue

#811 

## Checklist

- [x] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed

![Screenshot 2025-02-12
115154](https://github.com/user-attachments/assets/186a42cb-2b45-45a8-b6c1-8ec6dba4d593)

![Screenshot 2025-02-12
115213](https://github.com/user-attachments/assets/386ae58f-6bc1-4f6f-b723-d7d1bad73e04)

## Additional Notes

Dashboard `pod-flows-namespace.json` is still broken. Need someone to
investigate how to fix it (I'll link the relevant GH issue here).

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
  • Loading branch information
SRodi authored Feb 12, 2025
1 parent b6c3cc7 commit 764d86b
Showing 1 changed file with 23 additions and 32 deletions.
55 changes: 23 additions & 32 deletions deploy/hubble/grafana/dashboards/pod-flows-workload.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "count(\r\n sum by (source) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"forwarded\"}[10m])\r\n ) >= 0.01\r\n)",
"expr": "count(\r\n sum by (source) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"FORWARDED\"}[10m])\r\n ) >= 0.01\r\n)",
"hide": false,
"instant": true,
"legendFormat": "Pods with Outgoing Traffic",
Expand Down Expand Up @@ -200,7 +200,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "round(sum (rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"forwarded\"}[$__rate_interval])), 0.01)",
"expr": "round(sum (rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"FORWARDED\"}[$__rate_interval])), 0.01)",
"hide": false,
"instant": false,
"legendFormat": "Max Outgoing Traffic",
Expand Down Expand Up @@ -267,7 +267,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "round(sum (rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"forwarded\"}[$__rate_interval])), 0.01)",
"expr": "round(sum (rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"FORWARDED\"}[$__rate_interval])), 0.01)",
"hide": false,
"instant": false,
"legendFormat": "Min Outgoing Traffic",
Expand Down Expand Up @@ -334,7 +334,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "count(\r\n sum by (destination) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"forwarded\"}[10m])\r\n ) >= 0.01\r\n)",
"expr": "count(\r\n sum by (destination) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"FORWARDED\"}[10m])\r\n ) >= 0.01\r\n)",
"hide": false,
"instant": true,
"legendFormat": "Pods with Incoming Traffic",
Expand Down Expand Up @@ -401,7 +401,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "round(sum (rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"forwarded\"}[$__rate_interval])), 0.01)",
"expr": "round(sum (rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"FORWARDED\"}[$__rate_interval])), 0.01)",
"hide": false,
"instant": false,
"legendFormat": "Max Incoming Traffic",
Expand Down Expand Up @@ -468,7 +468,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "round(sum (rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"forwarded\"}[$__rate_interval])), 0.01)",
"expr": "round(sum (rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"FORWARDED\"}[$__rate_interval])), 0.01)",
"hide": false,
"instant": false,
"legendFormat": "Min Incoming Traffic",
Expand Down Expand Up @@ -535,7 +535,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "count (\r\n sum by (source) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"dropped\"}[10m])\r\n ) >= 0.01\r\n)",
"expr": "count (\r\n sum by (source) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"DROPPED\"}[10m])\r\n ) >= 0.01\r\n)",
"hide": false,
"instant": true,
"legendFormat": "Pods with Outgoing Drops",
Expand Down Expand Up @@ -602,7 +602,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "round(sum (rate(hubble_flows_processed_total{verdict=\"dropped\", cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\"}[$__rate_interval])), 0.01)",
"expr": "round(sum (rate(hubble_flows_processed_total{verdict=\"DROPPED\", cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\"}[$__rate_interval])), 0.01)",
"hide": false,
"instant": false,
"legendFormat": "Max Outgoing Drops",
Expand Down Expand Up @@ -669,7 +669,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "round(sum (rate(hubble_flows_processed_total{verdict=\"dropped\", cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\"}[$__rate_interval])), 0.01)",
"expr": "round(sum (rate(hubble_flows_processed_total{verdict=\"DROPPED\", cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\"}[$__rate_interval])), 0.01)",
"hide": false,
"instant": false,
"legendFormat": "Min Outgoing Drops",
Expand Down Expand Up @@ -736,7 +736,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "count (\r\n sum by (destination) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"dropped\"}[10m])\r\n ) >= 0.01\r\n)",
"expr": "count (\r\n sum by (destination) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"DROPPED\"}[10m])\r\n ) >= 0.01\r\n)",
"hide": false,
"instant": true,
"legendFormat": "Pods with Incoming Drops",
Expand Down Expand Up @@ -803,7 +803,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "round(sum (rate(hubble_flows_processed_total{verdict=\"dropped\", cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\"}[$__rate_interval])), 0.01)",
"expr": "round(sum (rate(hubble_flows_processed_total{verdict=\"DROPPED\", cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\"}[$__rate_interval])), 0.01)",
"hide": false,
"instant": false,
"legendFormat": "Max Incoming Drops",
Expand Down Expand Up @@ -870,7 +870,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "round(sum (rate(hubble_flows_processed_total{verdict=\"dropped\", cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\"}[$__rate_interval])), 0.01)",
"expr": "round(sum (rate(hubble_flows_processed_total{verdict=\"DROPPED\", cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\"}[$__rate_interval])), 0.01)",
"hide": false,
"instant": false,
"legendFormat": "Min Incoming Drops",
Expand Down Expand Up @@ -1702,7 +1702,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "topk(10, round(sum by (source) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"dropped\"}[$__rate_interval])\r\n), 0.01)) > 0",
"expr": "topk(10, round(sum by (source) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"DROPPED\"}[$__rate_interval])\r\n), 0.01)) > 0",
"hide": false,
"legendFormat": "{{source}}",
"range": true,
Expand Down Expand Up @@ -1783,7 +1783,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "topk(10, round(sum by (destination) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"dropped\"}[$__rate_interval])\r\n), 0.01)) > 0",
"expr": "topk(10, round(sum by (destination) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"DROPPED\"}[$__rate_interval])\r\n), 0.01)) > 0",
"hide": false,
"legendFormat": "{{destination}}",
"range": true,
Expand Down Expand Up @@ -1885,7 +1885,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "round(\r\n sum by (source) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"dropped\"}[$__rate_interval])\r\n ), 0.01\r\n)",
"expr": "round(\r\n sum by (source) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/$workload\", verdict=\"DROPPED\"}[$__rate_interval])\r\n ), 0.01\r\n)",
"legendFormat": "{{destination}}",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -1986,7 +1986,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "round(\r\n sum by (destination) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"dropped\"}[$__rate_interval])\r\n ), 0.01\r\n)",
"expr": "round(\r\n sum by (destination) (\r\n rate(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/$workload\", verdict=\"DROPPED\"}[$__rate_interval])\r\n ), 0.01\r\n)",
"legendFormat": "{{destination}}",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -3901,17 +3901,14 @@
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_node_info, cluster)",
"definition": "label_values(hubble_flows_processed_total, cluster)",
"hide": 0,
"includeAll": false,
"label": "Cluster",
"multi": false,
"name": "cluster",
"options": [],
"query": {
"query": "label_values(kube_node_info, cluster)",
"refId": "StandardVariableQuery"
},
"query": "label_values(hubble_flows_processed_total, cluster)",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
Expand All @@ -3925,17 +3922,14 @@
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_node_info{cluster=\"$cluster\"},node)",
"definition": "label_values(hubble_flows_processed_total{cluster=\"$cluster\"}, instance)",
"hide": 0,
"includeAll": true,
"label": "Nodes",
"multi": true,
"name": "Nodes",
"options": [],
"query": {
"query": "label_values(kube_node_info{cluster=\"$cluster\"},node)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"query": "label_values(hubble_flows_processed_total{cluster=\"$cluster\"}, instance)",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
Expand Down Expand Up @@ -3974,20 +3968,17 @@
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "query_result(sum by (workload) (label_replace(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/[a-z0-9]+$\"}, \"workload\", \"$1\", \"destination\", \"^$namespace/([a-z0-9]+)\")) or sum by (workload) (label_replace(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/[a-z0-9]+-\"}, \"workload\", \"$1\", \"destination\", \"^$namespace/(.*)-[a-z0-9]+\"))or sum by (workload) (label_replace(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/[a-z0-9]+$\"}, \"workload\", \"$1\", \"source\", \"^$namespace/([a-z0-9]+)\")) or sum by (workload) (label_replace(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/[a-z0-9]+-\"}, \"workload\", \"$1\", \"source\", \"^$namespace/(.*)-[a-z0-9]+\")))",
"definition": "label_values(kube_pod_info{namespace=\"$namespace\"}, pod)",
"description": "",
"hide": 0,
"includeAll": false,
"label": "Workload",
"multi": false,
"name": "workload",
"options": [],
"query": {
"query": "query_result(sum by (workload) (label_replace(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/[a-z0-9]+$\"}, \"workload\", \"$1\", \"destination\", \"^$namespace/([a-z0-9]+)\")) or sum by (workload) (label_replace(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", destination=~\"^$namespace/[a-z0-9]+-\"}, \"workload\", \"$1\", \"destination\", \"^$namespace/(.*)-[a-z0-9]+\"))or sum by (workload) (label_replace(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/[a-z0-9]+$\"}, \"workload\", \"$1\", \"source\", \"^$namespace/([a-z0-9]+)\")) or sum by (workload) (label_replace(hubble_flows_processed_total{cluster=\"$cluster\", instance=~\"$Nodes\", source=~\"^$namespace/[a-z0-9]+-\"}, \"workload\", \"$1\", \"source\", \"^$namespace/(.*)-[a-z0-9]+\")))",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"query": "label_values(kube_pod_info{namespace=\"$namespace\"}, pod)",
"refresh": 2,
"regex": "/workload=\"([-a-z0-9]+)/g",
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
Expand Down

0 comments on commit 764d86b

Please sign in to comment.