You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can go-metrics be used with Prometheus? The farthest I came is:
package main
import (
"net/http"
"time"
"github.com/armon/go-metrics"
"github.com/armon/go-metrics/prometheus"
)
func main() {
sink, _ := prometheus.NewPrometheusSink()
m, err := metrics.NewGlobal(metrics.DefaultConfig("goTest"), sink)
if err != nil {
panic(err)
}
go func() {
for {
m.IncrCounter([]string{"requestCounter"}, 1)
time.Sleep(time.Second)
}
}()
select {}
}
Some parts are missing like setting up an HTTP handler, HTTP server, etc ... And I don't know how to enable Prometheus server to scrape this. I've looked at the source code and I have a feeling that something is missing.
The text was updated successfully, but these errors were encountered:
How can go-metrics be used with Prometheus? The farthest I came is:
Some parts are missing like setting up an HTTP handler, HTTP server, etc ... And I don't know how to enable Prometheus server to scrape this. I've looked at the source code and I have a feeling that something is missing.
The text was updated successfully, but these errors were encountered: