I am trying to set the proxy_url param on a scrape config job that uses 
azure_sd_configs for azure service discovery.  It appears that the azure 
service discovery module does not respect this setting from the 
scrape_config block as documented 
here: 
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config.

It is my belief after perusing the code, that the cause of the problem is 
this service discoverer uses https://github.com/Azure/go-autorest instead 
of net/http directly, thus I think the proxy_url config setting is "lost".

I have proven my config works when it is in a prometheus that is *NOT* 
behind our corporate proxy (with no proxy_url value set atall of course), 
but moving the config to a prometheus instance behind the corp proxy and 
setting proxy_url does not work.  The only symptom is after 7 minutes, an 
error message appears in the logs:
level=error ts=2020-11-06T21:00:31.200Z caller=refresh.go:98 
component="discovery manager scrape" discovery=azure msg="Unable to refresh 
target groups" err="could not get virtual machines: could not list virtual 
machines: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the 
Token for request to 
https://management.azure.com/subscriptions/xxxxxx/providers/Microsoft.Compute/virtualMachines?api-version=2018-10-01:
 
StatusCode=0 -- Original Error: adal: Failed to execute the refresh 
request. Error = 'Post 
\"https://login.microsoftonline.com/xxxxx/oauth2/token?api-version=1.0\": 
read tcp <ipaddresses>: read: connection reset by peer'"
This is a sign that the net connection to authenticate to microsoft failed 
to navigate the proxy.

Does anyone have any experience with this?

Can anyone confirm if this is a bug?

-- 
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/7d0cc524-b9bb-4b13-9c8f-88554c19fc4cn%40googlegroups.com.

Reply via email to