Skip to content

Add option to further filter Consul Watch -type=checks -state=X by Tag #17642

@mcousens

Description

@mcousens

Feature Description

We are requesting to add the ability to further filter Consul Watch type=checks state=<state> data by -tag to monitor a more narrow scope of data. Ideally, we'd love to be able to filter by -service as well to narrow it even further.

currently allowed:
consul watch -type=checks -state=critical

ideal state, example:
consul watch -type=checks -service=redis -state=critical -tag=autoscaling_group

Use Case(s)

AWS Autoscaling Groups provide a set-instance-health endpoint so that you can mark an instance as unhealthy from an external system.

When using Consul for service discovery, you have a variety of health checks for nodes that can let you know when a service is in a critical state and the application may not be able to run correctly. By monitoring the Consul health checks via a Consul Watch, you can call the AWS set-instance-health endpoint when a node has a critical health check so that the AWS Autoscaling Group can replace the instance.

We use the below Consul Watch to monitor critical health checks for our AWS Autoscaling Groups so that we can mark the node as Unhealthy in the AWS ASG and replace the instance with a healthy one.

consul watch -type=checks -state=critical

Because we can't filter checks in the critical state by Tag, we must monitor critical health checks across our entire system and constantly ingest and parse the input to find relevant health checks. It would be very helpful if we could tell the Consul Watch to only monitor critical health checks for nodes that are a part of the autoscaling group via a tag. Ideally, we could also further filter by Service to get a very specific view of what you need:
consul watch -type=checks -service=redis -state=critical -tag=autoscaling_group

Metadata

Metadata

Assignees

Labels

type/enhancementProposed improvement or new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions