blackbox_exporter icon indicating copy to clipboard operation
blackbox_exporter copied to clipboard

Invalid IPProtocol value handling in chooseProtocol

Open ties opened this issue 2 years ago • 0 comments

As a user, we got bitten by our configuration containing ipv6 instead of ip6 (and ipv4). As a result, our probes to an IPv6 only host failed. This was harder to debug than expected because we did not understand why the probe defaulted to ip_protocol=ip4 when we configured it for IPv6.

There are multiple ways of fixing this. I thought the clear local improvement was to:

  • default to IPv6 when the value is unknown
  • log that the default value was unknown - the log line ends up in the output of the potentially failed probe attempt.

I realise that this is technically a breaking change because the behaviour on an invalid value changes from ip4 to ip6. Further work would be to reject invalid values when parsing the configuration, but that would be a real breaking change.

ties avatar Apr 12 '23 10:04 ties