question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consul: query service by specific health states

See original GitHub issue

The consul namer currently allows filtering nodes by a binary health status via the useHealthCheck parameter. Consul however has the concept of passing, warning and critical health statuses, the consul API can also be queried with the any state where no filtering is desired.

A new parameter (like healthCheckStatuses?) could be added to the consul namer to allow more precise filtering of consul nodes by one or more health statuses, passed as a comma separated list.

We are particularly interested in this feature so that we can implement a fall back pool for a service which includes only nodes in the warning state (and not the critical state). See also https://discourse.linkerd.io/t/configuring-a-fall-back-consul-namer/243/3.

The consul API does not currently allow for listing a services nodes directly by health status, but does include the health statuses of each node in a separate top level array which could be used to filter results. Such an approach is used in consul template for example.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hawkwcommented, Aug 24, 2017

Hi @amitsaha, @adleong is currently out of the office. I’m running point on the 1.2.0 release & would be happy to go over your PR if you like. When it’s ready for review, we might want to loop @esbie in as well.

0reactions
amitsahacommented, Sep 6, 2017

Thanks, perfect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Health - HTTP API | Consul - HashiCorp Developer
The /health endpoints query health-related information for services and checks in Consul.
Read more >
HealthClient (consul-client 1.0.0 API) - javadoc.io
com.orbitz.consul. ... Retrieves the healthchecks for all healthy service instances in a given datacenter with ... Parameters: state - The state to query....
Read more >
consul.getServiceHealth - Pulumi
consul.getServiceHealth can be used to get the list of the instances that are currently healthy, according to their associated health-checks.
Read more >
consul_service_health | Data Sources | hashicorp/consul
consul_service_health can be used to get the list of the instances that are currently healthy, according to their associated health-checks.
Read more >
HTTP API and health check
Register a new node with a specific service (port 111). ... is used by the agents to report the state of their services...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found