Skip to content

Commit

Permalink
fix(grafana/PR#158): fix node selection, metrics name dns, pod-level …
Browse files Browse the repository at this point in the history
…dash (#797)

# Description

This PR is to fix #158

* reduce scope of PR
* [make it possible to select multiple nodes on clusters
dash](#158 (comment))
* [fix pod-level
regex](#158 (comment))
* [~~use named capture groups here to separate displayed value and used
value in clusters
dash~~](#158 (comment))

>NOTE: I have reverted the change to DS_PROMETHEUS not to break existing
deployments and tests. This was requested in [this
comment](#158 (review))


## Related Issue

fix #271


If this pull request is related to any issue, please mention it here.
Additionally, make sure that the issue is assigned to you before
submitting this pull request.

## 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

Please add any relevant screenshots or GIFs to showcase the changes
made.

### All dashboards

![Screenshot 2024-10-01
152822](https://github.com/user-attachments/assets/6b15f10d-dc12-4405-9898-7da59b2fcdd9)

![Screenshot 2024-10-01
152846](https://github.com/user-attachments/assets/5e1763ce-2a48-4dd9-b4c5-f2b52a7cb3d5)

![Screenshot 2024-10-01
152917](https://github.com/user-attachments/assets/3e4aab9d-7b44-4357-a709-d137e3bb8e47)

### Node selection fix

![Screenshot 2024-10-02
103738](https://github.com/user-attachments/assets/5b61ce34-6a1e-414b-8c9e-1b35f89f7efb)

![Screenshot 2024-10-02
103802](https://github.com/user-attachments/assets/529d6b9f-85a9-48e6-be52-252ecadd066b)

## Additional Notes

Thanks to @aslafy-z for the original PR
#158


---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.

Signed-off-by: Simone Rodigari <[email protected]>
  • Loading branch information
SRodi authored Oct 4, 2024
1 parent fc97e36 commit 76ecd19
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 31 deletions.
16 changes: 6 additions & 10 deletions deploy/legacy/grafana/dashboards/clusters.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "sum by (cluster) (rate(networkobservability_forward_bytes[$__rate_interval]))",
"expr": "sum by (cluster) (rate(networkobservability_forward_bytes{instance=~\"$Nodes\"}[$__rate_interval]))",
"format": "table",
"instant": true,
"legendFormat": "__auto",
Expand Down Expand Up @@ -279,7 +279,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by (cluster) (rate(networkobservability_forward_bytes[$__rate_interval]))",
"expr": "sum by (cluster) (rate(networkobservability_forward_bytes{instance=~\"$Nodes\"}[$__rate_interval]))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -355,7 +355,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "sum by (cluster) (rate(networkobservability_drop_bytes[$__rate_interval]))",
"expr": "sum by (cluster) (rate(networkobservability_drop_bytes{instance=~\"$Nodes\"}[$__rate_interval]))",
"format": "table",
"instant": true,
"legendFormat": "__auto",
Expand Down Expand Up @@ -463,7 +463,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by (cluster) (rate(networkobservability_drop_bytes[$__rate_interval]))",
"expr": "sum by (cluster) (rate(networkobservability_drop_bytes{instance=~\"$Nodes\"}[$__rate_interval]))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -3713,23 +3713,19 @@
"type": "query"
},
{
"allValue": "(.*)",
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_node_info{cluster=\"$cluster\"},node)",
"definition": "label_values(kube_node_info{cluster=\"$cluster\"}, node)",
"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(kube_node_info{cluster=\"$cluster\"}, node)",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
Expand Down
10 changes: 4 additions & 6 deletions deploy/legacy/grafana/dashboards/dns.json
Original file line number Diff line number Diff line change
Expand Up @@ -856,14 +856,15 @@
"type": "datasource"
},
{
"allValue": "(.*)",
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_node_info, cluster)",
"hide": 0,
"includeAll": true,
"includeAll": false,
"label": "Cluster",
"multi": false,
"name": "cluster",
Expand All @@ -884,17 +885,14 @@
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_node_info, node)",
"definition": "label_values(kube_node_info{cluster=\"$cluster\"}, node)",
"hide": 0,
"includeAll": true,
"label": "Nodes",
"multi": true,
"name": "Nodes",
"options": [],
"query": {
"query": "label_values(kube_node_info, node)",
"refId": "StandardVariableQuery"
},
"query": "label_values(kube_node_info{cluster=\"$cluster\"}, node)",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
Expand Down
45 changes: 30 additions & 15 deletions deploy/legacy/grafana/dashboards/pod-level.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "sum(irate(retina_adv_forward_count{source_podname=~\"$pod\"}[1m]))",
"expr": "sum(irate(networkobservability_adv_forward_count{source_podname=~\"$pod\"}[1m]))",
"legendFormat": "Total PPS",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -236,7 +236,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "sum(irate(retina_adv_forward_count{destination_podname=~\"$pod\"}[1m]))",
"expr": "sum(irate(networkobservability_adv_forward_count{destination_podname=~\"$pod\"}[1m]))",
"legendFormat": "Total PPS",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -331,7 +331,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "sum by(source_podname) (irate(retina_adv_forward_count{destination_podname!=\"unknown\", source_podname!=\"unknown\"}[1m]))",
"expr": "sum by(source_podname) (irate(networkobservability_adv_forward_count{destination_podname!=\"unknown\", source_podname!=\"unknown\"}[1m]))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -423,7 +423,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "sum by(destination_podname) (irate(retina_adv_forward_count{destination_podname!=\"unknown\", source_podname!=\"unknown\"}[1m]))",
"expr": "sum by(destination_podname) (irate(networkobservability_adv_forward_count{destination_podname!=\"unknown\", source_podname!=\"unknown\"}[1m]))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -518,7 +518,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by(source_podname) (irate(retina_adv_drop_count{destination_podname!=\"unknown\", source_podname!=\"unknown\"}[1m]))",
"expr": "sum by(source_podname) (irate(networkobservability_adv_drop_count{destination_podname!=\"unknown\", source_podname!=\"unknown\"}[1m]))",
"hide": false,
"legendFormat": "__auto",
"range": true,
Expand Down Expand Up @@ -611,7 +611,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by(destination_podname) (irate(retina_adv_forward_count{destination_podname!=\"unknown\", source_podname!=\"unknown\"}[1m]))",
"expr": "sum by(destination_podname) (irate(networkobservability_adv_forward_count{destination_podname!=\"unknown\", source_podname!=\"unknown\"}[1m]))",
"hide": false,
"legendFormat": "__auto",
"range": true,
Expand Down Expand Up @@ -707,7 +707,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "sum by(source_ip) (irate(retina_adv_forward_count{source_podname=\"unknown\"}[1m]))",
"expr": "sum by(source_ip) (irate(networkobservability_adv_forward_count{source_podname=\"unknown\"}[1m]))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -799,7 +799,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "sum by(destination_ip) (irate(retina_adv_forward_count{destination_podname=\"unknown\"}[1m]))",
"expr": "sum by(destination_ip) (irate(networkobservability_adv_forward_count{destination_podname=\"unknown\"}[1m]))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -875,7 +875,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "topk(10, sum by(source_podname) (irate(retina_adv_forward_count{source_podname!=\"unknown\"}[5m])))",
"expr": "topk(10, sum by(source_podname) (irate(networkobservability_adv_forward_count{source_podname!=\"unknown\"}[5m])))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -951,7 +951,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "topk(10, sum by(destination_podname) (irate(retina_adv_forward_count{destination_podname!=\"unknown\"}[5m])))",
"expr": "topk(10, sum by(destination_podname) (irate(networkobservability_adv_forward_count{destination_podname!=\"unknown\"}[5m])))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -1043,7 +1043,7 @@
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "avg by(instance) (sum by(le, instance) (rate(retina_node_apiserver_handshake_latency_ms_bucket[1m])))",
"expr": "avg by(instance) (sum by(le, instance) (rate(networkobservability_node_apiserver_handshake_latency_ms_bucket[1m])))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand All @@ -1062,25 +1062,40 @@
],
"templating": {
"list": [
{
"current": {},
"hide": 0,
"includeAll": false,
"label": "Data Source",
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "query_result(retina_adv_forward_count)",
"definition": "query_result(networkobservability_adv_forward_count)",
"hide": 1,
"includeAll": true,
"label": "Pod Name ",
"label": "Pod Name",
"multi": false,
"name": "pod",
"options": [],
"query": {
"query": "query_result(retina_adv_forward_count)",
"query": "query_result(networkobservability_adv_forward_count)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "/.*_podname=\"([^\"]*).*/",
"regex": "/.*podname=\"([^\"]*).*/",
"skipUrlSync": false,
"sort": 0,
"type": "query"
Expand Down

0 comments on commit 76ecd19

Please sign in to comment.