1+ {
2+ "annotations" : { "list" : [] },
3+ "editable" : true ,
4+ "panels" : [
5+ {
6+ "type" : " stat" ,
7+ "title" : " Total Books" ,
8+ "datasource" : " Prometheus" ,
9+ "targets" : [
10+ { "expr" : " library_books_total" , "refId" : " A" }
11+ ],
12+ "gridPos" : { "h" : 5 , "w" : 6 , "x" : 0 , "y" : 0 }
13+ },
14+ {
15+ "type" : " timeseries" ,
16+ "title" : " Requests per Second" ,
17+ "datasource" : " Prometheus" ,
18+ "targets" : [
19+ {
20+ "expr" : " rate(http_server_requests_seconds_count{uri!=\" /actuator/prometheus\" }[1m])" ,
21+ "legendFormat" : " RPS" ,
22+ "refId" : " A"
23+ }
24+ ],
25+ "gridPos" : { "h" : 8 , "w" : 12 , "x" : 6 , "y" : 0 }
26+ },
27+ {
28+ "type" : " timeseries" ,
29+ "title" : " Requests by Endpoint" ,
30+ "datasource" : " Prometheus" ,
31+ "targets" : [
32+ {
33+ "expr" : " rate(http_server_requests_seconds_count{uri!=\" /actuator/prometheus\" }[1m])" ,
34+ "legendFormat" : " {{uri}}" ,
35+ "refId" : " A"
36+ }
37+ ],
38+ "gridPos" : { "h" : 8 , "w" : 12 , "x" : 0 , "y" : 5 }
39+ },
40+ {
41+ "type" : " timeseries" ,
42+ "title" : " 5xx Errors per Second" ,
43+ "datasource" : " Prometheus" ,
44+ "targets" : [
45+ {
46+ "expr" : " rate(http_server_requests_seconds_count{status=~\" 5..\" }[1m])" ,
47+ "legendFormat" : " 5xx" ,
48+ "refId" : " A"
49+ }
50+ ],
51+ "gridPos" : { "h" : 8 , "w" : 12 , "x" : 12 , "y" : 5 }
52+ },
53+ {
54+ "type" : " timeseries" ,
55+ "title" : " Average Response Time (ms)" ,
56+ "datasource" : " Prometheus" ,
57+ "targets" : [
58+ {
59+ "expr" : " rate(http_server_requests_seconds_sum[1m]) / rate(http_server_requests_seconds_count[1m]) * 1000" ,
60+ "legendFormat" : " Avg Response" ,
61+ "refId" : " A"
62+ }
63+ ],
64+ "gridPos" : { "h" : 8 , "w" : 12 , "x" : 0 , "y" : 13 }
65+ },
66+ {
67+ "type" : " stat" ,
68+ "title" : " Error Rate (%)" ,
69+ "datasource" : " Prometheus" ,
70+ "targets" : [
71+ {
72+ "expr" : " (rate(http_server_requests_seconds_count{status=~\" 5..\" }[1m]) / rate(http_server_requests_seconds_count[1m])) * 100" ,
73+ "refId" : " A"
74+ }
75+ ],
76+ "gridPos" : { "h" : 5 , "w" : 6 , "x" : 12 , "y" : 13 }
77+ }
78+ ],
79+ "refresh" : " 5s" ,
80+ "schemaVersion" : 38 ,
81+ "style" : " dark" ,
82+ "tags" : [" library" , " observability" ],
83+ "time" : { "from" : " now-15m" , "to" : " now" },
84+ "title" : " Library API - Production Dashboard" ,
85+ "version" : 1
86+ }
0 commit comments