-
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
IDN (Internationalized domain names) support #626
Comments
Hmm, how does normal Prometheus scraping deal with this? Does Go even support these? |
I'm not familiar with Go, but as I tested with Codepackage main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
url := "http://мтр24.рф"
fmt.Println("URL:>", url)
resp, err := http.Get(url)
if err != nil {
log.Fatal(err)
}
fmt.Println("response status:", resp.StatusCode)
body, err := ioutil.ReadAll(resp.Body)
fmt.Println("response body:", string(body))
} Logs
|
Okay, so likely our own resolution stuff can't handle this. |
There's a third-party library for Go that deals with IDN. The way we are dealing with it is by taking the IDN hostnames, applying the punycode transformation and passing that as the target to. For ping and DNS it's just a matter of applying punycode to the input. For TCP we have to split the hostname and the port. For HTTP we parse the URL, punycode the hostname and build a new URL. For DNS we are also transforming the query (so the BBE config has punycoded strings, not UTF8). Transforming regular hostnames using punycode yields back regular hostnames, so you don't have special cases. The ugly part is that you see punycoded strings where you expect something else. I could work on a PR to handle this inside BBE if we decide how to handle that case ("it's OK to see punycoded hostnames in logs", "I want to see UTF8 in logs", "..."). |
I wouldn't worry about the logs, there's an existing PR #640 which is having issues with some of the finer details. |
Host operating system: output of
uname -a
Linux db6787aaa499 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 x86_64 GNU/Linux
blackbox_exporter version: output of
blackbox_exporter -version
0.16.0
What is the blackbox.yml module config.
default
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?
What did you expect to see?
probe_success 1
What did you see instead?
probe_success 0
The text was updated successfully, but these errors were encountered: