Search code examples
apiresponseconsul

What does Consul Response code 429 mean exactly?


Consul is giving a response code 429 (Too many requests) for health check.

  1. Is it a valid response?
  2. What does it imply?

API: operator/autopilot/health


Solution

  • If you look at the code in question: https://github.com/hashicorp/consul/blob/master/agent/operator_endpoint.go#L311

    You will see that 429 is perfectly normal, it's a "warning" meaning the system is not 100% healthy, but it's still working.

    The original pull request has a touch more info: github.com/hashicorp/consul/pull/2788

    ORIGINAL ANSWER:

    If this is consul doing a health check of one of your services, than it's the service returning a 429, and that's between you and your service, whatever it is.

    If you look at the docs for health checks: https://www.consul.io/docs/agent/checks.html

    You will see you can specify an interval, to limit how often your health check is called. But the right answer is probably to alter your service to accept health checks from consul with less limitations.