From f4bc3fee4d8d8420542661e92ae1f6b18a296432 Mon Sep 17 00:00:00 2001 From: Filip Chabik Date: Tue, 6 Mar 2018 11:34:59 +0100 Subject: [PATCH] feat: introduce Instance variable. fix: change nginx_upstream_response to nginx_upstream_responseMsec in Upstream Backend Reposnse section. --- dashboard/nginx-vts-exporter.json | 299 +++++++++++++++++------------- 1 file changed, 175 insertions(+), 124 deletions(-) diff --git a/dashboard/nginx-vts-exporter.json b/dashboard/nginx-vts-exporter.json index 60caf25..8b758e1 100644 --- a/dashboard/nginx-vts-exporter.json +++ b/dashboard/nginx-vts-exporter.json @@ -29,105 +29,23 @@ "version": "1.0.0" } ], - "id": null, - "title": "Nginx VTS Stats", "description": "Show stats from the hnlq715/nginx-vts-exporter.", - "tags": [ - "prometheus", - "nginx" - ], - "style": "dark", - "timezone": "browser", "editable": true, - "sharedCrosshair": false, + "gnetId": 2949, + "graphTooltip": 0, "hideControls": 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" - ] - }, - "templating": { - "list": [ - { - "allValue": null, - "current": {}, - "datasource": "${DS_PROMETHEUS}", - "hide": 0, - "includeAll": true, - "label": null, - "multi": false, - "name": "Host", - "options": [], - "query": "label_values(nginx_server_bytes, host)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": {}, - "datasource": "${DS_PROMETHEUS}", - "hide": 0, - "includeAll": true, - "label": null, - "multi": false, - "name": "Upstream", - "options": [], - "query": "label_values(nginx_upstream_bytes, upstream)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "annotations": { - "list": [] - }, - "schemaVersion": 13, - "version": 1, + "id": null, "links": [], - "gnetId": 1623, "rows": [ { - "title": "Dashboard Row", + "collapse": false, + "height": "250px", "panels": [ { "aliasColors": {}, "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "${DS_PROMETHEUS}", "fill": 1, "id": 1, @@ -149,17 +67,17 @@ "points": false, "renderer": "flot", "seriesOverrides": [], + "spaceLength": 10, "span": 6, "stack": false, "steppedLine": false, "targets": [ { - "expr": "nginx_server_connections{status=~\"active|writing|reading|waiting\"}", + "expr": "nginx_server_connections{instance=~\"$Instance\", status=~\"active|writing|reading|waiting\"}", + "format": "time_series", "intervalFactor": 2, - "legendFormat": "{{ status }}", - "metric": "nginx_server_connections", - "refId": "A", - "step": 240 + "legendFormat": "{{status}}", + "refId": "B" } ], "thresholds": [], @@ -174,6 +92,7 @@ }, "type": "graph", "xaxis": { + "buckets": null, "mode": "time", "name": null, "show": true, @@ -201,6 +120,8 @@ { "aliasColors": {}, "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "${DS_PROMETHEUS}", "fill": 1, "id": 4, @@ -222,12 +143,14 @@ "points": false, "renderer": "flot", "seriesOverrides": [], + "spaceLength": 10, "span": 6, "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum(irate(nginx_server_cache{host=~\"^$Host$\"}[5m])) by (status)", + "expr": "sum(irate(nginx_server_cache{instance=~\"$Instance\", host=~\"^$Host$\"}[5m])) by (status)", + "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{ status }}", @@ -248,6 +171,7 @@ }, "type": "graph", "xaxis": { + "buckets": null, "mode": "time", "name": null, "show": true, @@ -273,20 +197,22 @@ ] } ], - "showTitle": false, - "titleSize": "h6", - "height": "250px", "repeat": null, - "repeatRowId": null, "repeatIteration": null, - "collapse": false + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" }, { - "title": "Dashboard Row", + "collapse": false, + "height": 250, "panels": [ { "aliasColors": {}, "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "${DS_PROMETHEUS}", "fill": 1, "id": 3, @@ -308,12 +234,14 @@ "points": false, "renderer": "flot", "seriesOverrides": [], + "spaceLength": 10, "span": 6, "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum(irate(nginx_server_requests{code!=\"total\"}[5m])) by (code)", + "expr": "sum(irate(nginx_server_requests{instance=~\"$Instance\", code!=\"total\"}[5m])) by (code)", + "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{ code }}", @@ -334,6 +262,7 @@ }, "type": "graph", "xaxis": { + "buckets": null, "mode": "time", "name": null, "show": true, @@ -361,6 +290,8 @@ { "aliasColors": {}, "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "${DS_PROMETHEUS}", "fill": 1, "id": 2, @@ -382,12 +313,14 @@ "points": false, "renderer": "flot", "seriesOverrides": [], + "spaceLength": 10, "span": 6, "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum(irate(nginx_server_bytes{host=~\"^$Host$\"}[5m])) by (direction)", + "expr": "sum(irate(nginx_server_bytes{instance=~\"$Instance\", host=~\"^$Host$\"}[5m])) by (direction)", + "format": "time_series", "intervalFactor": 2, "legendFormat": "{{ direction }}", "metric": "nginx_server_bytes", @@ -407,6 +340,7 @@ }, "type": "graph", "xaxis": { + "buckets": null, "mode": "time", "name": null, "show": true, @@ -432,21 +366,24 @@ ] } ], - "showTitle": false, - "titleSize": "h6", - "height": 250, "repeat": null, - "repeatRowId": null, "repeatIteration": null, - "collapse": false + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" }, { - "title": "Dashboard Row", + "collapse": false, + "height": 250, "panels": [ { "aliasColors": {}, "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "${DS_PROMETHEUS}", + "description": "This one is providing aggregated error codes, but it's still possible to graph these per upstream.", "fill": 1, "id": 6, "legend": { @@ -467,12 +404,14 @@ "points": false, "renderer": "flot", "seriesOverrides": [], + "spaceLength": 10, "span": 6, "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum(irate(nginx_upstream_requests{upstream=~\"^$Upstream$\",code!=\"total\"}[5m])) by (code)", + "expr": "sum(irate(nginx_upstream_requests{instance=~\"$Instance\", upstream=~\"^$Upstream$\",code!=\"total\"}[5m])) by (code)", + "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{ code }}", @@ -493,6 +432,7 @@ }, "type": "graph", "xaxis": { + "buckets": null, "mode": "time", "name": null, "show": true, @@ -520,6 +460,8 @@ { "aliasColors": {}, "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "${DS_PROMETHEUS}", "fill": 1, "id": 5, @@ -541,12 +483,14 @@ "points": false, "renderer": "flot", "seriesOverrides": [], + "spaceLength": 10, "span": 6, "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum(irate(nginx_upstream_bytes{upstream=~\"^$Upstream$\"}[5m])) by (direction)", + "expr": "sum(irate(nginx_upstream_bytes{instance=~\"$Instance\", upstream=~\"^$Upstream$\"}[5m])) by (direction)", + "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{ direction }}", @@ -567,6 +511,7 @@ }, "type": "graph", "xaxis": { + "buckets": null, "mode": "time", "name": null, "show": true, @@ -592,20 +537,22 @@ ] } ], - "showTitle": false, - "titleSize": "h6", - "height": 250, "repeat": null, - "repeatRowId": null, "repeatIteration": null, - "collapse": false + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" }, { - "title": "Dashboard Row", + "collapse": false, + "height": 250, "panels": [ { "aliasColors": {}, "bars": false, + "dashLength": 10, + "dashes": false, "datasource": "${DS_PROMETHEUS}", "fill": 1, "id": 7, @@ -627,12 +574,14 @@ "points": false, "renderer": "flot", "seriesOverrides": [], + "spaceLength": 10, "span": 12, "stack": false, "steppedLine": false, "targets": [ { - "expr": "sum(nginx_upstream_response{upstream=~\"^$Upstream$\"}) by (backend)", + "expr": "sum(nginx_upstream_responseMsec{instance=~\"$Instance\", upstream=~\"^$Upstream$\"}) by (backend)", + "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{ backend }}", @@ -653,6 +602,7 @@ }, "type": "graph", "xaxis": { + "buckets": null, "mode": "time", "name": null, "show": true, @@ -678,13 +628,114 @@ ] } ], - "showTitle": false, - "titleSize": "h6", - "height": 250, "repeat": null, - "repeatRowId": null, "repeatIteration": null, - "collapse": false + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" } - ] + ], + "schemaVersion": 14, + "style": "dark", + "tags": [ + "prometheus", + "nginx" + ], + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "Instance", + "options": [], + "query": "label_values(nginx_server_bytes, instance)", + "refresh": 1, + "regex": "", + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "Host", + "options": [], + "query": "label_values(nginx_server_bytes{instance=~\"$Instance\"}, host)", + "refresh": 1, + "regex": "", + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "Upstream", + "options": [], + "query": "label_values(nginx_upstream_bytes{instance=~\"$Instance\"}, upstream)", + "refresh": 1, + "regex": "", + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-3h", + "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": "Nginx VTS Stats", + "version": 9 }