forked from kaycoinsUSA/sourcegraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub_proxy.go
More file actions
87 lines (85 loc) · 2.74 KB
/
Copy pathgithub_proxy.go
File metadata and controls
87 lines (85 loc) · 2.74 KB
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
package main
import "time"
func GitHubProxy() *Container {
return &Container{
Name: "github-proxy",
Title: "GitHub Proxy",
Description: "Proxies all requests to github.com, keeping track of and managing rate limits.",
Groups: []Group{
{
Title: "GitHub API monitoring",
Rows: []Row{
{
{
Name: "github_core_rate_limit_remaining",
Description: "remaining calls to GitHub before hitting the rate limit",
Query: `src_github_rate_limit_remaining{resource="core"}`,
DataMayNotExist: true,
Critical: Alert().LessOrEqual(500).For(5 * time.Minute),
PanelOptions: PanelOptions().LegendFormat("calls remaining"),
Owner: ObservableOwnerCloud,
PossibleSolutions: `Try restarting the pod to get a different public IP.`,
},
{
Name: "github_search_rate_limit_remaining",
Description: "remaining calls to GitHub search before hitting the rate limit",
Query: `src_github_rate_limit_remaining{resource="search"}`,
DataMayNotExist: true,
Warning: Alert().LessOrEqual(5),
PanelOptions: PanelOptions().LegendFormat("calls remaining"),
Owner: ObservableOwnerCloud,
PossibleSolutions: `Try restarting the pod to get a different public IP.`,
},
},
},
},
{
Title: "Container monitoring (not available on server)",
Hidden: true,
Rows: []Row{
{
sharedContainerCPUUsage("github-proxy", ObservableOwnerCloud),
sharedContainerMemoryUsage("github-proxy", ObservableOwnerCloud),
},
{
sharedContainerRestarts("github-proxy", ObservableOwnerCloud),
sharedContainerFsInodes("github-proxy", ObservableOwnerCloud),
},
},
},
{
Title: "Provisioning indicators (not available on server)",
Hidden: true,
Rows: []Row{
{
sharedProvisioningCPUUsageLongTerm("github-proxy", ObservableOwnerCloud),
sharedProvisioningMemoryUsageLongTerm("github-proxy", ObservableOwnerCloud),
},
{
sharedProvisioningCPUUsageShortTerm("github-proxy", ObservableOwnerCloud),
sharedProvisioningMemoryUsageShortTerm("github-proxy", ObservableOwnerCloud),
},
},
},
{
Title: "Golang runtime monitoring",
Hidden: true,
Rows: []Row{
{
sharedGoGoroutines("github-proxy", ObservableOwnerCloud),
sharedGoGcDuration("github-proxy", ObservableOwnerCloud),
},
},
},
{
Title: "Kubernetes monitoring (ignore if using Docker Compose or server)",
Hidden: true,
Rows: []Row{
{
sharedKubernetesPodsAvailable("github-proxy", ObservableOwnerCloud),
},
},
},
},
}
}