hashicorp / consul-esm

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

ESM Stops getting Health after PUT #25

Open murphymj25 opened 5 years ago

murphymj25 commented 5 years ago

In testing we noticed that if we do a PUT to catalog register in consul to update a Tag and include the "Checks", ESM will stop getting the response and the health check will go critical. If we remove the "Checks" from the PUT, we can edit the tags without any issues.

kyhavlov commented 5 years ago

Can you give an example of what you mean? It sounds like you may be overwriting the definition section of the health check in the catalog, which would remove the health check info for ESM to use.

murphymj25 commented 5 years ago

If we register a service with the following PUT, { "Node": "test-node", "Address": "10.0.0.1", "NodeMeta": { "external-node": "true", "external-probe": "true" }, "Service": { "Service": "test-service", "Port": 80, "Tags": [ "tag" ] }, "Checks": [ { "Name": "test-check", "ServiceID": "test-service", "Definition": { "http": "http://test-node/health.html", "interval": "2s" } }] }

If we update the service with an additional Tag by issuing a 2nd PUT, we see the monitor disappear from ESM. { "Node": "test-node", "Address": "10.0.0.1", "NodeMeta": { "external-node": "true", "external-probe": "true" }, "Service": { "Service": "test-service", "Port": 80, "Tags": [ "tag", "tag2" ] }, "Checks": [ { "Name": "test-check", "ServiceID": "test-service", "Definition": { "http": "http://test-node/health.html", "interval": "2s" } }] }

We are using the same values for the health check. If we do a PUT and update the check to something like /health2.html, it is fine.

lornasong commented 4 years ago

Hi @murphymj25! Sincere apologies for the delay. Thank you for the example configuration you provided. I used them but was unfortunately not able to reproduce the issue you are experiencing. On issuing the 2nd PUT for the config with additional tag, I saw that a second tag was successfully added and health checks were still healthy for me.

Are you still experiencing this issue? If so, would you be able to provide the version of consul and consul-esm you are using and steps you take to replicate the issue (e.g. curl commands, output)?