hashicorp / consul-esm

External service monitoring for Consul
Mozilla Public License 2.0
262 stars 41 forks source link

Allow configuring NodeHealthRefreshInterval #256

Open magec opened 7 months ago

magec commented 7 months ago

I am working on a project where several nodes come and go pretty fast, was testing consul-esm reaping functionality an saw that the de-registering is only triggered after two health status updates, the first one that sets it to critical, and then it waits for a second one to trigger the de-registering. To speed this up I needed NodeHealthRefreshInterval to be configurable.

This change makes it configurable while maintaining the default value it had before it also adds some documentation explaining this 'use case'.

Without this, if you configure consul-esm with:

node_reconnect_timeout = "5m"

The 'non responding' node will be kept registered until 1 hour passes. Changing node_health_refresh_interval value and setting it to, let's say:

node_health_refresh_interval = "10s"

will deregister the node after (at most) 5m 10s. I have personally tested this behavior.

absolutelightning commented 6 months ago

Change looks good. Please add how have you tested it?

magec commented 6 months ago

I added a test for this parameter, the same way it is done for the rest of the exported config ones (this link) . What else do you need?

absolutelightning commented 6 months ago

I added a test for this parameter, the same way it is done for the rest of the exported config ones (this link) . What else do you need?

I was asking about manual tests. If you have done any? Please add in description.

magec commented 6 months ago

Added some comments!

magec commented 1 day ago

Any chance this could be merged? asking for a friend.