Version: github.com/prometheus/client_golang v1.5.1
Code:
import (
"github.com/prometheus/client_golang/prometheus/push"
"github.com/prometheus/client_golang/prometheus"
)
pusher := push.New(
"http://localhost:9091",
"foo-job",
).Gatherer(prometheus.DefaultGatherer)
if err := pusher.Push(); err != nil {
fmt.Println(err)
}
Error:
unexpected status code 400 while pushing to http://localhost:9091/metrics/job/foo-job: text format parsing error in line 1: invalid metric name
Version: github.com/prometheus/client_golang v1.5.1
Code:
Error: