grafana-influxdb-telegraf/grafana/provisioning/dashboards/dashboard.json

340 lines
9.4 KiB
JSON

{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": 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": "percent"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [
"mean",
"lastNotNull"
],
"displayMode": "table",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"editorMode": "builder",
"query": "from(bucket: \"$bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"cpu\")\n |> filter(fn: (r) => r[\"_field\"] == \"usage_user\")\n |> filter(fn: (r) => r[\"cpu\"] == \"cpu-total\")\n |> filter(fn: (r) => contains(value: r[\"host\"], set: ${host:json}))\n |> filter(fn: (r) => contains(value: r[\"location\"], set: ${location:json}))\n |> filter(fn: (r) => contains(value: r[\"environment\"], set: ${environment:json}))\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "CPU Usage",
"type": "timeseries"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": 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": "percent"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 3,
"options": {
"legend": {
"calcs": [
"mean",
"lastNotNull"
],
"displayMode": "table",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"editorMode": "builder",
"query": "from(bucket: \"$bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"mem\")\n |> filter(fn: (r) => r[\"_field\"] == \"used_percent\")\n |> filter(fn: (r) => contains(value: r[\"host\"], set: ${host:json}))\n |> filter(fn: (r) => contains(value: r[\"location\"], set: ${location:json}))\n |> filter(fn: (r) => contains(value: r[\"environment\"], set: ${environment:json}))\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")",
"refId": "A"
}
],
"title": "Memory Usage",
"type": "timeseries"
}
],
"refresh": "5s",
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "telegraf-bucket",
"value": "telegraf-bucket"
},
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": "Bucket",
"multi": false,
"name": "bucket",
"options": [
{
"selected": true,
"text": "telegraf-bucket",
"value": "telegraf-bucket"
}
],
"query": "telegraf-bucket",
"queryValue": "",
"skipUrlSync": false,
"type": "textbox"
},
{
"current": {
"selected": false,
"text": "All",
"value": ""
},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"definition": "import \"influxdata/influxdb/schema\"\nschema.measurementTagValues(\n bucket: v.bucket,\n measurement: \"cpu\",\n tag: \"host\"\n)",
"hide": 0,
"includeAll": true,
"label": "Host",
"multi": true,
"name": "host",
"query": "import \"influxdata/influxdb/schema\"\nschema.measurementTagValues(\n bucket: v.bucket,\n measurement: \"cpu\",\n tag: \"host\"\n)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": false,
"text": "All",
"value": ""
},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"definition": "import \"influxdata/influxdb/schema\"\nschema.measurementTagValues(\n bucket: v.bucket,\n measurement: \"cpu\",\n tag: \"location\"\n)",
"hide": 0,
"includeAll": true,
"label": "Location",
"multi": true,
"name": "location",
"query": "import \"influxdata/influxdb/schema\"\nschema.measurementTagValues(\n bucket: v.bucket,\n measurement: \"cpu\",\n tag: \"location\"\n)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": false,
"text": "All",
"value": ""
},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"definition": "import \"influxdata/influxdb/schema\"\nschema.measurementTagValues(\n bucket: v.bucket,\n measurement: \"cpu\",\n tag: \"environment\"\n)",
"hide": 0,
"includeAll": true,
"label": "Environment",
"multi": true,
"name": "environment",
"query": "import \"influxdata/influxdb/schema\"\nschema.measurementTagValues(\n bucket: v.bucket,\n measurement: \"cpu\",\n tag: \"environment\"\n)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Multi-Host Monitoring",
"uid": "multi-host-monitoring",
"version": 1,
"weekStart": ""
}