Merge branch 'docs/update-example-grafana-dashboard' into 'main'

docs: update grafana dashboard

See merge request hectorjsmith/fail2ban-prometheus-exporter!73
This commit is contained in:
Hector 2022-10-13 08:36:43 +00:00
commit e005abfc1c
2 changed files with 110 additions and 38 deletions

View File

@ -103,7 +103,9 @@ The metrics exported by this tool are compatible with Prometheus and Grafana.
A sample grafana dashboard can be found in the [grafana.json](/examples/grafana/dashboard.json) file. A sample grafana dashboard can be found in the [grafana.json](/examples/grafana/dashboard.json) file.
Just import the contents of this file into a new Grafana dashboard to get started. Just import the contents of this file into a new Grafana dashboard to get started.
*(Sample dashboard is compatible with Grafana `8.3.3` and above)* The dashboard supports displaying data from multiple exporters. Use the `instance` dashboard variable to select which ones to display.
*(Sample dashboard is compatible with Grafana `9.1.8` and above)*
## 3. Configuration ## 3. Configuration

View File

@ -9,13 +9,13 @@
"pluginName": "Prometheus" "pluginName": "Prometheus"
} }
], ],
"__elements": [], "__elements": {},
"__requires": [ "__requires": [
{ {
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "8.3.3" "version": "9.1.8"
}, },
{ {
"type": "datasource", "type": "datasource",
@ -40,7 +40,10 @@
"list": [ "list": [
{ {
"builtIn": 1, "builtIn": 1,
"datasource": "-- Grafana --", "datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true, "enable": true,
"hide": true, "hide": true,
"iconColor": "rgba(0, 211, 255, 1)", "iconColor": "rgba(0, 211, 255, 1)",
@ -59,7 +62,6 @@
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"graphTooltip": 2, "graphTooltip": 2,
"id": null, "id": null,
"iteration": 1640159475017,
"links": [], "links": [],
"liveNow": false, "liveNow": false,
"panels": [ "panels": [
@ -76,7 +78,8 @@
}, },
"custom": { "custom": {
"align": "auto", "align": "auto",
"displayMode": "auto" "displayMode": "auto",
"inspect": false
}, },
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
@ -121,15 +124,16 @@
}, },
"showHeader": true "showHeader": true
}, },
"pluginVersion": "8.3.3", "pluginVersion": "9.1.8",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": false, "exemplar": false,
"expr": "f2b_config_jail_max_retries", "expr": "f2b_config_jail_max_retries{instance=~\"$instance\"}",
"format": "table", "format": "table",
"instant": true, "instant": true,
"interval": "", "interval": "",
@ -141,8 +145,9 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": false, "exemplar": false,
"expr": "f2b_config_jail_ban_time", "expr": "f2b_config_jail_ban_time{instance=~\"$instance\"}",
"format": "table", "format": "table",
"hide": false, "hide": false,
"instant": true, "instant": true,
@ -155,8 +160,9 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": false, "exemplar": false,
"expr": "f2b_config_jail_find_time", "expr": "f2b_config_jail_find_time{instance=~\"$instance\"}",
"format": "table", "format": "table",
"hide": false, "hide": false,
"instant": true, "instant": true,
@ -193,6 +199,10 @@
], ],
"operation": "aggregate" "operation": "aggregate"
}, },
"instance": {
"aggregations": [],
"operation": "groupby"
},
"jail": { "jail": {
"aggregations": [], "aggregations": [],
"operation": "groupby" "operation": "groupby"
@ -229,6 +239,8 @@
"mode": "palette-classic" "mode": "palette-classic"
}, },
"custom": { "custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
@ -284,10 +296,12 @@
"lastNotNull" "lastNotNull"
], ],
"displayMode": "table", "displayMode": "table",
"placement": "right" "placement": "right",
"showLegend": true
}, },
"tooltip": { "tooltip": {
"mode": "single" "mode": "single",
"sort": "none"
} }
}, },
"pluginVersion": "8.2.1", "pluginVersion": "8.2.1",
@ -297,11 +311,13 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": true, "exemplar": true,
"expr": "f2b_jail_failed_total", "expr": "f2b_jail_failed_total{instance=~\"$instance\"}",
"hide": false, "hide": false,
"interval": "", "interval": "",
"legendFormat": "{{jail}}", "legendFormat": "{{jail}} ({{instance}})",
"range": true,
"refId": "A" "refId": "A"
} }
], ],
@ -321,6 +337,8 @@
"mode": "palette-classic" "mode": "palette-classic"
}, },
"custom": { "custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
@ -376,10 +394,12 @@
"lastNotNull" "lastNotNull"
], ],
"displayMode": "table", "displayMode": "table",
"placement": "right" "placement": "right",
"showLegend": true
}, },
"tooltip": { "tooltip": {
"mode": "single" "mode": "single",
"sort": "none"
} }
}, },
"pluginVersion": "8.2.1", "pluginVersion": "8.2.1",
@ -389,10 +409,12 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": true, "exemplar": true,
"expr": "f2b_jail_banned_total", "expr": "f2b_jail_banned_total{instance=~\"$instance\"}",
"interval": "", "interval": "",
"legendFormat": "{{jail}}", "legendFormat": "{{jail}} ({{instance}})",
"range": true,
"refId": "A" "refId": "A"
} }
], ],
@ -412,6 +434,8 @@
"mode": "palette-classic" "mode": "palette-classic"
}, },
"custom": { "custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
@ -467,10 +491,12 @@
"lastNotNull" "lastNotNull"
], ],
"displayMode": "table", "displayMode": "table",
"placement": "right" "placement": "right",
"showLegend": true
}, },
"tooltip": { "tooltip": {
"mode": "single" "mode": "single",
"sort": "none"
} }
}, },
"pluginVersion": "8.2.1", "pluginVersion": "8.2.1",
@ -480,10 +506,12 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": true, "exemplar": true,
"expr": "f2b_jail_failed_current", "expr": "f2b_jail_failed_current{instance=~\"$instance\"}",
"interval": "", "interval": "",
"legendFormat": "{{jail}}", "legendFormat": "{{jail}} ({{instance}})",
"range": true,
"refId": "A" "refId": "A"
} }
], ],
@ -503,6 +531,8 @@
"mode": "palette-classic" "mode": "palette-classic"
}, },
"custom": { "custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
@ -558,10 +588,12 @@
"lastNotNull" "lastNotNull"
], ],
"displayMode": "table", "displayMode": "table",
"placement": "right" "placement": "right",
"showLegend": true
}, },
"tooltip": { "tooltip": {
"mode": "single" "mode": "single",
"sort": "none"
} }
}, },
"pluginVersion": "8.2.1", "pluginVersion": "8.2.1",
@ -571,10 +603,12 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": true, "exemplar": true,
"expr": "f2b_jail_banned_current", "expr": "f2b_jail_banned_current{instance=~\"$instance\"}",
"interval": "", "interval": "",
"legendFormat": "{{jail}}", "legendFormat": "{{jail}} ({{instance}})",
"range": true,
"refId": "A" "refId": "A"
} }
], ],
@ -594,6 +628,8 @@
"mode": "palette-classic" "mode": "palette-classic"
}, },
"custom": { "custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
@ -650,10 +686,12 @@
"lastNotNull" "lastNotNull"
], ],
"displayMode": "table", "displayMode": "table",
"placement": "right" "placement": "right",
"showLegend": true
}, },
"tooltip": { "tooltip": {
"mode": "single" "mode": "single",
"sort": "none"
} }
}, },
"pluginVersion": "8.2.1", "pluginVersion": "8.2.1",
@ -663,10 +701,12 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": true, "exemplar": true,
"expr": "f2b_up", "expr": "f2b_up{instance=~\"$instance\"}",
"interval": "", "interval": "",
"legendFormat": "Up", "legendFormat": "Up ({{instance}})",
"range": true,
"refId": "A" "refId": "A"
} }
], ],
@ -686,6 +726,8 @@
"mode": "palette-classic" "mode": "palette-classic"
}, },
"custom": { "custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
@ -742,10 +784,12 @@
"lastNotNull" "lastNotNull"
], ],
"displayMode": "table", "displayMode": "table",
"placement": "right" "placement": "right",
"showLegend": true
}, },
"tooltip": { "tooltip": {
"mode": "single" "mode": "single",
"sort": "none"
} }
}, },
"pluginVersion": "8.2.1", "pluginVersion": "8.2.1",
@ -755,10 +799,12 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"editorMode": "code",
"exemplar": true, "exemplar": true,
"expr": "f2b_errors", "expr": "f2b_errors{instance=~\"$instance\"}",
"interval": "", "interval": "",
"legendFormat": "{{type}}", "legendFormat": "{{type}} ({{instance}})",
"range": true,
"refId": "A" "refId": "A"
} }
], ],
@ -768,14 +814,14 @@
} }
], ],
"refresh": "30s", "refresh": "30s",
"schemaVersion": 34, "schemaVersion": 37,
"style": "dark", "style": "dark",
"tags": [], "tags": [],
"templating": { "templating": {
"list": [ "list": [
{ {
"current": { "current": {
"selected": true, "selected": false,
"text": "Prometheus", "text": "Prometheus",
"value": "Prometheus" "value": "Prometheus"
}, },
@ -791,6 +837,30 @@
"regex": "", "regex": "",
"skipUrlSync": false, "skipUrlSync": false,
"type": "datasource" "type": "datasource"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "f2b_up",
"description": "Select which instance(s) to show",
"hide": 0,
"includeAll": false,
"label": "Instance",
"multi": true,
"name": "instance",
"options": [],
"query": {
"query": "f2b_up",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "/.*instance=\"([^\"]+)\"/",
"skipUrlSync": false,
"sort": 0,
"type": "query"
} }
] ]
}, },
@ -802,6 +872,6 @@
"timezone": "", "timezone": "",
"title": "F2B", "title": "F2B",
"uid": "cTkH9AT7z", "uid": "cTkH9AT7z",
"version": 17, "version": 3,
"weekStart": "" "weekStart": ""
} }