forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit_server.go
103 lines (102 loc) · 4.02 KB
/
git_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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package main
func GitServer() *Container {
return &Container{
Name: "gitserver",
Title: "Git Server",
Description: "Stores, manages, and operates Git repositories.",
Groups: []Group{
{
Title: "General",
Rows: []Row{
{
{
Name: "disk_space_remaining",
Description: "disk space remaining by instance",
Query: `(src_gitserver_disk_space_available / src_gitserver_disk_space_total) * 100`,
DataMayNotExist: true,
Warning: Alert{LessOrEqual: 25},
Critical: Alert{LessOrEqual: 15},
PanelOptions: PanelOptions().LegendFormat("{{instance}}").Unit(Percentage),
},
{
Name: "running_git_commands",
Description: "running git commands (signals load)",
Query: "max(src_gitserver_exec_running)",
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 50},
Critical: Alert{GreaterOrEqual: 100},
PanelOptions: PanelOptions().LegendFormat("running commands"),
},
}, {
{
Name: "repository_clone_queue_size",
Description: "repository clone queue size",
Query: "sum(src_gitserver_clone_queue)",
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 25},
PanelOptions: PanelOptions().LegendFormat("queue size"),
},
{
Name: "repository_existence_check_queue_size",
Description: "repository existence check queue size",
Query: "sum(src_gitserver_lsremote_queue)",
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 25},
PanelOptions: PanelOptions().LegendFormat("queue size"),
},
}, {
{
Name: "echo_command_duration_test",
Description: "echo command duration test",
Query: "max(src_gitserver_echo_duration_seconds)",
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 1.0},
Critical: Alert{GreaterOrEqual: 2.0},
PanelOptions: PanelOptions().LegendFormat("running commands").Unit(Seconds),
},
{
Name: "frontend_internal_api_error_responses",
Description: "frontend-internal API error responses every 5m by route",
Query: `sum by (category)(increase(src_frontend_internal_request_duration_seconds_count{job="gitserver",code!~"2.."}[5m]))`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 5},
PanelOptions: PanelOptions().LegendFormat("{{category}}"),
},
},
},
},
{
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=~".*gitserver.*"}[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=~".*gitserver.*"}`,
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=~".*gitserver.*"}`,
DataMayNotExist: true,
Warning: Alert{GreaterOrEqual: 90},
PanelOptions: PanelOptions().LegendFormat("{{name}}").Unit(Percentage),
},
},
},
},
},
}
}