silas / node-consul

Consul client
https://www.npmjs.com/package/consul
MIT License
560 stars 83 forks source link

Consul queries providing `tag` are deprecated #133

Closed brandonw closed 1 year ago

brandonw commented 1 year ago

According to the official consul docs [1], tags is a deprecated query parameter, and we should instead be using filter.

Before:

consul.health.service({
    ...,
    tag: TAG_HERE
});

After:

consul.health.service({
    ...,
    filter: `"${TAG_HERE}" in Service.Tags`
});

[1] https://developer.hashicorp.com/consul/api-docs/health#tag

silas commented 1 year ago

filter is one of the common options and can be used with any call.

Are you asking for a change to the README or to actually remove support for it?

brandonw commented 1 year ago

Nope! I missed that entirely! Thanks for the pointer, I will close this.