Open aned opened 3 years ago
I think this was fixed in 2.25 (#8359).
Can you please upgrade to 2.25.2 and verify the fix?
Thanks!
Just checked, 2.25.2 still has this issue.
I think I have figured out the reason
In IPV6, the host:port syntax has been changed. Here's the detail in rfc3986
A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax. In anticipation of future, as-yet-undefined IP literal address formats, an implementation may use an optional version flag to indicate such a format explicitly rather than rely on heuristic determination.
So "xxx:xx:xx:xx:port" is not right, it will cause error here https://github.com/prometheus/prometheus/blob/main/web/api/v1/api.go#L795
I'll try to make a PR for this.
I am surprised that Prometheus can scrape 2a03:f347:40:1::6d:9100
in the first place. It should scrape [2a03:f347:40:1::6d]:9100
.
@roidelapluie yes, I'm surprised there's not error when Go access the 2a03:f347:40:1::6d:9100 too.
Anyway, I'm working on a PR for this issue
@aned Hello, Would you mind introducing what's kind of discovery method you use?
I think it will help to find out the root cause?
@Zheaoli we query internal DB and generate yaml files for prometheus.
It seems like the yaml generated by the DB is not correct. However, we should still fix this in the UI if Prometheus can actually scrape it.
Also facing problems with scraping most of IPv6 (pods on Kubernetes) addresses.
With the right syntax scrapping is working for me on version 2.31.1, but the web interface still shows an error in the targets list:
Error: URL constructor: http://[fe80::1c33:5ff:fe06:92fc%25enx8c04ba675c4c]:9100/metrics is not a valid URL.
Hello from the bug scrub.
We believe that this is still not fixed. Should be an easy contribution.
In v2.23.0 when I have a scraping endpoint IPv6 address such as 2a03:f347:40:1::4f, I see an error on the web UI
The scrape does happen and the "State" is showing as up.