prometheus / grafana mounted volumes

This commit is contained in:
Arseniy Kuznetsov
2024-07-06 19:57:53 +01:00
parent b8c02aab54
commit d3290d8f9b
10 changed files with 2591 additions and 2584 deletions

View File

@@ -9,4 +9,4 @@ providers:
editable: true
updateIntervalSeconds: 10
options:
path: /var/lib/grafana/dashboards/mikrotik
path: /etc/grafana/provisioning/dashboards/mikrotik

View File

@@ -0,0 +1,545 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "Mikrotik Loki Logs",
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": 17139,
"graphTooltip": 0,
"id": 3,
"links": [
{
"asDropdown": false,
"icon": "external link",
"includeVars": false,
"keepTime": false,
"tags": [
"mikrotik",
"mktxp"
],
"targetBlank": false,
"title": "MKTXP Exporter",
"tooltip": "",
"type": "dashboards",
"url": ""
},
{
"asDropdown": true,
"icon": "external link",
"keepTime": false,
"tags": [
"system"
],
"title": "System Overview",
"type": "dashboards"
}
],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-orange",
"value": null
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 9,
"x": 0,
"y": 0
},
"id": 4,
"interval": "$smooth",
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"sum"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "9.3.2",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"editorMode": "code",
"expr": "count_over_time({job=\"syslog\", routerboard=\"$routerboard\"} [$__interval] |~\"(?i)$topics\" |~\"(?i)$searchable_pattern\" !~\"(?i)$exclude\")",
"legendFormat": "{{host}}",
"queryType": "range",
"refId": "A"
}
],
"title": "Log Counts By Topic",
"transformations": [],
"type": "stat"
},
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 30,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": true,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 15,
"x": 9,
"y": 0
},
"id": 3,
"interval": "$smooth",
"options": {
"legend": {
"calcs": [
"mean",
"sum"
],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "none",
"sort": "none"
}
},
"pluginVersion": "8.1.2",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"editorMode": "code",
"expr": "count_over_time({job=\"syslog\", routerboard=\"$routerboard\"} [$__interval] |regexp \"(?P<prefix>\\\\w+)\\\\: \" |~\"(?i)$topics\" |~\"(?i)$searchable_pattern\" !~\"(?i)$exclude\")",
"legendFormat": "{{prefix}}",
"queryType": "range",
"refId": "A"
}
],
"title": "Log Counts By Topic Over Time",
"transformations": [],
"type": "timeseries"
},
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"description": "",
"gridPos": {
"h": 23,
"w": 24,
"x": 0,
"y": 7
},
"id": 5,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": false,
"showTime": false,
"sortOrder": "Descending",
"wrapLogMessage": false
},
"pluginVersion": "7.3.6",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"editorMode": "code",
"expr": "{job=\"syslog\", routerboard=\"$routerboard\"} |~\"(?i)$topics\" |~\"(?i)$searchable_pattern\" !~\"(?i)$exclude\"",
"legendFormat": "",
"queryType": "range",
"refId": "A"
}
],
"title": "Logs Lines By Topic",
"type": "logs"
}
],
"refresh": "5s",
"schemaVersion": 37,
"style": "dark",
"tags": [
"mikrotik",
"loki"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "MKT-GT",
"value": "MKT-GT"
},
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"definition": "",
"hide": 0,
"includeAll": false,
"label": "Routerboard",
"multi": false,
"name": "routerboard",
"options": [],
"query": {
"label": "routerboard",
"refId": "LokiVariableQueryEditor-VariableQuery",
"stream": "",
"type": 1
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"hide": 0,
"includeAll": true,
"label": "Topics",
"multi": true,
"name": "topics",
"options": [
{
"selected": true,
"text": "All",
"value": "$__all"
},
{
"selected": false,
"text": "account",
"value": "account"
},
{
"selected": false,
"text": "caps",
"value": "caps"
},
{
"selected": false,
"text": "critical",
"value": "critical"
},
{
"selected": false,
"text": "error",
"value": "error"
},
{
"selected": false,
"text": "firewall",
"value": "firewall"
},
{
"selected": false,
"text": "info",
"value": "info"
},
{
"selected": false,
"text": "warning",
"value": "warning"
},
{
"selected": false,
"text": "wireless",
"value": "wireless"
},
{
"selected": false,
"text": "dns",
"value": "dns"
},
{
"selected": false,
"text": "health",
"value": "health"
},
{
"selected": false,
"text": "dhcp",
"value": "dhcp"
},
{
"selected": false,
"text": "interface",
"value": "interface"
},
{
"selected": false,
"text": "ipsec",
"value": "ipsec"
},
{
"selected": false,
"text": "l2tp",
"value": "l2tp"
},
{
"selected": false,
"text": "ppp",
"value": "ppp"
},
{
"selected": false,
"text": "raw",
"value": "raw"
},
{
"selected": false,
"text": "ssh",
"value": "ssh"
},
{
"selected": false,
"text": "system",
"value": "system"
},
{
"selected": false,
"text": "ups",
"value": "ups"
}
],
"query": "account,caps,critical,error,firewall,info,warning,wireless,dns,health,dhcp,interface,ipsec,l2tp,ppp,raw,ssh,system,ups",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"current": {
"selected": true,
"text": "",
"value": ""
},
"description": "Search (case insensitive)",
"hide": 0,
"label": "Search",
"name": "searchable_pattern",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"skipUrlSync": false,
"type": "textbox"
},
{
"current": {
"selected": false,
"text": "None",
"value": "None"
},
"description": "Exclude pattern (case-insensitive, None includes everything)",
"hide": 0,
"includeAll": false,
"label": "Exclude",
"multi": false,
"name": "exclude",
"options": [
{
"selected": true,
"text": "None",
"value": "None"
}
],
"query": "None,",
"queryValue": "None",
"skipUrlSync": false,
"type": "custom"
},
{
"current": {
"selected": false,
"text": "5m",
"value": "5m"
},
"hide": 0,
"includeAll": false,
"label": "Smooth",
"multi": false,
"name": "smooth",
"options": [
{
"selected": false,
"text": "30s",
"value": "30s"
},
{
"selected": false,
"text": "1m",
"value": "1m"
},
{
"selected": false,
"text": "2m",
"value": "2m"
},
{
"selected": true,
"text": "5m",
"value": "5m"
},
{
"selected": false,
"text": "10m",
"value": "10m"
},
{
"selected": false,
"text": "15m",
"value": "15m"
},
{
"selected": false,
"text": "30m",
"value": "30m"
},
{
"selected": false,
"text": "1h",
"value": "1h"
},
{
"selected": false,
"text": "2h",
"value": "2h"
}
],
"query": "30s,1m,2m,5m,10m,15m,30m,1h,2h",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
}
]
},
"time": {
"from": "now-12h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Mikrotik Loki Logs",
"uid": "awslix6doiakp-mkt-loki",
"version": 1,
"weekStart": ""
}

File diff suppressed because it is too large Load Diff

View File

@@ -9,4 +9,4 @@ providers:
editable: true
updateIntervalSeconds: 10
options:
path: /var/lib/grafana/dashboards/system
path: /etc/grafana/provisioning/dashboards/system

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff