forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyntect_server.go
84 lines (83 loc) · 3.19 KB
/
syntect_server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package main
func SyntectServer() *Container {
return &Container{
Name: "syntect-server",
Title: "Syntect Server",
Description: "Handles syntax highlighting for code files.",
Groups: []Group{
{
Title: "General",
Rows: []Row{
{
{
Name: "syntax_highlighting_errors",
Description: "syntax highlighting errors every 5m",
Query: `sum(increase(src_syntax_highlighting_requests{status="error"}[5m]))`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 5},
PanelOptions: PanelOptions().LegendFormat("error"),
},
{
Name: "syntax_highlighting_panics",
Description: "syntax highlighting panics every 5m",
Query: `sum(increase(src_syntax_highlighting_requests{status="panic"}[5m]))`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 5},
PanelOptions: PanelOptions().LegendFormat("panic"),
},
},
{
{
Name: "syntax_highlighting_timeouts",
Description: "syntax highlighting timeouts every 5m",
Query: `sum(increase(src_syntax_highlighting_requests{status="timeout"}[5m]))`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 5},
PanelOptions: PanelOptions().LegendFormat("timeout"),
},
{
Name: "syntax_highlighting_worker_deaths",
Description: "syntax highlighter worker deaths every 5m",
Query: `sum(increase(src_syntax_highlighting_requests{status="hss_worker_timeout"}[5m]))`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 1},
PanelOptions: PanelOptions().LegendFormat("worker death"),
},
},
},
},
{
Title: "Container monitoring (not available on k8s or server)",
Hidden: true,
Rows: []Row{
{
{
Name: "container_restarts",
Description: "container restarts every 5m by instance (not available on k8s or server)",
Query: `increase(cadvisor_container_restart_count{name=~".*syntect-server.*"}[5m])`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 1},
PanelOptions: PanelOptions().LegendFormat("{{name}}"),
},
{
Name: "container_memory_usage",
Description: "container memory usage by instance (not available on k8s or server)",
Query: `cadvisor_container_memory_usage_percentage_total{name=~".*syntect-server.*"}`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 90},
PanelOptions: PanelOptions().LegendFormat("{{name}}").Unit(Percentage),
},
{
Name: "container_cpu_usage",
Description: "container cpu usage total (5m average) across all cores by instance (not available on k8s or server)",
Query: `cadvisor_container_cpu_usage_percentage_total{name=~".*syntect-server.*"}`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 90},
PanelOptions: PanelOptions().LegendFormat("{{name}}").Unit(Percentage),
},
},
},
},
},
}
}