Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit 842ef31

Browse files
authored
Merge pull request #6 from from-nibly/jordan/log-http-metric-errors
Log http errors on the metric server
2 parents bcbb4a5 + 6459812 commit 842ef31

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

main.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,22 @@ func main() {
129129
})
130130

131131
http.Handle("/metrics", promhttp.Handler())
132-
go http.ListenAndServe(":8080", nil)
132+
go startMetricsHttp()
133133

134134
// Run the kube valet
135135
kd.Run()
136136
}
137137

138+
func startMetricsHttp() {
139+
for true {
140+
err := http.ListenAndServe(":8080", nil)
141+
if err != nil {
142+
log.Errorf("Metrics server had an error %v", err)
143+
}
144+
time.Sleep(20 * time.Second)
145+
}
146+
}
147+
138148
func getConfig() *rest.Config {
139149
if *inCluster {
140150
config, err := rest.InClusterConfig()

0 commit comments

Comments
 (0)