grafana / synthetic-monitoring-agent

Synthetic Monitoring Agent
https://grafana.com/docs/grafana-cloud/how-do-i/synthetic-monitoring/
Apache License 2.0
167 stars 24 forks source link

Allow for a proxy to be set for the synthetics binary #371

Open jamesvarty opened 1 year ago

jamesvarty commented 1 year ago

Our network does not allow for "un-proxied" traffic out to grafanacloud backend from the synthetics agent(private probe) Setting the environment/systemd proxy does not seem to solve the outbound pusher.go traffic, generating the following events.

{"level":"error","program":"synthetic-monitoring-agent","subsystem":"publisher","tenant":<removed>,"error":"sending events: context deadline exceeded","time":1669087903507,"message":"publish events"} {"level":"error","program":"synthetic-monitoring-agent","subsystem":"publisher","tenant":<removed>,"error":"sending timeseries: context deadline exceeded","time":1669087913601,"message":"publish metrics"}

A proxy flag to set the outbound http(s)_proxy should solve this.

mem commented 1 year ago

It should already work. We are using Go's http client, so something like export HTTP_PROXY="http://host:port" should do it. This needs to be set in the environment from which the agent is started.

jamesvarty commented 1 year ago

Thanks for the response @mem, I simply have this running in a docker container with known HTTP(s)_PROXY defined.

Just to be clear the "context deadline exceeded" in the logs is the pusher timing out trying to send the events to synthetic-monitoring-grpc-* correct?