Forked from patsevanton/Nginx-log-collector-grafana-dashboard
Created
October 28, 2020 14:30
-
-
Save vulcangz/711c85484638e9e183dbe020878d8b3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", | |
"type": "dashboard" | |
} | |
] | |
}, | |
"editable": true, | |
"gnetId": null, | |
"graphTooltip": 1, | |
"id": 614, | |
"iteration": 1582111182355, | |
"links": [], | |
"panels": [ | |
{ | |
"cacheTimeout": null, | |
"colorBackground": false, | |
"colorValue": false, | |
"colors": [ | |
"#299c46", | |
"rgba(237, 129, 40, 0.89)", | |
"#d44a3a" | |
], | |
"datasource": "clickhouse-nginx-log-collector", | |
"format": "none", | |
"gauge": { | |
"maxValue": 100, | |
"minValue": 0, | |
"show": false, | |
"thresholdLabels": false, | |
"thresholdMarkers": true | |
}, | |
"gridPos": { | |
"h": 5, | |
"w": 4, | |
"x": 0, | |
"y": 0 | |
}, | |
"id": 7, | |
"interval": null, | |
"links": [], | |
"mappingType": 1, | |
"mappingTypes": [ | |
{ | |
"name": "value to text", | |
"value": 1 | |
}, | |
{ | |
"name": "range to text", | |
"value": 2 | |
} | |
], | |
"maxDataPoints": 100, | |
"nullPointMode": "connected", | |
"nullText": null, | |
"options": {}, | |
"postfix": "", | |
"postfixFontSize": "50%", | |
"prefix": "", | |
"prefixFontSize": "50%", | |
"rangeMaps": [ | |
{ | |
"from": "null", | |
"text": "N/A", | |
"to": "null" | |
} | |
], | |
"sparkline": { | |
"fillColor": "rgba(31, 118, 189, 0.18)", | |
"full": false, | |
"lineColor": "rgb(31, 120, 193)", | |
"show": false, | |
"ymax": null, | |
"ymin": null | |
}, | |
"tableColumn": "", | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"interval": "15s", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "SELECT\n 1 as t,\n count(*) as c\n FROM $table\n WHERE $timeFilter GROUP BY t", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT 1 as t, count(*) as c FROM nginx.access_log WHERE event_date >= toDate(1582092418) AND event_datetime >= toDateTime(1582092418) GROUP BY t", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": "", | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "Total Requests", | |
"type": "singlestat", | |
"valueFontSize": "80%", | |
"valueMaps": [ | |
{ | |
"op": "=", | |
"text": "N/A", | |
"value": "null" | |
} | |
], | |
"valueName": "avg" | |
}, | |
{ | |
"cacheTimeout": null, | |
"colorBackground": false, | |
"colorValue": false, | |
"colors": [ | |
"#299c46", | |
"rgba(237, 129, 40, 0.89)", | |
"#d44a3a" | |
], | |
"datasource": "clickhouse-nginx-log-collector", | |
"format": "none", | |
"gauge": { | |
"maxValue": 100, | |
"minValue": 0, | |
"show": false, | |
"thresholdLabels": false, | |
"thresholdMarkers": true | |
}, | |
"gridPos": { | |
"h": 5, | |
"w": 4, | |
"x": 4, | |
"y": 0 | |
}, | |
"id": 8, | |
"interval": null, | |
"links": [], | |
"mappingType": 1, | |
"mappingTypes": [ | |
{ | |
"name": "value to text", | |
"value": 1 | |
}, | |
{ | |
"name": "range to text", | |
"value": 2 | |
} | |
], | |
"maxDataPoints": 100, | |
"nullPointMode": "connected", | |
"nullText": null, | |
"options": {}, | |
"postfix": "", | |
"postfixFontSize": "50%", | |
"prefix": "", | |
"prefixFontSize": "50%", | |
"rangeMaps": [ | |
{ | |
"from": "null", | |
"text": "N/A", | |
"to": "null" | |
} | |
], | |
"sparkline": { | |
"fillColor": "rgba(31, 118, 189, 0.18)", | |
"full": false, | |
"lineColor": "rgb(31, 120, 193)", | |
"show": false, | |
"ymax": null, | |
"ymin": null | |
}, | |
"tableColumn": "", | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"interval": "15s", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "SELECT\n 1 as t,\n count(*) as c\n FROM $table\n WHERE $timeFilter AND status NOT IN (200, 201, 401) GROUP BY t", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT 1 as t, count(*) as c FROM nginx.access_log WHERE event_date >= toDate(1582097089) AND event_datetime >= toDateTime(1582097089) AND status NOT IN (200, 201, 401) GROUP BY t", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": "10,20,50", | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "Failed Requests", | |
"type": "singlestat", | |
"valueFontSize": "80%", | |
"valueMaps": [ | |
{ | |
"op": "=", | |
"text": "N/A", | |
"value": "null" | |
} | |
], | |
"valueName": "avg" | |
}, | |
{ | |
"cacheTimeout": null, | |
"colorBackground": true, | |
"colorValue": false, | |
"colors": [ | |
"#299c46", | |
"rgba(237, 129, 40, 0.89)", | |
"#d44a3a" | |
], | |
"datasource": "clickhouse-nginx-log-collector", | |
"format": "none", | |
"gauge": { | |
"maxValue": 100, | |
"minValue": 0, | |
"show": false, | |
"thresholdLabels": false, | |
"thresholdMarkers": true | |
}, | |
"gridPos": { | |
"h": 5, | |
"w": 4, | |
"x": 8, | |
"y": 0 | |
}, | |
"id": 9, | |
"interval": null, | |
"links": [], | |
"mappingType": 1, | |
"mappingTypes": [ | |
{ | |
"name": "value to text", | |
"value": 1 | |
}, | |
{ | |
"name": "range to text", | |
"value": 2 | |
} | |
], | |
"maxDataPoints": 100, | |
"nullPointMode": "connected", | |
"nullText": null, | |
"options": {}, | |
"postfix": "%", | |
"postfixFontSize": "50%", | |
"prefix": "", | |
"prefixFontSize": "50%", | |
"rangeMaps": [ | |
{ | |
"from": "null", | |
"text": "N/A", | |
"to": "null" | |
} | |
], | |
"sparkline": { | |
"fillColor": "rgba(31, 118, 189, 0.18)", | |
"full": false, | |
"lineColor": "rgb(31, 120, 193)", | |
"show": false, | |
"ymax": null, | |
"ymin": null | |
}, | |
"tableColumn": "", | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "SELECT\n 1 as t, (sum(status = 500 or status = 499)/sum(status = 200 or status = 201 or status = 401))*100 FROM $table\n WHERE $timeFilter GROUP BY t", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT 1 as t, (sum(status = 500 or status = 499)/sum(status = 200 or status = 201 or status = 401))*100 FROM nginx.access_log WHERE event_date >= toDate(1582087357) AND event_datetime >= toDateTime(1582087357) GROUP BY t", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": "1,5", | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "Failing Percent", | |
"type": "singlestat", | |
"valueFontSize": "80%", | |
"valueMaps": [ | |
{ | |
"op": "=", | |
"text": "N/A", | |
"value": "null" | |
} | |
], | |
"valueName": "avg" | |
}, | |
{ | |
"cacheTimeout": null, | |
"colorBackground": true, | |
"colorValue": false, | |
"colors": [ | |
"#d44a3a", | |
"rgba(237, 129, 40, 0.89)", | |
"#299c46" | |
], | |
"datasource": "clickhouse-nginx-log-collector", | |
"decimals": 3, | |
"format": "none", | |
"gauge": { | |
"maxValue": 100, | |
"minValue": 0, | |
"show": false, | |
"thresholdLabels": false, | |
"thresholdMarkers": true | |
}, | |
"gridPos": { | |
"h": 5, | |
"w": 4, | |
"x": 12, | |
"y": 0 | |
}, | |
"id": 20, | |
"interval": null, | |
"links": [], | |
"mappingType": 1, | |
"mappingTypes": [ | |
{ | |
"name": "value to text", | |
"value": 1 | |
}, | |
{ | |
"name": "range to text", | |
"value": 2 | |
} | |
], | |
"maxDataPoints": 100, | |
"nullPointMode": "connected", | |
"nullText": null, | |
"options": {}, | |
"postfix": "%", | |
"postfixFontSize": "50%", | |
"prefix": "", | |
"prefixFontSize": "50%", | |
"rangeMaps": [ | |
{ | |
"from": "null", | |
"text": "N/A", | |
"to": "null" | |
} | |
], | |
"sparkline": { | |
"fillColor": "rgba(31, 118, 189, 0.18)", | |
"full": false, | |
"lineColor": "rgb(31, 120, 193)", | |
"show": false, | |
"ymax": null, | |
"ymin": null | |
}, | |
"tableColumn": "", | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "SELECT\n 1 as t, (((count(*) as c))-(sum(status = 500 or status = 502 or status = 503)))/(count(*) as c)*100 FROM $table\n WHERE $timeFilter GROUP BY t", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT t, upstream_response_time/runningDifference(t/1000) upstream_response_timeRate FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, avg(arrayElement(upstream_response_time, 1)) as upstream_response_time FROM nginx.access_log WHERE event_date BETWEEN toDate(1582096424) AND toDate(1582100414) AND event_datetime BETWEEN toDateTime(1582096424) AND toDateTime(1582100414) GROUP BY t ORDER BY t)", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": "98,99,100", | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "SLO", | |
"type": "singlestat", | |
"valueFontSize": "80%", | |
"valueMaps": [ | |
{ | |
"op": "=", | |
"text": "N/A", | |
"value": "null" | |
} | |
], | |
"valueName": "total" | |
}, | |
{ | |
"cacheTimeout": null, | |
"colorBackground": false, | |
"colorValue": false, | |
"colors": [ | |
"#299c46", | |
"rgba(237, 129, 40, 0.89)", | |
"#d44a3a" | |
], | |
"datasource": "clickhouse-nginx-log-collector", | |
"format": "none", | |
"gauge": { | |
"maxValue": 100, | |
"minValue": 0, | |
"show": false, | |
"thresholdLabels": false, | |
"thresholdMarkers": true | |
}, | |
"gridPos": { | |
"h": 5, | |
"w": 4, | |
"x": 16, | |
"y": 0 | |
}, | |
"id": 11, | |
"interval": null, | |
"links": [], | |
"mappingType": 1, | |
"mappingTypes": [ | |
{ | |
"name": "value to text", | |
"value": 1 | |
}, | |
{ | |
"name": "range to text", | |
"value": 2 | |
} | |
], | |
"maxDataPoints": 100, | |
"nullPointMode": "connected", | |
"nullText": null, | |
"options": {}, | |
"postfix": "", | |
"postfixFontSize": "50%", | |
"prefix": "", | |
"prefixFontSize": "50%", | |
"rangeMaps": [ | |
{ | |
"from": "null", | |
"text": "N/A", | |
"to": "null" | |
} | |
], | |
"sparkline": { | |
"fillColor": "rgba(31, 118, 189, 0.18)", | |
"full": false, | |
"lineColor": "rgb(31, 120, 193)", | |
"show": false, | |
"ymax": null, | |
"ymin": null | |
}, | |
"tableColumn": "", | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"interval": "15s", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "SELECT\n 1 as t, max(request_time) as c\n FROM $table\n WHERE $timeFilter GROUP BY t", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT t, groupArray((status, c)) AS groupArr FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, status, count(*) as c from nginx.access_log WHERE event_date >= toDate(1582087395) AND event_datetime >= toDateTime(1582087395) GROUP BY t, status ORDER BY t, status) GROUP BY t ORDER BY t", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": "", | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "Max Response Time", | |
"type": "singlestat", | |
"valueFontSize": "80%", | |
"valueMaps": [ | |
{ | |
"op": "=", | |
"text": "N/A", | |
"value": "null" | |
} | |
], | |
"valueName": "avg" | |
}, | |
{ | |
"cacheTimeout": null, | |
"colorBackground": false, | |
"colorValue": false, | |
"colors": [ | |
"#299c46", | |
"rgba(237, 129, 40, 0.89)", | |
"#d44a3a" | |
], | |
"datasource": "clickhouse-nginx-log-collector", | |
"format": "none", | |
"gauge": { | |
"maxValue": 100, | |
"minValue": 0, | |
"show": false, | |
"thresholdLabels": false, | |
"thresholdMarkers": true | |
}, | |
"gridPos": { | |
"h": 5, | |
"w": 4, | |
"x": 20, | |
"y": 0 | |
}, | |
"id": 10, | |
"interval": null, | |
"links": [], | |
"mappingType": 1, | |
"mappingTypes": [ | |
{ | |
"name": "value to text", | |
"value": 1 | |
}, | |
{ | |
"name": "range to text", | |
"value": 2 | |
} | |
], | |
"maxDataPoints": 100, | |
"nullPointMode": "connected", | |
"nullText": null, | |
"options": {}, | |
"postfix": "", | |
"postfixFontSize": "50%", | |
"prefix": "", | |
"prefixFontSize": "50%", | |
"rangeMaps": [ | |
{ | |
"from": "null", | |
"text": "N/A", | |
"to": "null" | |
} | |
], | |
"sparkline": { | |
"fillColor": "rgba(31, 118, 189, 0.18)", | |
"full": false, | |
"lineColor": "rgb(31, 120, 193)", | |
"show": false, | |
"ymax": null, | |
"ymin": null | |
}, | |
"tableColumn": "", | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"interval": "15s", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "SELECT\n 1, avg(request_time) FROM $table\n WHERE $timeFilter GROUP BY 1", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT 1, avg(request_time) FROM nginx.access_log WHERE event_date >= toDate(1582087362) AND event_datetime >= toDateTime(1582087362) GROUP BY 1", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": "", | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "Avg Response Time", | |
"type": "singlestat", | |
"valueFontSize": "80%", | |
"valueMaps": [ | |
{ | |
"op": "=", | |
"text": "N/A", | |
"value": "null" | |
} | |
], | |
"valueName": "avg" | |
}, | |
{ | |
"aliasColors": {}, | |
"bars": false, | |
"dashLength": 10, | |
"dashes": false, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fill": 1, | |
"fillGradient": 0, | |
"gridPos": { | |
"h": 8, | |
"w": 24, | |
"x": 0, | |
"y": 5 | |
}, | |
"hiddenSeries": false, | |
"id": 2, | |
"legend": { | |
"avg": false, | |
"current": false, | |
"max": false, | |
"min": false, | |
"show": true, | |
"total": false, | |
"values": false | |
}, | |
"lines": true, | |
"linewidth": 1, | |
"nullPointMode": "null", | |
"options": { | |
"dataLinks": [] | |
}, | |
"percentage": false, | |
"pointradius": 2, | |
"points": false, | |
"renderer": "flot", | |
"seriesOverrides": [], | |
"spaceLength": 10, | |
"stack": false, | |
"steppedLine": false, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"query": "$columns(status, count(*) as c) from $table WHERE $timeFilter", | |
"rawQuery": "SELECT t, groupArray((status, c)) AS groupArr FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, status, count(*) as c from nginx.access_log WHERE event_date >= toDate(1582109368) AND event_datetime >= toDateTime(1582109368) AND event_date >= toDate(1582109368) AND event_datetime >= toDateTime(1582109368) GROUP BY t, status ORDER BY t, status) GROUP BY t ORDER BY t", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false | |
} | |
], | |
"thresholds": [], | |
"timeFrom": null, | |
"timeRegions": [], | |
"timeShift": null, | |
"title": "Count Status", | |
"tooltip": { | |
"shared": true, | |
"sort": 0, | |
"value_type": "individual" | |
}, | |
"type": "graph", | |
"xaxis": { | |
"buckets": null, | |
"mode": "time", | |
"name": null, | |
"show": true, | |
"values": [] | |
}, | |
"yaxes": [ | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
}, | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
} | |
], | |
"yaxis": { | |
"align": false, | |
"alignLevel": null | |
} | |
}, | |
{ | |
"aliasColors": {}, | |
"breakPoint": "50%", | |
"cacheTimeout": null, | |
"combine": { | |
"label": "Others", | |
"threshold": 0 | |
}, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fontSize": "80%", | |
"format": "short", | |
"gridPos": { | |
"h": 10, | |
"w": 12, | |
"x": 0, | |
"y": 13 | |
}, | |
"id": 22, | |
"interval": null, | |
"legend": { | |
"show": true, | |
"values": true | |
}, | |
"legendType": "Right side", | |
"links": [], | |
"maxDataPoints": 3, | |
"nullPointMode": "connected", | |
"options": {}, | |
"pieType": "pie", | |
"pluginVersion": "6.5.3", | |
"strokeWidth": 1, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"query": "SELECT \n 1,\n request_uri,\n status, \n count(*) AS cnt\nFROM $table\nWHERE $timeFilter AND status NOT IN (200,201)\nGROUP BY \n request_uri, \n status\nORDER BY cnt DESC\nLIMIT 5", | |
"rawQuery": "SELECT 1, request_uri, status, count(*) AS cnt FROM nginx.access_log WHERE event_date >= toDate(1582109581) AND event_datetime >= toDateTime(1582109581) AND status NOT IN (200,201) GROUP BY request_uri, status ORDER BY cnt DESC LIMIT 5", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false | |
} | |
], | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "TOP 5 failed Request_URI", | |
"type": "grafana-piechart-panel", | |
"valueName": "current" | |
}, | |
{ | |
"aliasColors": {}, | |
"breakPoint": "50%", | |
"cacheTimeout": null, | |
"combine": { | |
"label": "Others", | |
"threshold": 0 | |
}, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fontSize": "80%", | |
"format": "short", | |
"gridPos": { | |
"h": 10, | |
"w": 12, | |
"x": 12, | |
"y": 13 | |
}, | |
"id": 26, | |
"interval": null, | |
"legend": { | |
"show": true, | |
"values": true | |
}, | |
"legendType": "Right side", | |
"links": [], | |
"maxDataPoints": 3, | |
"nullPointMode": "connected", | |
"options": {}, | |
"pieType": "pie", | |
"pluginVersion": "6.5.3", | |
"strokeWidth": 1, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"query": "SELECT\n 1,\n request_uri,\n count(*) AS Reqs\nFROM $table\nWHERE $timeFilter\nGROUP BY request_uri\nORDER BY Reqs desc\nLIMIT 15", | |
"rawQuery": "SELECT t, upstream_response_time/runningDifference(t/1000) upstream_response_timeRate FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, avg(arrayElement(upstream_response_time, 1)) as upstream_response_time FROM nginx.access_log WHERE event_date >= toDate(1582109768) AND event_datetime >= toDateTime(1582109768) GROUP BY t ORDER BY t)", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false | |
} | |
], | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "TOP 5 Request_URI", | |
"type": "grafana-piechart-panel", | |
"valueName": "current" | |
}, | |
{ | |
"aliasColors": {}, | |
"breakPoint": "50%", | |
"cacheTimeout": null, | |
"combine": { | |
"label": "Others", | |
"threshold": 0 | |
}, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fontSize": "80%", | |
"format": "short", | |
"gridPos": { | |
"h": 8, | |
"w": 12, | |
"x": 0, | |
"y": 23 | |
}, | |
"id": 23, | |
"interval": null, | |
"legend": { | |
"show": true, | |
"values": true | |
}, | |
"legendType": "Right side", | |
"links": [], | |
"maxDataPoints": 3, | |
"nullPointMode": "connected", | |
"options": {}, | |
"pieType": "pie", | |
"pluginVersion": "6.5.3", | |
"strokeWidth": 1, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"query": "SELECT\n 1,\n IPv4NumToString(remote_addr) as remote_addr_str,\n status,\n count(*) AS Reqs\nFROM $table\nWHERE\n $timeFilter\n AND status NOT IN (200,201)\nGROUP BY \n remote_addr_str,\n status\nORDER BY Reqs DESC\nLIMIT 5", | |
"rawQuery": "SELECT t, upstream_response_time/runningDifference(t/1000) upstream_response_timeRate FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, avg(arrayElement(upstream_response_time, 1)) as upstream_response_time FROM nginx.access_log WHERE event_date >= toDate(1582109527) AND event_datetime >= toDateTime(1582109527) GROUP BY t ORDER BY t)", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false | |
} | |
], | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "TOP 5 failed by remote_ip", | |
"type": "grafana-piechart-panel", | |
"valueName": "current" | |
}, | |
{ | |
"aliasColors": {}, | |
"breakPoint": "50%", | |
"cacheTimeout": null, | |
"combine": { | |
"label": "Others", | |
"threshold": 0 | |
}, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fontSize": "80%", | |
"format": "short", | |
"gridPos": { | |
"h": 8, | |
"w": 12, | |
"x": 12, | |
"y": 23 | |
}, | |
"id": 25, | |
"interval": null, | |
"legend": { | |
"percentage": true, | |
"percentageDecimals": 3, | |
"show": true, | |
"values": true | |
}, | |
"legendType": "Right side", | |
"links": [], | |
"maxDataPoints": 3, | |
"nullPointMode": "connected", | |
"options": {}, | |
"pieType": "pie", | |
"pluginVersion": "6.5.2", | |
"strokeWidth": 1, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"query": "SELECT\n 1,\n IPv4NumToString(remote_addr) as remote_addr_str,\n count(*) AS Reqs\nFROM $table\nWHERE $timeFilter\nGROUP BY remote_addr_str\nORDER BY Reqs desc\nLIMIT 5", | |
"rawQuery": "SELECT t, upstream_response_time/runningDifference(t/1000) upstream_response_timeRate FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, avg(arrayElement(upstream_response_time, 1)) as upstream_response_time FROM nginx.access_log WHERE event_date >= toDate(1582110013) AND event_datetime >= toDateTime(1582110013) GROUP BY t ORDER BY t)", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false | |
} | |
], | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "TOP 5 remote_ip", | |
"type": "grafana-piechart-panel", | |
"valueName": "total" | |
}, | |
{ | |
"aliasColors": {}, | |
"breakPoint": "50%", | |
"cacheTimeout": null, | |
"combine": { | |
"label": "Others", | |
"threshold": 0 | |
}, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fontSize": "80%", | |
"format": "short", | |
"gridPos": { | |
"h": 8, | |
"w": 24, | |
"x": 0, | |
"y": 31 | |
}, | |
"id": 18, | |
"interval": null, | |
"legend": { | |
"percentage": true, | |
"percentageDecimals": 3, | |
"show": true, | |
"values": true | |
}, | |
"legendType": "Right side", | |
"links": [], | |
"maxDataPoints": 3, | |
"nullPointMode": "connected", | |
"options": {}, | |
"pieType": "pie", | |
"pluginVersion": "6.5.2", | |
"strokeWidth": 1, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"query": "SELECT\n 1, /* fake timestamp value */\n status,\n count(*) AS Reqs\nFROM $table\nWHERE $timeFilter\nGROUP BY status\nORDER BY Reqs desc\nLIMIT 5", | |
"rawQuery": "SELECT 1, status, count(*) AS Reqs FROM nginx.access_log WHERE event_date >= toDate(1582109503) AND event_datetime >= toDateTime(1582109503) GROUP BY status ORDER BY Reqs desc LIMIT 5", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false | |
} | |
], | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "TOP 5 Status Pie", | |
"type": "grafana-piechart-panel", | |
"valueName": "total" | |
}, | |
{ | |
"aliasColors": {}, | |
"bars": false, | |
"dashLength": 10, | |
"dashes": false, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fill": 1, | |
"fillGradient": 0, | |
"gridPos": { | |
"h": 8, | |
"w": 24, | |
"x": 0, | |
"y": 39 | |
}, | |
"hiddenSeries": false, | |
"id": 17, | |
"legend": { | |
"avg": false, | |
"current": false, | |
"max": false, | |
"min": false, | |
"show": true, | |
"total": false, | |
"values": false | |
}, | |
"lines": true, | |
"linewidth": 1, | |
"nullPointMode": "null", | |
"options": { | |
"dataLinks": [] | |
}, | |
"percentage": false, | |
"pointradius": 2, | |
"points": false, | |
"renderer": "flot", | |
"seriesOverrides": [], | |
"spaceLength": 10, | |
"stack": false, | |
"steppedLine": false, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"query": "$columns(http_user_agent, count(*) c) FROM $table", | |
"rawQuery": "SELECT t, groupArray((status, c)) AS groupArr FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, status, count(*) as c from nginx.access_log WHERE event_date >= toDate(1582095670) AND event_datetime >= toDateTime(1582095670) GROUP BY t, status ORDER BY t, status) GROUP BY t ORDER BY t", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false | |
} | |
], | |
"thresholds": [], | |
"timeFrom": null, | |
"timeRegions": [], | |
"timeShift": null, | |
"title": "Count http_user_agent", | |
"tooltip": { | |
"shared": true, | |
"sort": 0, | |
"value_type": "individual" | |
}, | |
"type": "graph", | |
"xaxis": { | |
"buckets": null, | |
"mode": "time", | |
"name": null, | |
"show": true, | |
"values": [] | |
}, | |
"yaxes": [ | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
}, | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
} | |
], | |
"yaxis": { | |
"align": false, | |
"alignLevel": null | |
} | |
}, | |
{ | |
"aliasColors": {}, | |
"bars": false, | |
"dashLength": 10, | |
"dashes": false, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fill": 1, | |
"fillGradient": 0, | |
"gridPos": { | |
"h": 8, | |
"w": 24, | |
"x": 0, | |
"y": 47 | |
}, | |
"hiddenSeries": false, | |
"id": 14, | |
"legend": { | |
"avg": false, | |
"current": false, | |
"max": false, | |
"min": false, | |
"show": true, | |
"total": false, | |
"values": false | |
}, | |
"lines": true, | |
"linewidth": 1, | |
"nullPointMode": "null", | |
"options": { | |
"dataLinks": [] | |
}, | |
"percentage": false, | |
"pointradius": 2, | |
"points": false, | |
"renderer": "flot", | |
"seriesOverrides": [], | |
"spaceLength": 10, | |
"stack": false, | |
"steppedLine": false, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"interval": "15s", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "$rate(countIf(status = 200) AS good, countIf(status != 200) AS bad) FROM $table", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT t, upstream_response_time/runningDifference(t/1000) upstream_response_timeRate FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, avg(arrayElement(upstream_response_time, 1)) as upstream_response_time FROM nginx.access_log WHERE event_date >= toDate(1582101427) AND event_datetime >= toDateTime(1582101427) GROUP BY t ORDER BY t)", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": [], | |
"timeFrom": null, | |
"timeRegions": [], | |
"timeShift": null, | |
"title": "GoodRate/BadRate", | |
"tooltip": { | |
"shared": true, | |
"sort": 0, | |
"value_type": "individual" | |
}, | |
"type": "graph", | |
"xaxis": { | |
"buckets": null, | |
"mode": "time", | |
"name": null, | |
"show": true, | |
"values": [] | |
}, | |
"yaxes": [ | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
}, | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
} | |
], | |
"yaxis": { | |
"align": false, | |
"alignLevel": null | |
} | |
}, | |
{ | |
"aliasColors": {}, | |
"bars": false, | |
"dashLength": 10, | |
"dashes": false, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fill": 1, | |
"fillGradient": 0, | |
"gridPos": { | |
"h": 8, | |
"w": 24, | |
"x": 0, | |
"y": 55 | |
}, | |
"hiddenSeries": false, | |
"id": 13, | |
"legend": { | |
"avg": false, | |
"current": false, | |
"max": false, | |
"min": false, | |
"show": true, | |
"total": false, | |
"values": false | |
}, | |
"lines": true, | |
"linewidth": 1, | |
"nullPointMode": "null", | |
"options": { | |
"dataLinks": [] | |
}, | |
"percentage": false, | |
"pointradius": 2, | |
"points": false, | |
"renderer": "flot", | |
"seriesOverrides": [], | |
"spaceLength": 10, | |
"stack": false, | |
"steppedLine": false, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "$rate(avg(request_time) as request_time) FROM $table", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT t, request_time/runningDifference(t/1000) request_timeRate FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, avg(request_time) as request_time FROM nginx.access_log WHERE event_date >= toDate(1582087601) AND event_datetime >= toDateTime(1582087601) GROUP BY t ORDER BY t)", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": [], | |
"timeFrom": null, | |
"timeRegions": [], | |
"timeShift": null, | |
"title": "Response Timing", | |
"tooltip": { | |
"shared": true, | |
"sort": 0, | |
"value_type": "individual" | |
}, | |
"type": "graph", | |
"xaxis": { | |
"buckets": null, | |
"mode": "time", | |
"name": null, | |
"show": true, | |
"values": [] | |
}, | |
"yaxes": [ | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
}, | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
} | |
], | |
"yaxis": { | |
"align": false, | |
"alignLevel": null | |
} | |
}, | |
{ | |
"aliasColors": {}, | |
"bars": false, | |
"dashLength": 10, | |
"dashes": false, | |
"datasource": "clickhouse-nginx-log-collector", | |
"fill": 1, | |
"fillGradient": 0, | |
"gridPos": { | |
"h": 8, | |
"w": 24, | |
"x": 0, | |
"y": 63 | |
}, | |
"hiddenSeries": false, | |
"id": 19, | |
"legend": { | |
"avg": false, | |
"current": false, | |
"max": false, | |
"min": false, | |
"show": true, | |
"total": false, | |
"values": false | |
}, | |
"lines": true, | |
"linewidth": 1, | |
"nullPointMode": "null", | |
"options": { | |
"dataLinks": [] | |
}, | |
"percentage": false, | |
"pointradius": 2, | |
"points": false, | |
"renderer": "flot", | |
"seriesOverrides": [], | |
"spaceLength": 10, | |
"stack": false, | |
"steppedLine": false, | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"periods": 7, | |
"query": "$rate(avg(arrayElement(upstream_response_time,1)) as upstream_response_time) FROM $table", | |
"queryType": "TimeShift", | |
"rawQuery": "SELECT t, upstream_response_time/runningDifference(t/1000) upstream_response_timeRate FROM ( SELECT (intDiv(toUInt32(event_datetime), 15) * 15) * 1000 AS t, avg(arrayElement(upstream_response_time, 1)) as upstream_response_time FROM nginx.access_log WHERE event_date >= toDate(1582087607) AND event_datetime >= toDateTime(1582087607) GROUP BY t ORDER BY t)", | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false, | |
"timeshiftUnit": "days" | |
} | |
], | |
"thresholds": [], | |
"timeFrom": null, | |
"timeRegions": [], | |
"timeShift": null, | |
"title": "Upstream response time", | |
"tooltip": { | |
"shared": true, | |
"sort": 0, | |
"value_type": "individual" | |
}, | |
"type": "graph", | |
"xaxis": { | |
"buckets": null, | |
"mode": "time", | |
"name": null, | |
"show": true, | |
"values": [] | |
}, | |
"yaxes": [ | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
}, | |
{ | |
"format": "short", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
} | |
], | |
"yaxis": { | |
"align": false, | |
"alignLevel": null | |
} | |
}, | |
{ | |
"columns": [], | |
"datasource": "clickhouse-nginx-log-collector", | |
"fontSize": "100%", | |
"gridPos": { | |
"h": 8, | |
"w": 24, | |
"x": 0, | |
"y": 71 | |
}, | |
"id": 12, | |
"options": {}, | |
"pageSize": null, | |
"pluginVersion": "6.5.2", | |
"showHeader": true, | |
"sort": { | |
"col": 0, | |
"desc": true | |
}, | |
"styles": [ | |
{ | |
"alias": "Time", | |
"dateFormat": "YYYY-MM-DD HH:mm:ss", | |
"pattern": "Time", | |
"type": "date" | |
}, | |
{ | |
"alias": "", | |
"colorMode": null, | |
"colors": [ | |
"rgba(245, 54, 54, 0.9)", | |
"rgba(237, 129, 40, 0.89)", | |
"rgba(50, 172, 45, 0.97)" | |
], | |
"decimals": 2, | |
"pattern": "/.*/", | |
"thresholds": [], | |
"type": "number", | |
"unit": "short" | |
} | |
], | |
"targets": [ | |
{ | |
"database": "nginx", | |
"dateColDataType": "event_date", | |
"dateLoading": false, | |
"dateTimeColDataType": "event_datetime", | |
"dateTimeType": "DATETIME", | |
"datetimeLoading": false, | |
"format": "time_series", | |
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | |
"hide": false, | |
"interval": "15s", | |
"intervalFactor": 1, | |
"query": "$columns(status, count(*) as c) from $table WHERE $timeFilter", | |
"rawQuery": false, | |
"refId": "A", | |
"round": "0s", | |
"table": "access_log", | |
"tableLoading": false | |
} | |
], | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "Count Status for all vhost", | |
"transform": "timeseries_to_columns", | |
"type": "table" | |
} | |
], | |
"refresh": "10s", | |
"schemaVersion": 21, | |
"style": "dark", | |
"tags": [], | |
"templating": { | |
"list": [ | |
{ | |
"current": { | |
"selected": false, | |
"text": "nginx.access_log", | |
"value": "nginx.access_log" | |
}, | |
"hide": 2, | |
"label": null, | |
"name": "table", | |
"options": [ | |
{ | |
"selected": true, | |
"text": "nginx.access_log", | |
"value": "nginx.access_log" | |
} | |
], | |
"query": "nginx.access_log", | |
"skipUrlSync": false, | |
"type": "constant" | |
} | |
] | |
}, | |
"time": { | |
"from": "now-1h", | |
"to": "now" | |
}, | |
"timepicker": { | |
"refresh_intervals": [ | |
"5s", | |
"10s", | |
"30s", | |
"1m", | |
"5m", | |
"15m", | |
"30m", | |
"1h", | |
"2h", | |
"1d" | |
] | |
}, | |
"timezone": "", | |
"title": "nginx-log-collector", | |
"uid": "YjUXgyEWz", | |
"version": 48 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment