From ad6088c5f3c8a6ef09197d5375593f449f6bc8bf Mon Sep 17 00:00:00 2001 From: Stefan Schwarz Date: Mon, 28 Dec 2020 03:16:42 +0100 Subject: [PATCH] fix prometheus metric format --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 7637e32..8668cef 100644 --- a/main.go +++ b/main.go @@ -64,9 +64,9 @@ func NewCounter() *Counter { func (c *Counter) MetricsHandler(w http.ResponseWriter, r *http.Request) { w.Header().Add("Content-Type", "text/plain") for i, name := range c.names { - fmt.Fprintf(w, "rc3_stream_count[name=%q] %d\n", name, c.counters[i]) + fmt.Fprintf(w, "rc3_stream_count{name=%q} %d\n", name, c.counters[i]) } - fmt.Fprintf(w, "rc3_stream_current[name=\"%d\"] 1\n", c.current) + fmt.Fprintf(w, "rc3_stream_current{name=\"%d\"} 1\n", c.current) } func (c *Counter) ScanStdin() {