Skip to content

Commit

Permalink
Support separating by namespace on the Grafana dashboard (#271)
Browse files Browse the repository at this point in the history
Resolves #270
  • Loading branch information
beauwest authored Dec 12, 2024
1 parent 68b6107 commit bd3ba2b
Showing 1 changed file with 87 additions and 58 deletions.
145 changes: 87 additions & 58 deletions monitoring/grafana-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "max(max_over_time(dragonfly_uptime_in_seconds{pod=~\"$instance\"}[$__interval]))",
"expr": "max(max_over_time(dragonfly_uptime_in_seconds{namespace=\"$namespace\",pod=~\"$instance\"}[$__interval]))",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand Down Expand Up @@ -248,7 +248,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "dragonfly_connected_clients{pod=~\"$instance\"}",
"expr": "dragonfly_connected_clients{namespace=\"$namespace\",pod=~\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand Down Expand Up @@ -339,7 +339,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "100 * (dragonfly_memory_used_bytes{pod=~\"$instance\"} / dragonfly_memory_max_bytes{pod=~\"$instance\"} )",
"expr": "100 * (dragonfly_memory_used_bytes{namespace=\"$namespace\",pod=~\"$instance\"} / dragonfly_memory_max_bytes{namespace=\"$namespace\",pod=~\"$instance\"} )",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand Down Expand Up @@ -411,7 +411,7 @@
"disableTextWrap": false,
"editorMode": "code",
"exemplar": false,
"expr": "dragonfly_master{pod=\"$instance\"}",
"expr": "dragonfly_master{namespace=\"$namespace\",pod=\"$instance\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": true,
Expand Down Expand Up @@ -486,7 +486,7 @@
},
"editorMode": "code",
"exemplar": true,
"expr": "rate(dragonfly_commands_processed_total{pod=~\"$instance\"}[5m])",
"expr": "rate(dragonfly_commands_processed_total{namespace=\"$namespace\",pod=~\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand Down Expand Up @@ -595,7 +595,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "dragonfly_memory_used_bytes{pod=~\"$instance\"} ",
"expr": "dragonfly_memory_used_bytes{namespace=\"$namespace\",pod=~\"$instance\"} ",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand All @@ -611,7 +611,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "dragonfly_memory_max_bytes{pod=~\"$instance\"} ",
"expr": "dragonfly_memory_max_bytes{namespace=\"$namespace\",pod=~\"$instance\"} ",
"format": "time_series",
"hide": false,
"interval": "",
Expand Down Expand Up @@ -713,7 +713,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "rate(dragonfly_net_input_bytes_total{pod=~\"$instance\"}[5m])",
"expr": "rate(dragonfly_net_input_bytes_total{namespace=\"$namespace\",pod=~\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand All @@ -727,7 +727,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "rate(dragonfly_net_output_bytes_total{pod=~\"$instance\"}[5m])",
"expr": "rate(dragonfly_net_output_bytes_total{namespace=\"$namespace\",pod=~\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand Down Expand Up @@ -829,7 +829,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "sum (dragonfly_db_keys{pod=~\"$instance\"}) by (db)",
"expr": "sum (dragonfly_db_keys{namespace=\"$namespace\",pod=~\"$instance\"}) by (db)",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand Down Expand Up @@ -930,7 +930,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "sum (dragonfly_db_keys{pod=~\"$instance\"}) - sum (dragonfly_db_keys_expiring{pod=~\"$instance\"}) ",
"expr": "sum (dragonfly_db_keys{namespace=\"$namespace\",pod=~\"$instance\"}) - sum (dragonfly_db_keys_expiring{namespace=\"$namespace\",pod=~\"$instance\"}) ",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand All @@ -945,7 +945,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "sum (dragonfly_db_keys_expiring{pod=~\"$instance\"})",
"expr": "sum (dragonfly_db_keys_expiring{namespace=\"$namespace\",pod=~\"$instance\"})",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand Down Expand Up @@ -1071,7 +1071,7 @@
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "irate(dragonfly_connections_received_total{pod=\"$instance\"}[$__rate_interval])",
"expr": "irate(dragonfly_connections_received_total{namespace=\"$namespace\",pod=\"$instance\"}[$__rate_interval])",
"fullMetaSearch": false,
"includeNullMetadata": false,
"instant": false,
Expand Down Expand Up @@ -1142,7 +1142,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "dragonfly_connected_clients{pod=\"$instance\"}",
"expr": "dragonfly_connected_clients{namespace=\"$namespace\",pod=\"$instance\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
Expand Down Expand Up @@ -1243,7 +1243,7 @@
},
"editorMode": "code",
"exemplar": true,
"expr": "rate(dragonfly_keyspace_hits_total{pod=~\"$instance\"}[5m])",
"expr": "rate(dragonfly_keyspace_hits_total{namespace=\"$namespace\",pod=~\"$instance\"}[5m])",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand All @@ -1260,7 +1260,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "rate(dragonfly_keyspace_misses_total{pod=~\"$instance\"}[5m])",
"expr": "rate(dragonfly_keyspace_misses_total{namespace=\"$namespace\",pod=~\"$instance\"}[5m])",
"hide": false,
"instant": false,
"legendFormat": "misses",
Expand Down Expand Up @@ -1376,7 +1376,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "sum(rate(dragonfly_expired_keys_total{pod=~\"$instance\"}[5m])) by (instance)",
"expr": "sum(rate(dragonfly_expired_keys_total{namespace=\"$namespace\",pod=~\"$instance\"}[5m])) by (instance)",
"format": "time_series",
"hide": false,
"interval": "",
Expand All @@ -1393,7 +1393,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
"expr": "sum(rate(dragonfly_evicted_keys_total{pod=~\"$instance\"}[5m])) by (instance)",
"expr": "sum(rate(dragonfly_evicted_keys_total{namespace=\"$namespace\",pod=~\"$instance\"}[5m])) by (instance)",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
Expand Down Expand Up @@ -1442,49 +1442,78 @@
],
"templating": {
"list": [

{
"current": {},
"definition": "label_values(dragonfly_uptime_in_seconds,app)",
"hide": 0,
"includeAll": false,
"label": "",
"multi": false,
"name": "Dragonfly",
"options": [],
"query": {
"query": "label_values(dragonfly_uptime_in_seconds,app)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
"hide": 2,
"name": "DS_PROMETHEUS",
"query": "prometheus",
"skipUrlSync": true,
"type": "constant"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(dragonfly_uptime_in_seconds{app=\"$Dragonfly\"},pod)",
"hide": 0,
"includeAll": false,
"label": "instance",
"multi": false,
"name": "instance",
"options": [],
"query": {
"query": "label_values(dragonfly_uptime_in_seconds{app=\"$Dragonfly\"},pod)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
"current": {},
"definition": "label_values(dragonfly_uptime_in_seconds,app)",
"hide": 0,
"includeAll": false,
"label": "",
"multi": false,
"name": "Dragonfly",
"options": [],
"query": {
"query": "label_values(dragonfly_uptime_in_seconds,app)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(dragonfly_uptime_in_seconds{app=\"$Dragonfly\"},namespace)",
"hide": 0,
"includeAll": false,
"label": "namespace",
"multi": false,
"name": "namespace",
"options": [],
"query": {
"query": "label_values(dragonfly_uptime_in_seconds{app=\"$Dragonfly\"},namespace)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(dragonfly_uptime_in_seconds{app=\"$Dragonfly\",namespace=\"$namespace\"},pod)",
"hide": 0,
"includeAll": false,
"label": "instance",
"multi": false,
"name": "instance",
"options": [],
"query": {
"query": "label_values(dragonfly_uptime_in_seconds{app=\"$Dragonfly\",namespace=\"$namespace\"},pod)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
Expand Down

0 comments on commit bd3ba2b

Please sign in to comment.