fix prometheus metric format
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
2371349e1f
commit
ad6088c5f3
4
main.go
4
main.go
|
@ -64,9 +64,9 @@ func NewCounter() *Counter {
|
||||||
func (c *Counter) MetricsHandler(w http.ResponseWriter, r *http.Request) {
|
func (c *Counter) MetricsHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Add("Content-Type", "text/plain")
|
w.Header().Add("Content-Type", "text/plain")
|
||||||
for i, name := range c.names {
|
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() {
|
func (c *Counter) ScanStdin() {
|
||||||
|
|
Loading…
Reference in New Issue