diff --git a/docker-compose.yml b/docker-compose.yml index fa6393f..1143d43 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,6 +53,8 @@ services: - "3000:3000" environment: - GF_SECURITY_ADMIN_PASSWORD=admin + volumes: + - ./samples/grafana:/etc/grafana/provisioning depends_on: - elasticsearch diff --git a/samples/accounting-dashboard-grafana.json b/samples/grafana/dashboards/accounting.json similarity index 87% rename from samples/accounting-dashboard-grafana.json rename to samples/grafana/dashboards/accounting.json index 836d162..8cc7ed0 100644 --- a/samples/accounting-dashboard-grafana.json +++ b/samples/grafana/dashboards/accounting.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_ELASTICSEARCH", - "label": "elasticsearch", + "name": "accounting_es", + "label": "accounting_es", "description": "", "type": "datasource", "pluginId": "elasticsearch", @@ -20,7 +20,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "5.1.1" + "version": "5.1.3" }, { "type": "panel", @@ -52,7 +52,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1526374754898, + "iteration": 1526534156429, "links": [], "panels": [ { @@ -78,9 +78,9 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "${DS_ELASTICSEARCH}", + "datasource": "accounting_es", "decimals": null, - "format": "bytes", + "format": "none", "gauge": { "maxValue": 100, "minValue": 0, @@ -90,7 +90,7 @@ }, "gridPos": { "h": 2, - "w": 5, + "w": 4, "x": 0, "y": 1 }, @@ -179,235 +179,24 @@ "valueName": "current" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_ELASTICSEARCH}", - "decimals": null, - "format": "bytes", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 5, - "x": 5, - "y": 1 - }, - "hideTimeOverride": true, - "id": 81, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "minSpan": 1, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "30%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeatDirection": "h", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "@from", - "targets": [ - { - "bucketAggs": [ - { - "field": "@timestamp", - "id": "2", - "settings": { - "interval": "1m", - "min_doc_count": 0, - "trimEdges": 1 - }, - "type": "date_histogram" - } - ], - "metrics": [ - { - "field": "in_bytes", - "id": "1", - "meta": {}, - "settings": { - "missing": null - }, - "type": "sum" - } - ], - "query": "entry_type: [[entry_type]]", - "refId": "A", - "timeField": "@timestamp" - } - ], - "thresholds": "", - "timeShift": "1m", - "title": "In (bytes)", - "transparent": true, - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_ELASTICSEARCH}", - "decimals": null, - "format": "bytes", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 5, - "x": 10, - "y": 1 - }, - "hideTimeOverride": true, - "id": 82, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "minSpan": 1, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeatDirection": "h", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "aliasColors": { + "Sum in_bytes": "#6ed0e0", + "Sum out_bytes": "#629e51", + "in_bytes": "#6ed0e0", + "nr_entries": "#ea6460", + "out_bytes": "#508642" }, - "tableColumn": "", - "targets": [ - { - "bucketAggs": [ - { - "field": "@timestamp", - "id": "2", - "settings": { - "interval": "1m", - "min_doc_count": 0, - "trimEdges": 1 - }, - "type": "date_histogram" - } - ], - "metrics": [ - { - "field": "out_bytes", - "id": "1", - "meta": {}, - "settings": { - "missing": null - }, - "type": "sum" - } - ], - "query": "entry_type: [[entry_type]]", - "refId": "A", - "timeField": "@timestamp" - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": "1m", - "title": "Out (bytes)", - "transparent": true, - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_ELASTICSEARCH}", + "datasource": "accounting_es", "decimals": null, "fill": 0, "gridPos": { "h": 6, - "w": 12, - "x": 0, - "y": 3 + "w": 10, + "x": 4, + "y": 1 }, "id": 2, "legend": { @@ -435,21 +224,26 @@ "repeatDirection": "h", "seriesOverrides": [ { - "alias": "Sum in_bytes", + "alias": "in_bytes", + "color": "#6ed0e0", "fill": 5, "linewidth": 0, "points": false, - "stack": "A" + "stack": "A", + "steppedLine": true }, { - "alias": "Sum out_bytes", + "alias": "out_bytes", + "color": "#508642", "fill": 5, "linewidth": 0, "points": false, - "stack": "A" + "stack": "A", + "steppedLine": true }, { - "alias": "Sum nr_entries", + "alias": "nr_entries", + "color": "#ea6460", "yaxis": 2 } ], @@ -458,6 +252,7 @@ "steppedLine": false, "targets": [ { + "alias": "{{field}}", "bucketAggs": [ { "field": "@timestamp", @@ -546,14 +341,14 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_ELASTICSEARCH}", + "datasource": "accounting_es", "decimals": null, "fill": 0, "gridPos": { "h": 6, - "w": 12, - "x": 12, - "y": 3 + "w": 10, + "x": 14, + "y": 1 }, "id": 168, "legend": { @@ -578,31 +373,13 @@ "points": true, "renderer": "flot", "repeatDirection": "h", - "seriesOverrides": [ - { - "alias": "Sum in_bytes", - "fill": 5, - "linewidth": 0, - "points": false, - "stack": "A" - }, - { - "alias": "Sum out_bytes", - "fill": 5, - "linewidth": 0, - "points": false, - "stack": "A" - }, - { - "alias": "Sum nr_entries", - "yaxis": 2 - } - ], + "seriesOverrides": [], "spaceLength": 10, "stack": false, - "steppedLine": false, + "steppedLine": true, "targets": [ { + "alias": "{{field}}", "bucketAggs": [ { "field": "@timestamp", @@ -693,20 +470,6 @@ "alignLevel": null } }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 9 - }, - "id": 31, - "panels": [], - "repeat": "accounting_id", - "title": "Channel Details - [[accounting_id]]", - "type": "row" - }, { "cacheTimeout": null, "colorBackground": false, @@ -716,8 +479,9 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "${DS_ELASTICSEARCH}", - "format": "none", + "datasource": "accounting_es", + "decimals": null, + "format": "bytes", "gauge": { "maxValue": 100, "minValue": 0, @@ -727,11 +491,12 @@ }, "gridPos": { "h": 2, - "w": 6, + "w": 4, "x": 0, - "y": 10 + "y": 3 }, - "id": 206, + "hideTimeOverride": true, + "id": 81, "interval": null, "links": [], "mappingType": 1, @@ -746,10 +511,11 @@ } ], "maxDataPoints": 100, + "minSpan": 1, "nullPointMode": "connected", "nullText": null, "postfix": "", - "postfixFontSize": "50%", + "postfixFontSize": "30%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ @@ -766,7 +532,7 @@ "lineColor": "rgb(31, 120, 193)", "show": true }, - "tableColumn": "", + "tableColumn": "@from", "targets": [ { "bucketAggs": [ @@ -774,29 +540,32 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto", + "interval": "1m", "min_doc_count": 0, - "trimEdges": 0 + "trimEdges": 1 }, "type": "date_histogram" } ], "metrics": [ { - "field": "nr_entries", + "field": "in_bytes", "id": "1", "meta": {}, - "settings": {}, + "settings": { + "missing": null + }, "type": "sum" } ], - "query": "accounting_id: [[accounting_id]]", + "query": "entry_type: [[entry_type]]", "refId": "A", "timeField": "@timestamp" } ], "thresholds": "", - "title": "entries [[accounting_id]]", + "timeShift": "1m", + "title": "In (bytes)", "transparent": true, "type": "singlestat", "valueFontSize": "50%", @@ -818,8 +587,9 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "${DS_ELASTICSEARCH}", - "format": "none", + "datasource": "accounting_es", + "decimals": null, + "format": "bytes", "gauge": { "maxValue": 100, "minValue": 0, @@ -829,11 +599,12 @@ }, "gridPos": { "h": 2, - "w": 6, - "x": 6, - "y": 10 + "w": 4, + "x": 0, + "y": 5 }, - "id": 248, + "hideTimeOverride": true, + "id": 82, "interval": null, "links": [], "mappingType": 1, @@ -848,6 +619,7 @@ } ], "maxDataPoints": 100, + "minSpan": 1, "nullPointMode": "connected", "nullText": null, "postfix": "", @@ -876,29 +648,33 @@ "field": "@timestamp", "id": "2", "settings": { - "interval": "auto", + "interval": "1m", "min_doc_count": 0, - "trimEdges": 0 + "trimEdges": 1 }, "type": "date_histogram" } ], "metrics": [ { - "field": "in_bytes", + "field": "out_bytes", "id": "1", "meta": {}, - "settings": {}, + "settings": { + "missing": null + }, "type": "sum" } ], - "query": "accounting_id: [[accounting_id]]", + "query": "entry_type: [[entry_type]]", "refId": "A", "timeField": "@timestamp" } ], "thresholds": "", - "title": "[[accounting_id]] bytes_in", + "timeFrom": null, + "timeShift": "1m", + "title": "Out (bytes)", "transparent": true, "type": "singlestat", "valueFontSize": "50%", @@ -912,106 +688,18 @@ "valueName": "current" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_ELASTICSEARCH}", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, + "collapsed": false, "gridPos": { - "h": 2, - "w": 6, - "x": 12, - "y": 10 - }, - "id": 249, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeatDirection": "h", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true + "h": 1, + "w": 24, + "x": 0, + "y": 7 }, - "tableColumn": "", - "targets": [ - { - "bucketAggs": [ - { - "field": "@timestamp", - "id": "2", - "settings": { - "interval": "auto", - "min_doc_count": 0, - "trimEdges": 0 - }, - "type": "date_histogram" - } - ], - "metrics": [ - { - "field": "out_bytes", - "id": "1", - "meta": {}, - "settings": {}, - "type": "sum" - } - ], - "query": "accounting_id: [[accounting_id]]", - "refId": "A", - "timeField": "@timestamp" - } - ], - "thresholds": "", - "title": "[[accounting_id]] bytes_out", - "transparent": true, - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" + "id": 31, + "panels": [], + "repeat": "accounting_id", + "title": "Channel Details - [[accounting_id]]", + "type": "row" }, { "cacheTimeout": null, @@ -1022,7 +710,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "${DS_ELASTICSEARCH}", + "datasource": "accounting_es", "format": "none", "gauge": { "maxValue": 100, @@ -1033,11 +721,11 @@ }, "gridPos": { "h": 2, - "w": 6, + "w": 4, "x": 0, - "y": 12 + "y": 8 }, - "id": 164, + "id": 206, "interval": null, "links": [], "mappingType": 1, @@ -1065,7 +753,6 @@ "to": "null" } ], - "repeat": "agg_status", "repeatDirection": "h", "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", @@ -1090,7 +777,7 @@ ], "metrics": [ { - "field": "@agg_status.[[agg_status]]", + "field": "nr_entries", "id": "1", "meta": {}, "settings": {}, @@ -1103,7 +790,7 @@ } ], "thresholds": "", - "title": "status [[agg_status]]", + "title": "entries [[accounting_id]]", "transparent": true, "type": "singlestat", "valueFontSize": "50%", @@ -1117,20 +804,23 @@ "valueName": "current" }, { - "aliasColors": {}, + "aliasColors": { + "nr_close_entries": "#890f02", + "nr_entries": "#e0752d", + "nr_open_entries": "#eab839" + }, "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_ELASTICSEARCH}", - "fill": 1, + "datasource": "accounting_es", + "fill": 0, "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 12 + "h": 6, + "w": 10, + "x": 4, + "y": 8 }, - "id": 5, - "interval": "", + "id": 10, "legend": { "alignAsTable": true, "avg": true, @@ -1147,17 +837,49 @@ "minSpan": 12, "nullPointMode": "null", "percentage": false, - "pointradius": 5, - "points": false, + "pointradius": 0.5, + "points": true, "renderer": "flot", "repeat": null, "repeatDirection": "v", - "seriesOverrides": [], + "seriesOverrides": [ + { + "alias": "nr_entries", + "yaxis": 2 + }, + { + "alias": "nr_open_entries", + "yaxis": 2 + }, + { + "alias": "nr_close_entries", + "yaxis": 2 + }, + { + "alias": "in_bytes", + "color": "#65c5db", + "fill": 5, + "linewidth": 0, + "points": false, + "stack": true, + "steppedLine": true + }, + { + "alias": "out_bytes", + "color": "#508642", + "fill": 5, + "linewidth": 0, + "points": false, + "stack": true, + "steppedLine": true + } + ], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { + "alias": "{{field}}", "bucketAggs": [ { "field": "@timestamp", @@ -1172,60 +894,39 @@ ], "metrics": [ { - "field": "@nr_status.200", + "field": "in_bytes", "id": "1", "meta": {}, "settings": {}, "type": "sum" }, { - "field": "@nr_status.301", + "field": "out_bytes", "id": "3", "meta": {}, "settings": {}, "type": "sum" }, { - "field": "@nr_status.302", + "field": "nr_entries", "id": "4", "meta": {}, "settings": {}, "type": "sum" }, { - "field": "@nr_status.403", + "field": "nr_open_entries", "id": "5", "meta": {}, "settings": {}, "type": "sum" }, { - "field": "@nr_status.404", + "field": "nr_close_entries", "id": "6", "meta": {}, "settings": {}, "type": "sum" - }, - { - "field": "@nr_status.499", - "id": "7", - "meta": {}, - "settings": {}, - "type": "sum" - }, - { - "field": "@nr_status.500", - "id": "8", - "meta": {}, - "settings": {}, - "type": "sum" - }, - { - "field": "@nr_status.503", - "id": "9", - "meta": {}, - "settings": {}, - "type": "sum" } ], "query": "accounting_id: [[accounting_id]]", @@ -1236,7 +937,7 @@ "thresholds": [], "timeFrom": null, "timeShift": null, - "title": "[ [[accounting_id]] ] status", + "title": "[ channel: [[accounting_id]] ] Summary", "tooltip": { "shared": true, "sort": 0, @@ -1252,7 +953,7 @@ }, "yaxes": [ { - "format": "short", + "format": "bytes", "label": null, "logBase": 1, "max": null, @@ -1269,7 +970,7 @@ } ], "yaxis": { - "align": true, + "align": false, "alignLevel": null } }, @@ -1278,15 +979,16 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_ELASTICSEARCH}", - "fill": 0, + "datasource": "accounting_es", + "fill": 1, "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 14 + "h": 6, + "w": 10, + "x": 14, + "y": 8 }, - "id": 10, + "id": 5, + "interval": "", "legend": { "alignAsTable": true, "avg": true, @@ -1308,39 +1010,13 @@ "renderer": "flot", "repeat": null, "repeatDirection": "v", - "seriesOverrides": [ - { - "alias": "Sum nr_entries", - "yaxis": 2 - }, - { - "alias": "Sum nr_open_entries", - "yaxis": 2 - }, - { - "alias": "Sum nr_close_entries", - "yaxis": 2 - }, - { - "alias": "Sum in_bytes", - "fill": 5, - "linewidth": 0, - "points": false, - "stack": true - }, - { - "alias": "Sum out_bytes", - "fill": 5, - "linewidth": 0, - "points": false, - "stack": true - } - ], + "seriesOverrides": [], "spaceLength": 10, - "stack": false, - "steppedLine": false, + "stack": true, + "steppedLine": true, "targets": [ { + "alias": "{{field}}", "bucketAggs": [ { "field": "@timestamp", @@ -1355,39 +1031,60 @@ ], "metrics": [ { - "field": "in_bytes", + "field": "@nr_status.200", "id": "1", "meta": {}, "settings": {}, "type": "sum" }, { - "field": "out_bytes", + "field": "@nr_status.301", "id": "3", "meta": {}, "settings": {}, "type": "sum" }, { - "field": "nr_entries", + "field": "@nr_status.302", "id": "4", "meta": {}, "settings": {}, "type": "sum" }, { - "field": "nr_open_entries", + "field": "@nr_status.403", "id": "5", "meta": {}, "settings": {}, "type": "sum" }, { - "field": "nr_close_entries", + "field": "@nr_status.404", "id": "6", "meta": {}, "settings": {}, "type": "sum" + }, + { + "field": "@nr_status.499", + "id": "7", + "meta": {}, + "settings": {}, + "type": "sum" + }, + { + "field": "@nr_status.500", + "id": "8", + "meta": {}, + "settings": {}, + "type": "sum" + }, + { + "field": "@nr_status.503", + "id": "9", + "meta": {}, + "settings": {}, + "type": "sum" } ], "query": "accounting_id: [[accounting_id]]", @@ -1398,7 +1095,7 @@ "thresholds": [], "timeFrom": null, "timeShift": null, - "title": "[ channel: [[accounting_id]] ] Summary", + "title": "[ [[accounting_id]] ] status", "tooltip": { "shared": true, "sort": 0, @@ -1414,7 +1111,7 @@ }, "yaxes": [ { - "format": "bytes", + "format": "short", "label": null, "logBase": 1, "max": null, @@ -1431,9 +1128,213 @@ } ], "yaxis": { - "align": false, + "align": true, "alignLevel": null } + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "accounting_es", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 0, + "y": 10 + }, + "id": 248, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeatDirection": "h", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto", + "min_doc_count": 0, + "trimEdges": 0 + }, + "type": "date_histogram" + } + ], + "metrics": [ + { + "field": "in_bytes", + "id": "1", + "meta": {}, + "settings": {}, + "type": "sum" + } + ], + "query": "accounting_id: [[accounting_id]]", + "refId": "A", + "timeField": "@timestamp" + } + ], + "thresholds": "", + "title": "[[accounting_id]] bytes_in", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "accounting_es", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 0, + "y": 12 + }, + "id": 249, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "repeatDirection": "h", + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto", + "min_doc_count": 0, + "trimEdges": 0 + }, + "type": "date_histogram" + } + ], + "metrics": [ + { + "field": "out_bytes", + "id": "1", + "meta": {}, + "settings": {}, + "type": "sum" + } + ], + "query": "accounting_id: [[accounting_id]]", + "refId": "A", + "timeField": "@timestamp" + } + ], + "thresholds": "", + "title": "[[accounting_id]] bytes_out", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" } ], "refresh": "30s", @@ -1445,7 +1346,7 @@ { "allValue": null, "current": {}, - "datasource": "${DS_ELASTICSEARCH}", + "datasource": "accounting_es", "hide": 0, "includeAll": true, "label": "category", @@ -1465,7 +1366,7 @@ { "allValue": null, "current": {}, - "datasource": "${DS_ELASTICSEARCH}", + "datasource": "accounting_es", "hide": 0, "includeAll": true, "label": null, @@ -1485,7 +1386,7 @@ { "allValue": null, "current": {}, - "datasource": "${DS_ELASTICSEARCH}", + "datasource": "accounting_es", "hide": 2, "includeAll": true, "label": null, @@ -1505,7 +1406,7 @@ { "allValue": null, "current": {}, - "datasource": "${DS_ELASTICSEARCH}", + "datasource": "accounting_es", "hide": 2, "includeAll": true, "label": null, @@ -1552,5 +1453,5 @@ "timezone": "", "title": "Accounting", "uid": "ekEH8Mnmk", - "version": 3 -} \ No newline at end of file + "version": 1 +} diff --git a/samples/grafana/dashboards/accounting.yaml b/samples/grafana/dashboards/accounting.yaml new file mode 100644 index 0000000..c538b76 --- /dev/null +++ b/samples/grafana/dashboards/accounting.yaml @@ -0,0 +1,10 @@ +apiVersion: 1 + +providers: +- name: 'Accounting' + orgId: 1 + folder: '' + type: file + disableDeletion: false + options: + path: /etc/grafana/provisioning/dashboards diff --git a/samples/grafana/datasources/datasource.yaml b/samples/grafana/datasources/datasource.yaml new file mode 100644 index 0000000..a12a424 --- /dev/null +++ b/samples/grafana/datasources/datasource.yaml @@ -0,0 +1,12 @@ +apiVersion: 1 + +datasources: + - name: accounting_es + type: elasticsearch + access: proxy + # database: "[logstash-]xxxx.ww" + url: http://elasticsearch:9200 + jsonData: + esVersion: 56 + timeInterval: 1m + timeField: "@timestamp"