The process is as follows:
I push the data generated by two servers to two pushgateway instances in
turn (the IP of the server is used as the grouping key),
and then use Prometheus to pull the gateway.
The problem is that the data on the server is always lost intermittently.
The return value of the push method is checked, and there is no error.
And I see the data on the pushgateway page.
Sometimes the last pushed time is the time when the data drops to 0,
sometimes it's the normal current time
The screenshots of the next two pushgateway pages are only seconds apart
[image: 1.png] <about:invalid#zClosurez>
[image: 2.png] <about:invalid#zClosurez>
Part of push codes as follows:
mymetrics := prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "req_monitor",
Help: "req monitor ",
},
[]string{"code", "method"},
)
reg := prometheus.NewRegistry()
reg.MustRegister(mymetrics)
pusher := push.New(url, "my_job").Gatherer(reg)
pusher.Grouping("instance", gLocalIP)
err := pusher.Add()
if err != nil{
fmt.println("push error:%s",err)
}
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/7becb40c-6b2c-4792-883a-e61759a955ee%40googlegroups.com.