Background:
- I have a Prometheus process and a Prometheus-PushGateway process in the customer environment
- I have a go process which use Pusher.Push() function to push some customized metrics to the PushGateway and then PushGateway convey it to the Prometheus.
- I don't know how the customer deploy the Prometheus-PushGateway, but they gave me a https's address and I can use curl command to visit like:
curl -H 'Host: upfs-pgw-nm04-a800.glm.ai' -k https://<IP>:9443/metrics
Here it use -k to avoid the permission issue, if cancel it the problem'll appear just like the first problem described below, the condition without -k:enter image description here
Part of the code related to the Push fucntion:
// Ignoring contextual environment pusher := push.New(pushgatewayAddr, jobName).Collector(reg) if err := pusher.Push(); err != nil { uflog.ERROR("reportCapacityToPushgateway error: " + err.Error()) return err }
The API adress: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/push#Pusher.Push
Problem:
Now I encounter a problem during customer testing, see the pic below:enter image description here
I know the Push-Golang package have a HTTPdoer type and guess it can help to skip the client verify from PushGateway but I don't know how to do it ? In other words, how can I use this golang package to Push without the Permission verification ?
I know the Prometheus-PushGateway has a --web.config.file to enable TLS or authentication but I don't know how to config it avoid this problem though I have reviewed this doc from the help info ?https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md
I haven't tried some ways and I expect that there is a way to solve this permission problem, and I hope that best solution is to be on the go-process rather then the Prometheus-PushGateway as customers have deployed the Prometheus and PushGateway, it's not convenient to ask them to do something more.I would be extremely grateful if you can help me solve this problem thx !