- 新しいPanelを追加し、可視化方法をTableにする
- Inspect → Panel JSON でJSONの設定画面を開く
- Top_Slow_Endpoint.jsonの内容を貼り付ける
- DatasourceのID
<Your Datasource ID>を自分の環境のものに置き換える - アクセスログのファイル名
<Your Logfile Name>を自分の環境のものに置き換える
- Grafana v8.3.4 (a551d74b11)
| { | |
| "id": 2, | |
| "gridPos": { | |
| "h": 29, | |
| "w": 11, | |
| "x": 0, | |
| "y": 0 | |
| }, | |
| "type": "table", | |
| "title": "Panel Title", | |
| "transformations": [ | |
| { | |
| "id": "labelsToFields", | |
| "options": {} | |
| }, | |
| { | |
| "id": "merge", | |
| "options": {} | |
| }, | |
| { | |
| "id": "sortBy", | |
| "options": { | |
| "fields": {}, | |
| "sort": [ | |
| { | |
| "field": "request_time", | |
| "desc": true | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "id": "organize", | |
| "options": { | |
| "excludeByName": { | |
| "Value": true, | |
| "body_bytes_send": true, | |
| "country": true, | |
| "filename": true, | |
| "forwardedfor": true, | |
| "id": true, | |
| "job": true, | |
| "line": true, | |
| "referer": true, | |
| "remote_addr": true, | |
| "remote_port": true, | |
| "server_protocol": true, | |
| "time": true, | |
| "ts": true, | |
| "tsNs": true, | |
| "useragent": true | |
| }, | |
| "indexByName": { | |
| "body_bytes_send": 12, | |
| "country": 14, | |
| "filename": 10, | |
| "forwardedfor": 11, | |
| "id": 17, | |
| "job": 7, | |
| "line": 16, | |
| "referer": 8, | |
| "remote_addr": 9, | |
| "remote_port": 15, | |
| "request_method": 1, | |
| "request_time": 5, | |
| "request_uri": 2, | |
| "server_protocol": 3, | |
| "status": 4, | |
| "time": 0, | |
| "ts": 6, | |
| "tsNs": 18, | |
| "useragent": 13 | |
| }, | |
| "renameByName": {} | |
| } | |
| } | |
| ], | |
| "datasource": { | |
| "type": "loki", | |
| "uid": "Q-v4kTI7z" | |
| }, | |
| "pluginVersion": "8.3.4", | |
| "fieldConfig": { | |
| "defaults": { | |
| "custom": { | |
| "align": "auto", | |
| "displayMode": "auto" | |
| }, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "red", | |
| "value": 80 | |
| } | |
| ] | |
| }, | |
| "mappings": [], | |
| "color": { | |
| "mode": "thresholds" | |
| } | |
| }, | |
| "overrides": [ | |
| { | |
| "matcher": { | |
| "id": "byName", | |
| "options": "request_time" | |
| }, | |
| "properties": [ | |
| { | |
| "id": "thresholds", | |
| "value": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "#EAB839", | |
| "value": 0.5 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 1 | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "id": "custom.displayMode", | |
| "value": "color-text" | |
| } | |
| ] | |
| }, | |
| { | |
| "matcher": { | |
| "id": "byName", | |
| "options": "request_uri" | |
| }, | |
| "properties": [ | |
| { | |
| "id": "custom.minWidth", | |
| "value": 600 | |
| } | |
| ] | |
| }, | |
| { | |
| "matcher": { | |
| "id": "byName", | |
| "options": "time" | |
| }, | |
| "properties": [ | |
| { | |
| "id": "custom.width", | |
| "value": 267 | |
| } | |
| ] | |
| }, | |
| { | |
| "matcher": { | |
| "id": "byName", | |
| "options": "status" | |
| }, | |
| "properties": [ | |
| { | |
| "id": "custom.displayMode", | |
| "value": "color-text" | |
| }, | |
| { | |
| "id": "thresholds", | |
| "value": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": null | |
| }, | |
| { | |
| "color": "yellow", | |
| "value": 400 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 500 | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "options": { | |
| "showHeader": true, | |
| "footer": { | |
| "show": false, | |
| "reducer": [ | |
| "sum" | |
| ], | |
| "fields": "" | |
| } | |
| }, | |
| "targets": [ | |
| { | |
| "datasource": { | |
| "type": "loki", | |
| "uid": "<Your Datasource ID>" | |
| }, | |
| "expr": "{filename=\"<Your Logfile Name>\"}", | |
| "refId": "A" | |
| } | |
| ] | |
| } |