Skip to content

Commit

Permalink
Add grafana dashboards (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
alternaivan authored Nov 4, 2024
1 parent 5599be6 commit dda180f
Show file tree
Hide file tree
Showing 5 changed files with 709 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dashboards/grafana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Grafana Dashboards for K8s Ephemeral Storage Metrics

Below are the two Grafana dashboards that can be uploaded via JSON to the Grafana, to help you visualize the metrics.

![Kubernetes Ephemeral Storage Nodes](../../img/grafana-dashboard-nodes.png)

![Kubernetes Ephemeral Storage Namespaces](../../img/grafana-dashboard-namespaces.png)
287 changes: 287 additions & 0 deletions dashboards/grafana/ephemeral-storage-namespaces.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 45,
"links": [],
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"description": "Current ephemeral byte usage of a pod",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 24,
"x": 0,
"y": 0
},
"id": 6,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(ephemeral_storage_pod_usage{pod_namespace=~\"${namespace}\"})",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"legendFormat": "{{pod_namespace}}",
"range": true,
"refId": "Total Capacity"
}
],
"title": "Total Storage Usage Bytes in ${namespace}",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"description": "Current ephemeral byte usage of a pod",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 24,
"x": 0,
"y": 14
},
"id": 5,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "ephemeral_storage_pod_usage{pod_namespace=~\"${namespace}\"}",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"legendFormat": "{{pod_name}}",
"range": true,
"refId": "Total Capacity"
}
],
"title": "Pod Storage Usage Bytes",
"type": "timeseries"
}
],
"refresh": "",
"schemaVersion": 39,
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "default",
"value": "default"
},
"hide": 0,
"includeAll": false,
"label": "Data source",
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": true,
"text": "default",
"value": "default"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(ephemeral_storage_container_volume_usage,pod_namespace)",
"hide": 0,
"includeAll": false,
"label": "Namespace",
"multi": false,
"name": "namespace",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(ephemeral_storage_container_volume_usage,pod_namespace)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"type": "query"
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {},
"timezone": "utc",
"title": "Kubernetes / Ephemeral Storage Namespaces",
"version": 1,
"weekStart": ""
}
Loading

0 comments on commit dda180f

Please sign in to comment.