This repository provides a docker-compose for Go runtime metrics stack on your local computer. It is using influxdb and grafana, it based on the project http://github.com/tevjef/go-runtime-metrics
Start metric stack:
make start
import (
metrics "github.com/tevjef/go-runtime-metrics"
)
func main() {
err := metrics.RunCollector(metrics.DefaultConfig)
if err != nil {
// handle error
}
...
}
you may need to add this to your go.mod: replace gonum.org/v1/gonum => github.com/gonum/gonum v0.9.3
Wait for metrics collection and go to the dashboard Go runtime. If not selected, choose the right measurement
in the dashboard top drop down list.
http://localhost:3000/d/1/go-runtime?orgId=1&from=now-15m&to=now&refresh=5s
When done, stop the metric stack:
make stop