Files
java-ai-slop/grafana-dashboard-db.json
roma-dxunvrs 91d54f4ef0 fix: correct Grafana dashboard JSON format
- Remove dashboard wrapper from JSON files
- Dashboards now load successfully
- Update monitoring guide with correct instructions
2026-10-03 22:59:11 +03:00

234 lines
5.7 KiB
JSON

{
"title": "PostgreSQL & HikariCP Monitoring",
"tags": ["database", "postgres", "hikaricp"],
"timezone": "browser",
"schemaVersion": 16,
"version": 0,
"refresh": "5s",
"panels": [
{
"id": 1,
"title": "Connection Pool Status - Active",
"type": "stat",
"gridPos": {"x": 0, "y": 0, "w": 6, "h": 4},
"targets": [
{
"expr": "hikaricp_connections_active{application=\"todo\"}",
"legendFormat": "Active",
"refId": "A"
}
],
"options": {
"colorMode": "value",
"graphMode": "area"
},
"fieldConfig": {
"defaults": {
"unit": "short"
}
}
},
{
"id": 2,
"title": "Idle Connections",
"type": "stat",
"gridPos": {"x": 6, "y": 0, "w": 6, "h": 4},
"targets": [
{
"expr": "hikaricp_connections_idle{application=\"todo\"}",
"legendFormat": "Idle",
"refId": "A"
}
],
"options": {
"colorMode": "value",
"graphMode": "area"
},
"fieldConfig": {
"defaults": {
"unit": "short"
}
}
},
{
"id": 3,
"title": "Total Connections",
"type": "stat",
"gridPos": {"x": 12, "y": 0, "w": 6, "h": 4},
"targets": [
{
"expr": "hikaricp_connections{application=\"todo\"}",
"legendFormat": "Total",
"refId": "A"
}
],
"options": {
"colorMode": "value",
"graphMode": "area"
},
"fieldConfig": {
"defaults": {
"unit": "short"
}
}
},
{
"id": 4,
"title": "Pending Threads",
"type": "stat",
"gridPos": {"x": 18, "y": 0, "w": 6, "h": 4},
"targets": [
{
"expr": "hikaricp_connections_pending{application=\"todo\"}",
"legendFormat": "Pending",
"refId": "A"
}
],
"options": {
"colorMode": "value",
"graphMode": "area"
},
"fieldConfig": {
"defaults": {
"unit": "short"
}
}
},
{
"id": 5,
"title": "Connection Pool Utilization (%)",
"type": "timeseries",
"gridPos": {"x": 0, "y": 4, "w": 12, "h": 8},
"targets": [
{
"expr": "(hikaricp_connections_active{application=\"todo\"} / hikaricp_connections_max{application=\"todo\"}) * 100",
"legendFormat": "Active %",
"refId": "A"
},
{
"expr": "(hikaricp_connections{application=\"todo\"} / hikaricp_connections_max{application=\"todo\"}) * 100",
"legendFormat": "Total %",
"refId": "B"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"min": 0,
"max": 100,
"custom": {}
}
}
},
{
"id": 6,
"title": "Connection Acquire Time",
"type": "timeseries",
"gridPos": {"x": 12, "y": 4, "w": 12, "h": 8},
"targets": [
{
"expr": "histogram_quantile(0.5, rate(hikaricp_connections_acquire_seconds_bucket{application=\"todo\"}[1m]))",
"legendFormat": "p50",
"refId": "A"
},
{
"expr": "histogram_quantile(0.95, rate(hikaricp_connections_acquire_seconds_bucket{application=\"todo\"}[1m]))",
"legendFormat": "p95",
"refId": "B"
},
{
"expr": "histogram_quantile(0.99, rate(hikaricp_connections_acquire_seconds_bucket{application=\"todo\"}[1m]))",
"legendFormat": "p99",
"refId": "C"
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {}
}
}
},
{
"id": 7,
"title": "Connection Timeout Count",
"type": "timeseries",
"gridPos": {"x": 0, "y": 12, "w": 12, "h": 8},
"targets": [
{
"expr": "rate(hikaricp_connections_timeout_total{application=\"todo\"}[1m])",
"legendFormat": "Timeouts/sec",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {}
}
}
},
{
"id": 8,
"title": "Connection Creation Time",
"type": "timeseries",
"gridPos": {"x": 12, "y": 12, "w": 12, "h": 8},
"targets": [
{
"expr": "rate(hikaricp_connections_creation_seconds_sum{application=\"todo\"}[1m]) / rate(hikaricp_connections_creation_seconds_count{application=\"todo\"}[1m])",
"legendFormat": "Avg Creation Time",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {}
}
}
},
{
"id": 9,
"title": "Connection Usage Time",
"type": "timeseries",
"gridPos": {"x": 0, "y": 20, "w": 12, "h": 8},
"targets": [
{
"expr": "rate(hikaricp_connections_usage_seconds_sum{application=\"todo\"}[1m]) / rate(hikaricp_connections_usage_seconds_count{application=\"todo\"}[1m])",
"legendFormat": "Avg Usage Time",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {}
}
}
},
{
"id": 10,
"title": "Active Connections Timeline",
"type": "timeseries",
"gridPos": {"x": 12, "y": 20, "w": 12, "h": 8},
"targets": [
{
"expr": "hikaricp_connections_active{application=\"todo\"}",
"legendFormat": "Active Connections",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {}
}
}
}
],
"time": {
"from": "now-15m",
"to": "now"
}
}