mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 11:06:28 +00:00
70 lines
3.0 KiB
JSON
70 lines
3.0 KiB
JSON
{
|
|
"__inputs": [
|
|
{ "name": "DS_PROMETHEUS", "label": "Prometheus", "type": "datasource", "pluginId": "prometheus", "pluginName": "Prometheus" },
|
|
{ "name": "DS_LOKI", "label": "Loki", "type": "datasource", "pluginId": "loki", "pluginName": "Loki" }
|
|
],
|
|
"uid": "topup-observability",
|
|
"title": "Online TopUp - Latensi dan transaksi",
|
|
"schemaVersion": 39,
|
|
"version": 1,
|
|
"time": { "from": "now-1h", "to": "now" },
|
|
"templating": {
|
|
"list": [
|
|
{ "name": "prom_app", "label": "PROM_APP", "type": "textbox", "query": "topuponline", "current": { "text": "topuponline", "value": "topuponline" } },
|
|
{ "name": "trx_id", "label": "ID transaksi HSM", "type": "textbox", "query": "", "current": { "text": "", "value": "" } },
|
|
{ "name": "request_id", "label": "X-Request-Id", "type": "textbox", "query": "", "current": { "text": "", "value": "" } },
|
|
{ "name": "min_ms", "label": "Durasi minimum (ms)", "type": "textbox", "query": "0", "current": { "text": "0", "value": "0" } }
|
|
]
|
|
},
|
|
"panels": [
|
|
{
|
|
"id": 1,
|
|
"title": "Latensi p95 per endpoint",
|
|
"type": "timeseries",
|
|
"datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
|
|
"gridPos": { "h": 9, "w": 12, "x": 0, "y": 0 },
|
|
"fieldConfig": { "defaults": { "unit": "ms" }, "overrides": [] },
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "histogram_quantile(0.95, sum by (le, route) (rate(topuponline_response_time_bucket{app=\"$prom_app\"}[$__rate_interval])))",
|
|
"legendFormat": "{{route}}",
|
|
"range": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 2,
|
|
"title": "Rata-rata durasi per endpoint",
|
|
"type": "timeseries",
|
|
"datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
|
|
"gridPos": { "h": 9, "w": 12, "x": 12, "y": 0 },
|
|
"fieldConfig": { "defaults": { "unit": "ms" }, "overrides": [] },
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"expr": "sum by (route) (rate(topuponline_response_time_sum{app=\"$prom_app\"}[$__rate_interval])) / sum by (route) (rate(topuponline_response_time_count{app=\"$prom_app\"}[$__rate_interval]))",
|
|
"legendFormat": "{{route}}",
|
|
"range": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 3,
|
|
"title": "Durasi dan transaksi per request",
|
|
"type": "logs",
|
|
"datasource": { "type": "loki", "uid": "${DS_LOKI}" },
|
|
"gridPos": { "h": 13, "w": 24, "x": 0, "y": 9 },
|
|
"options": { "showTime": true, "showLogDetails": true, "sortOrder": "Descending", "wrapLogMessage": true },
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"queryType": "range",
|
|
"maxLines": 500,
|
|
"expr": "{app=\"topuponline\"} |= \"http_response\" | json | event=\"http_response\" | trx_id=~`(?i).*${trx_id:regex}.*` | request_id=~`(?i).*${request_id:regex}.*` | response_time_ms >= ${min_ms:raw} | __error__=\"\" | line_format `{{.route}} {{.status_code}} {{.response_time_ms}}ms trx_id={{.trx_id}} request_id={{.request_id}}`"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|