{ "dashboard": { "title": "Spring Boot Application Metrics", "tags": ["spring-boot", "todo-app"], "timezone": "browser", "panels": [ { "id": 1, "title": "HTTP Request Rate", "type": "graph", "gridPos": {"x": 0, "y": 0, "w": 12, "h": 8}, "targets": [ { "expr": "rate(http_server_requests_seconds_count{application=\"todo\"}[1m])", "legendFormat": "{{method}} {{uri}} - {{status}}" } ], "yaxes": [ {"format": "reqps", "label": "Requests/sec"}, {"format": "short"} ] }, { "id": 2, "title": "HTTP Request Duration (p95, p99)", "type": "graph", "gridPos": {"x": 12, "y": 0, "w": 12, "h": 8}, "targets": [ { "expr": "histogram_quantile(0.95, sum(rate(http_server_requests_seconds_bucket{application=\"todo\"}[5m])) by (le, uri))", "legendFormat": "p95 - {{uri}}" }, { "expr": "histogram_quantile(0.99, sum(rate(http_server_requests_seconds_bucket{application=\"todo\"}[5m])) by (le, uri))", "legendFormat": "p99 - {{uri}}" } ], "yaxes": [ {"format": "s", "label": "Duration"}, {"format": "short"} ] }, { "id": 3, "title": "HTTP Status Codes", "type": "graph", "gridPos": {"x": 0, "y": 8, "w": 12, "h": 8}, "targets": [ { "expr": "sum(rate(http_server_requests_seconds_count{application=\"todo\"}[1m])) by (status)", "legendFormat": "{{status}}" } ], "yaxes": [ {"format": "reqps"}, {"format": "short"} ] }, { "id": 4, "title": "JVM Memory Used", "type": "graph", "gridPos": {"x": 12, "y": 8, "w": 12, "h": 8}, "targets": [ { "expr": "jvm_memory_used_bytes{application=\"todo\", area=\"heap\"}", "legendFormat": "Heap" }, { "expr": "jvm_memory_used_bytes{application=\"todo\", area=\"nonheap\"}", "legendFormat": "Non-Heap" }, { "expr": "jvm_memory_max_bytes{application=\"todo\", area=\"heap\"}", "legendFormat": "Heap Max" } ], "yaxes": [ {"format": "bytes"}, {"format": "short"} ] }, { "id": 5, "title": "Database Connection Pool", "type": "graph", "gridPos": {"x": 0, "y": 16, "w": 12, "h": 8}, "targets": [ { "expr": "hikaricp_connections_active{application=\"todo\"}", "legendFormat": "Active" }, { "expr": "hikaricp_connections_idle{application=\"todo\"}", "legendFormat": "Idle" }, { "expr": "hikaricp_connections{application=\"todo\"}", "legendFormat": "Total" }, { "expr": "hikaricp_connections_max{application=\"todo\"}", "legendFormat": "Max" } ], "yaxes": [ {"format": "short", "label": "Connections"}, {"format": "short"} ] }, { "id": 6, "title": "Database Connection Acquire Time", "type": "graph", "gridPos": {"x": 12, "y": 16, "w": 12, "h": 8}, "targets": [ { "expr": "rate(hikaricp_connections_acquire_seconds_sum{application=\"todo\"}[1m]) / rate(hikaricp_connections_acquire_seconds_count{application=\"todo\"}[1m])", "legendFormat": "Avg Acquire Time" } ], "yaxes": [ {"format": "s"}, {"format": "short"} ] }, { "id": 7, "title": "JVM Threads", "type": "graph", "gridPos": {"x": 0, "y": 24, "w": 8, "h": 8}, "targets": [ { "expr": "jvm_threads_live_threads{application=\"todo\"}", "legendFormat": "Live" }, { "expr": "jvm_threads_daemon_threads{application=\"todo\"}", "legendFormat": "Daemon" }, { "expr": "jvm_threads_peak_threads{application=\"todo\"}", "legendFormat": "Peak" } ], "yaxes": [ {"format": "short", "label": "Threads"}, {"format": "short"} ] }, { "id": 8, "title": "GC Pause Time", "type": "graph", "gridPos": {"x": 8, "y": 24, "w": 8, "h": 8}, "targets": [ { "expr": "rate(jvm_gc_pause_seconds_sum{application=\"todo\"}[1m])", "legendFormat": "{{action}} - {{cause}}" } ], "yaxes": [ {"format": "s", "label": "GC Time"}, {"format": "short"} ] }, { "id": 9, "title": "System CPU Usage", "type": "graph", "gridPos": {"x": 16, "y": 24, "w": 8, "h": 8}, "targets": [ { "expr": "system_cpu_usage{application=\"todo\"}", "legendFormat": "System" }, { "expr": "process_cpu_usage{application=\"todo\"}", "legendFormat": "Process" } ], "yaxes": [ {"format": "percentunit", "label": "CPU"}, {"format": "short"} ] } ], "refresh": "5s", "time": { "from": "now-15m", "to": "now" } }, "overwrite": true }