-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Probe fails due to DNS resolution when used with proxy #877
Comments
We are also facing similar issue. Please help in addressing this issue. |
1 similar comment
We are also facing similar issue. Please help in addressing this issue. |
+1 here Im sitting here troubleshooting hitting a health check URL through a squid proxy to test squid. Its failing because the target uses round robin dns. The squid has a whitelist with the dns name in it. Since blackbox is resolving and then querying the IP squid fails. |
This will probably never be fixed. See |
Hello, I think this is a reasonable feature request. It could be build on top of existing pull requests, but the effects of the settings are more than just "skip DNS", it also skips protocol selection, so it would need to be properly documented. |
Maybe it means that we need another probe type, proxy_http instead of http, WDYT ? |
same issue here. any temp fix until this issue will be resolved? |
Same problem here. The issue does not seem to be only related to the proxy parameter. I can see from my configuration that Blackbox resolves all our endpoint to an IP and uses that IP to run the check. For HTTP verification, it adds the host to the header, I guess that’s why it works correctly on simple internal endpoints. But for public endpoints behind dynamic IP (with or without proxy), adding the host won’t make it work (check this ticket for example: #886) I don’t think skipping DNS is an option, this feature is important for Blackbox. But perhaps adding an option to use or not use the IP or DNS name during verification would be a good approach. |
@wikitops I'm missing something... why wouldn't adding a The reason why it performs DNS resolution first and then uses the resolved IP address + Host header is consistency: if we pass the unresolved host name to the HTTP client, it will do resolution a second time, possibly obtaining a different IP address. |
I had this problem too, we use whitelisting in our outbound proxy based on destination hostname. When blackbox_exporter makes an HTTP request, it resolves the hostname to IP and makes the request to the IP which meant the proxy didn't have any idea what URL was originally requested, only the IP. We can't replace the whitelist with a list of IPs instead because things created in AWS aren't guaranteed to always remain on those same IPs (depending on the product). |
We really need this feature too. Instead of wasting time trying to fix the problems with the existing http_proxy probe why not just create an additional probe type like "http_probe_proxy" and have it resolve by name only rather than IP. This way it won't break the other dependencies and could be used as a one-off for these situations until a longer term fix is found. |
The maintainers of this project clearly have no interest in fixing this issue. We've switched to https://github.com/ricoberger/script_exporter to workaround this issue. Using this exporter we can just use |
I already expressed that I would like to have this feature, see #877 (comment) As an open source project, everyone can contribute this feature. |
@ChristianCiach Do you have any examples on how to use script_exporter to check urls and return the same metrics as the normal probe? If you have any example configs for checking a single url that would help me get started. |
Could you please have a look at #944 ? |
Closed by blackbox exporter 0.22.0 and |
i use blackbox exporter version 0.24.0 with proxy_url and always get 403 status code. |
Host operating system: Linux
blackbox_exporter version: 0.19.0
What is the blackbox.yml module config.
What is the prometheus.yml scrape config.
What logging output did you get from adding
&debug=true
to the probe URL?What did you do that produced an error?
I added the proxy in http_probe to hit that specific url.
What did you expect to see?
I expected a 200 response from the http_probe.
What did you see instead?
The probe fails with 403 Forbidden error due to DNS resolution. From the above error logs, I found out that blackbox exporter pod is trying to do dns resolution and using the resolved ip address and port to pass through the proxy-server.
Note: i have replaced the actual DNS Name, IP Address and Proxy server (squid) details for privacy purpose in these logs.
Issue : The probe fails with 403 Forbidden error.
From the above error logs, I found out that blackbox exporter pod is trying to do DNS resolution for the public target (https://www.example.com:1234) and using the resolved ip address and port (https://123.45.67.8:1234) to pass through the squid proxy-server (http://proxy-username:proxy-password@internal-proxy-server:3120).
In our proxy server we only have the DNS url (https://www.example.com:1234) whitelisted and not it's IP Address.
Reason: IP Address keeps changing and the proxy server admins in any org will not add dynamic ip's onto the whitelist due to various reasons.
We tried adding host header (host: https://www.example.com:1234) also as a flag on the blackbox exporter config yaml. However, proxy is not able to recognize that and we continue to get the same error
To resolve this issue, we would request blackbox exporter source code owners/maintainers to add a feature/flag (Eg:- use_proxy_dns: true) to not resolve the DNS into IP Address. It will help various organizations, who are having similar proxy setup and is facing similar issues, so that they dont need to look into any other exporter/monitoring solutions.
The text was updated successfully, but these errors were encountered: