Skip to content

Consul integration fails to detect leader when using ipv6 #18707

@michaz

Description

@michaz

Steps to reproduce the issue:

  1. Set up a Consul cluster where Consul binds to ipv6 addresses
  2. Enable Datadog-Consul integration

Describe the results you received:
Service and catalog checks are skipped on every instance, including the leader.

Describe the results you expected:
Service and catalog checks are performed on the leader.

Additional information you deem important (e.g. issue happens only occasionally):
The integration seems to think that no instance is the leader. I think this is because leadership is determined by string-comparing IP addresses, and that fails on ipv6 because the address format is different between the left-hand side and the right-hand side.

And that's because the address in Member.Addr that is returned by Consul's API isn't in brackets, unlike many other ipv6 addresses returned by Consul.

Maybe there is a more robust way to find out if the local Consul node is the leader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions