Skip to content

Instantly share code, notes, and snippets.

@roidelapluie
Last active November 14, 2019 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roidelapluie/9d0bc3899dd68913e2fe5e2cdfcb881c to your computer and use it in GitHub Desktop.
Save roidelapluie/9d0bc3899dd68913e2fe5e2cdfcb881c to your computer and use it in GitHub Desktop.
{
"__inputs": [],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "6.4.4"
},
{
"type": "panel",
"id": "graph",
"name": "Graph",
"version": ""
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "table",
"name": "Table",
"version": ""
}
],
"annotations": {
"list": []
},
"editable": false,
"gnetId": null,
"graphTooltip": 1,
"id": null,
"iteration": 1573763538478,
"links": [
{
"asDropdown": true,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"System"
],
"targetBlank": false,
"title": "System",
"type": "dashboards",
"url": ""
},
{
"asDropdown": true,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"Technical"
],
"targetBlank": false,
"title": "Technical",
"type": "dashboards",
"url": ""
},
{
"asDropdown": true,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"Monitoring"
],
"targetBlank": false,
"title": "Monitoring",
"type": "dashboards",
"url": ""
},
{
"asDropdown": true,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"Business"
],
"targetBlank": false,
"title": "Business",
"type": "dashboards",
"url": ""
},
{
"asDropdown": true,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"Databases"
],
"targetBlank": false,
"title": "Databases",
"type": "dashboards",
"url": ""
}
],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "-- Mixed --",
"decimals": 0,
"fill": 10,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"rightSide": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeat": null,
"seriesOverrides": [],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"datasource": "$PROMETHEUS_DS",
"expr": "label_replace(node_systemd_unit_state{type=\"simple\",instance=~\"$instance\",env=~\"$env\",name=~\".*.service\",state!=\"inactive\",state!=\"failed\"} == 1,\"state\",\"running\",\"state\",\"activating\") and on (name,instance) count by(name, instance) (label_replace(node_systemd_unit_state{name=~\".*.timer\"}, \"name\", \"$1.service\",\"name\",\"(.*).timer\"))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{name}} {{state}} on {{instance}} (switch to Type=oneshot!)",
"refId": "A"
},
{
"datasource": "$PROMETHEUS_DS",
"expr": "label_replace(node_systemd_unit_state{type=\"oneshot\",instance=~\"$instance\",env=~\"$env\",name=~\".*.service\",state!=\"inactive\",state!=\"failed\"} == 1,\"state\",\"running\",\"state\",\"activating\")",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{name}} {{state}} on {{instance}}",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Running jobs",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"decimals": 0,
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "-- Mixed --",
"decimals": 0,
"fill": 10,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 0
},
"id": 3,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"rightSide": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeat": null,
"seriesOverrides": [],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"datasource": "$PROMETHEUS_DS",
"expr": "label_replace(node_systemd_unit_state{type=\"simple\",instance=~\"$instance\",env=~\"$env\",name=~\".*.service\",state=\"failed\"} == 1,\"state\",\"running\",\"state\",\"activating\") and on (name,instance) count by(name, instance) (label_replace(node_systemd_unit_state{name=~\".*.timer\"}, \"name\", \"$1.service\",\"name\",\"(.*).timer\"))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{name}} {{state}} on {{instance}} (switch to Type=oneshot!)",
"refId": "A"
},
{
"datasource": "$PROMETHEUS_DS",
"expr": "label_replace(node_systemd_unit_state{type=\"oneshot\",instance=~\"$instance\",env=~\"$env\",name=~\".*.service\",state=\"failed\"} == 1,\"state\",\"running\",\"state\",\"activating\")",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{name}} {{state}} on {{instance}}",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Failed jobs",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"decimals": 0,
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"columns": [],
"datasource": "-- Mixed --",
"fontSize": "100%",
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 9
},
"id": 4,
"options": {},
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 1,
"desc": true
},
"styles": [
{
"alias": "Date",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "/Value.*/",
"type": "hidden"
},
{
"alias": "Date",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "hidden"
},
{
"alias": "Date",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"pattern": "/time/",
"thresholds": [],
"type": "date",
"unit": "dateTimeAsUS"
},
{
"alias": "",
"pattern": "/job/",
"thresholds": [],
"type": "hidden"
}
],
"targets": [
{
"datasource": "$PROMETHEUS_DS",
"expr": "count_over_time((count_values(\"time\",1000*node_systemd_timer_last_trigger_seconds{instance=~\"$instance\",env=~\"$env\",} != 0) without())[${__range_s}s:])",
"format": "table",
"instant": true,
"intervalFactor": 2,
"legendFormat": "",
"refId": "A"
}
],
"title": "Last triggers",
"transform": "table",
"type": "table"
}
],
"refresh": "1m",
"schemaVersion": 20,
"style": "dark",
"tags": [
"System"
],
"templating": {
"list": [
{
"current": {
"text": "Prometheus",
"value": "Prometheus"
},
"hide": 1,
"includeAll": false,
"label": null,
"multi": false,
"name": "PROMETHEUS_DS",
"options": [],
"query": "prometheus",
"refresh": 1,
"skipUrlSync": false,
"type": "datasource"
},
{
"allValue": null,
"current": {},
"datasource": "$PROMETHEUS_DS",
"definition": "",
"hide": 0,
"includeAll": false,
"label": "Environment",
"multi": false,
"name": "env",
"options": [],
"query": "label_values(node_systemd_unit_state, env)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {},
"datasource": "$PROMETHEUS_DS",
"definition": "",
"hide": 0,
"includeAll": true,
"label": "Hosts",
"multi": true,
"name": "instance",
"options": [],
"query": "label_values(node_systemd_unit_state{env=~\"$env\"}, instance)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "System - Systemd Timers Overview",
"uid": "timers",
"version": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment