Skip to content

Commit a91e99d

Browse files
authored
create dashboard for sign2 (#81)
* dashboard for sign2 * add uptime metric * misspelled container bruh * remove /metrics from endpoint hits + specify time units * fix all dashboards for sign2 * use regex to omit endpoints * amend regex parsing * add job name to all metrics lolz
1 parent be57e48 commit a91e99d

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
from grafanalib.core import Dashboard, Templating, Template, TimeSeries, Target, GridPos
2+
from grafanalib.formatunits import SECONDS
3+
4+
from wrapper import SceGrafanalibWrapper, ExpressionAndLegendPair
5+
6+
wrapper = SceGrafanalibWrapper(title='sign2')
7+
8+
wrapper.AddPanel(
9+
title="Sign last updated",
10+
queries=[
11+
ExpressionAndLegendPair(
12+
'time() - sign_last_updated{job="sce-sign2"}',
13+
),
14+
],
15+
unit=SECONDS
16+
)
17+
18+
wrapper.AddPanel(
19+
title="Sign update error",
20+
queries=[
21+
ExpressionAndLegendPair(
22+
'sign_update_error{job="sce-sign2"}'
23+
)
24+
],
25+
)
26+
27+
wrapper.AddPanel(
28+
title="LeetCode API Error",
29+
queries=[
30+
ExpressionAndLegendPair(
31+
'leetcode_api_error{job="sce-sign2"}'
32+
)
33+
],
34+
)
35+
36+
wrapper.AddPanel(
37+
title="Endpoint hits",
38+
queries=[
39+
ExpressionAndLegendPair(
40+
'endpoint_hits_total{job="sce-sign2", path!~"/metrics|.*[.].*"}',
41+
"{{code}} {{path}}",
42+
)
43+
],
44+
)
45+
46+
wrapper.AddPanel(
47+
title="LeetCode API Response Codes",
48+
queries=[
49+
ExpressionAndLegendPair(
50+
'leetcode_api_response_codes_total{job="sce-sign2"}',
51+
"{{code}}",
52+
)
53+
],
54+
)
55+
56+
wrapper.AddPanel(
57+
title="LeetCode API latency",
58+
queries=[
59+
ExpressionAndLegendPair(
60+
'leetcode_api_latency_sum / leetcode_api_latency_count{job="sce-sign2"}',
61+
)
62+
],
63+
)
64+
65+
wrapper.AddPanel(
66+
title="Container Uptime",
67+
queries=[
68+
ExpressionAndLegendPair(
69+
'time() - process_start_time_seconds{job="sce-sign2"}',
70+
)
71+
],
72+
unit=SECONDS
73+
)
74+
75+
dashboard = wrapper.Render()

0 commit comments

Comments
 (0)