mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promscrape: clarify error message on failed connection to scrape target when -enableTCP6 command-line flag isn't set
This commit is contained in:
parent
b0e4b234cb
commit
299a35948c
1 changed files with 4 additions and 1 deletions
|
@ -19,6 +19,9 @@ func statStdDial(ctx context.Context, network, addr string) (net.Conn, error) {
|
|||
dialsTotal.Inc()
|
||||
if err != nil {
|
||||
dialErrors.Inc()
|
||||
if !netutil.TCP6Enabled() {
|
||||
err = fmt.Errorf("%w; try -enableTCP6 command-line flag if you scrape ipv6 addresses", err)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
conns.Inc()
|
||||
|
@ -54,7 +57,7 @@ func statDial(addr string) (conn net.Conn, err error) {
|
|||
if err != nil {
|
||||
dialErrors.Inc()
|
||||
if !netutil.TCP6Enabled() {
|
||||
err = fmt.Errorf("%w; try -enableTCP6 command-line flag", err)
|
||||
err = fmt.Errorf("%w; try -enableTCP6 command-line flag if you scrape ipv6 addresses", err)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue