diff --git a/dashboards/logs.json b/dashboards/logs_nomad.json similarity index 87% rename from dashboards/logs.json rename to dashboards/logs_nomad.json index ef7232c96527f9c2d0ad6a80cb55dde97e4ca97d..c4ceba7fec3d7d1bcdf989bdef1331d506382f48 100644 --- a/dashboards/logs.json +++ b/dashboards/logs_nomad.json @@ -18,11 +18,11 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 42, + "id": 81, "links": [], - "liveNow": false, "panels": [ { + "collapsed": false, "gridPos": { "h": 1, "w": 24, @@ -30,6 +30,7 @@ "y": 0 }, "id": 11, + "panels": [], "title": "All logs", "type": "row" }, @@ -45,11 +46,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -108,10 +111,12 @@ "showLegend": true }, "tooltip": { + "maxHeight": 600, "mode": "multi", "sort": "none" } }, + "pluginVersion": "11.4.0", "targets": [ { "datasource": { @@ -119,7 +124,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum by (nomad_group) (count_over_time({level=\"ERROR\"}[$__interval]))", + "expr": "sum by(nomad_group) (count_over_time({level=\"ERROR\", source=\"docker\", station=~\"$station\"} [$__interval]))", "legendFormat": "{{program}}", "queryType": "range", "refId": "A" @@ -153,6 +158,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -276,12 +282,14 @@ "showValue": "never", "stacking": "none", "tooltip": { + "maxHeight": 600, "mode": "single", "sort": "none" }, "xTickLabelRotation": 0, "xTickLabelSpacing": 100 }, + "pluginVersion": "11.4.0", "targets": [ { "datasource": { @@ -289,7 +297,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(count_over_time({nomad_group=\"$program\"}[$__interval]))", + "expr": "sum(count_over_time({nomad_group=~\"$program\", source=\"docker\", station=~\"$station\"}[$__interval]))", "legendFormat": "{{level}}", "queryType": "range", "refId": "A", @@ -299,51 +307,13 @@ "title": "Level count", "type": "barchart" }, - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 15 - }, - "id": 2, - "options": { - "dedupStrategy": "numbers", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": true, - "showLabels": false, - "showTime": true, - "sortOrder": "Descending", - "wrapLogMessage": true - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "{nomad_group=\"$program\"} |~ \"$search\" | json | line_format `{{.message}}` ", - "queryType": "range", - "refId": "A" - } - ], - "title": "Tail", - "transformations": [], - "type": "logs" - }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 25 + "y": 15 }, "id": 7, "panels": [ @@ -359,11 +329,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -395,8 +367,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -436,7 +407,7 @@ "h": 9, "w": 9, "x": 15, - "y": 26 + "y": 16 }, "id": 6, "options": { @@ -449,10 +420,12 @@ "showLegend": true }, "tooltip": { + "maxHeight": 600, "mode": "multi", "sort": "desc" } }, + "pluginVersion": "11.4.0", "targets": [ { "datasource": { @@ -485,24 +458,67 @@ ], "title": "Loki performance", "type": "row" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 22, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 2, + "options": { + "dedupStrategy": "numbers", + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": true, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": true + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{nomad_group=~\"$program\", source=~\"docker\", station=~\"$station\"} |~ \"$search\" | json | line_format `{{.message}}` ", + "queryType": "range", + "refId": "A" + } + ], + "title": "Tail", + "type": "logs" } ], + "preload": false, "refresh": "", - "schemaVersion": 38, - "style": "dark", + "schemaVersion": 40, "tags": [], "templating": { "list": [ { - "current": {}, + "current": { + "text": "device-digitalbeam", + "value": "device-digitalbeam" + }, "datasource": { "type": "loki", "uid": "loki" }, "definition": "", - "hide": 0, - "includeAll": false, - "multi": false, + "includeAll": true, "name": "program", "options": [], "query": { @@ -513,27 +529,44 @@ }, "refresh": 2, "regex": "", - "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "loki", + "uid": "loki" + }, + "definition": "", + "includeAll": true, + "name": "station", + "options": [], + "query": { + "label": "station", + "refId": "LokiVariableQueryEditor-VariableQuery", + "stream": "", + "type": 1 + }, + "refresh": 2, + "regex": "", "sort": 1, "type": "query" }, { "allValue": ".+", "current": { - "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "text": "All", + "value": "$__all" }, "datasource": { "type": "loki", "uid": "loki" }, "definition": "", - "hide": 0, "includeAll": true, "multi": true, "name": "level", @@ -546,17 +579,14 @@ }, "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": true, "text": "", "value": "" }, - "hide": 0, "name": "search", "options": [ { @@ -566,7 +596,6 @@ } ], "query": "", - "skipUrlSync": false, "type": "textbox" } ] @@ -577,8 +606,8 @@ }, "timepicker": {}, "timezone": "", - "title": "Logs", + "title": "Docker Logs", "uid": "logs", - "version": 2, + "version": 26, "weekStart": "" -} +} \ No newline at end of file diff --git a/dashboards/logs_syslog.json b/dashboards/logs_syslog.json new file mode 100644 index 0000000000000000000000000000000000000000..77ca02c0dbf925811964bdc9103cf87e613815de --- /dev/null +++ b/dashboards/logs_syslog.json @@ -0,0 +1,613 @@ +{ + "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": 288, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 11, + "panels": [], + "title": "All logs", + "type": "row" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "description": "Errors appearing in the logs of each program.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "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": 3600000, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 10, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "sum by(appname) (count_over_time({level=\"ERROR\", source=\"syslog\", station=~\"$station\"} [$__interval]))", + "legendFormat": "{{program}}", + "queryType": "range", + "refId": "A" + } + ], + "title": "Errors", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 3, + "panels": [], + "title": "Selection for $program", + "type": "row" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "ERROR" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "WARNING" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "INFO" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "WARN" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 1, + "interval": "5m", + "options": { + "barRadius": 0, + "barWidth": 0.76, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "never", + "stacking": "none", + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "sum(count_over_time({appname=~\"$program\",source=\"syslog\", station=~\"$station\"}[$__interval]))", + "legendFormat": "{{level}}", + "queryType": "range", + "refId": "A", + "resolution": 1 + } + ], + "title": "Level count", + "type": "barchart" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 7, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "The amount of data stored by loki, in bytes and number of chunks.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "right" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "unit" + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 9, + "x": 15, + "y": 16 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "loki_chunk_store_stored_chunk_bytes_total", + "hide": false, + "legendFormat": "storage size", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "loki_chunk_store_stored_chunks_total", + "hide": false, + "legendFormat": "chunk/file count", + "range": true, + "refId": "A" + } + ], + "title": "Loki storage", + "type": "timeseries" + } + ], + "title": "Loki performance", + "type": "row" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 22, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 2, + "options": { + "dedupStrategy": "numbers", + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": true, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": true + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{appname=~\"$program\", source=~\"syslog\", station=~\"$station\"} |~ \"$search\" | json | line_format `{{.message}}` ", + "queryType": "range", + "refId": "A" + } + ], + "title": "Tail", + "type": "logs" + } + ], + "preload": false, + "refresh": "", + "schemaVersion": 40, + "tags": [], + "templating": { + "list": [ + { + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "loki", + "uid": "loki" + }, + "definition": "", + "includeAll": true, + "name": "program", + "options": [], + "query": { + "label": "appname", + "refId": "LokiVariableQueryEditor-VariableQuery", + "stream": "", + "type": 1 + }, + "refresh": 2, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "loki", + "uid": "loki" + }, + "definition": "", + "includeAll": true, + "name": "station", + "options": [], + "query": { + "label": "station", + "refId": "LokiVariableQueryEditor-VariableQuery", + "stream": "", + "type": 1 + }, + "refresh": 2, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "loki", + "uid": "loki" + }, + "definition": "", + "includeAll": true, + "multi": true, + "name": "level", + "options": [], + "query": { + "label": "level", + "refId": "LokiVariableQueryEditor-VariableQuery", + "stream": "{nomad_group=\"$program\"}", + "type": 1 + }, + "refresh": 2, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "current": { + "text": "", + "value": "" + }, + "name": "search", + "options": [ + { + "selected": true, + "text": "", + "value": "" + } + ], + "query": "", + "type": "textbox" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Syslog Logs", + "uid": "cecugyu6tmmf4a", + "version": 10, + "weekStart": "" +} \ No newline at end of file