From 57396c44e6f4a78e47e5af7b40860ec395790c78 Mon Sep 17 00:00:00 2001 From: Renaud Gaubert Date: Wed, 3 Jun 2020 07:44:32 +0000 Subject: [PATCH] Add handler for root (/) URL Signed-off-by: Renaud Gaubert --- pkg/server.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/server.go b/pkg/server.go index 5db4b5e..2776b7f 100644 --- a/pkg/server.go +++ b/pkg/server.go @@ -40,6 +40,16 @@ func NewMetricsServer(c *Config, metrics chan string) (*MetricsServer, func(), e metrics: "", } + router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(` + GPU Exporter + +

GPU Exporter

+

Metrics

+ + `)) + }) + router.HandleFunc("/health", serverv1.Health) router.HandleFunc("/metrics", serverv1.Metrics)