Vitess: include cells filter in Vtctld API call by timvaillancourt · Pull Request #137 · github/freno

This PR causes Freno to add a Vitess-cell filter in the call it does to the vtctld API to gather tablets. Freno already supports filtering of tablets by cell but this currently happens client-side only. Filtering at the vtctld API should reduce the overhead of vtctld gathering tablet information (across many cells), the size of the response, etc

Support for filtering by cell(s) was added to the Vitess vtctld API used by Freno in vitessio/vitess#6569 (Vitess release 8.0.0+)

This change is backward-compatible as older Vitess releases will just-ignore the ?cells= query parameter and we're still filtering by cell client-side (will be deprecated in the future) - so both sides are always filtered 👍

Example of the cells filter:

$ curl -s https://<vtctld api>/api/keyspace/test_ks/tablets/ | jq length
7
$ curl -s https://<vtctld api>/api/keyspace/test_ks/tablets/?cells=cell1 | jq length
2
$ curl -s https://<vtctld api>/api/keyspace/test_ks/tablets/?cells=cell2 | jq length
2