Skip to content

Add realtime health stats to vtctld /api/keyspace/ks/tablets API#6524

Closed
timvaillancourt wants to merge 9 commits intovitessio:masterfrom
timvaillancourt:add-stats-to-vtctld-keyspace-tablets-api
Closed

Add realtime health stats to vtctld /api/keyspace/ks/tablets API#6524
timvaillancourt wants to merge 9 commits intovitessio:masterfrom
timvaillancourt:add-stats-to-vtctld-keyspace-tablets-api

Conversation

@timvaillancourt
Copy link
Copy Markdown
Contributor

@timvaillancourt timvaillancourt commented Aug 1, 2020

This PR adds realtime health stats to the vtctld /api/keyspace/<ks>/tablets/<shard> HTTP API endpoint. This extends the PR @shlomi-noach made in #4232

The tablet health metrics are needed for github.com/github/freno to understand if a vttablet is ready for probes for replication lag. In today's implementation it is possible for an unhealthy vttablet (replication is stopped, doing a maintenance, etc) to continue to be probed by Freno because the API endpoint does not return tablet health

This PR also adds a cell and cells (CSV list) query parameter for filtering the output by Vitess Cell. Let me know if you'd prefer this to be part of the URL path vs a query param. This is useful when you're only interested in grabbing specific cells. Example URLs:

  1. /api/keyspace/<ks>/tablets/?cell=cell1
  2. /api/keyspace/<ks>/tablets/?cells=cell1,cell2
  3. /api/keyspace/<ks>/tablets/<shard>?cell=cell1
  4. /api/keyspace/<ks>/tablets/<shard>?cells=cell1,cell2

I've made this a work in progress PR for @sougou / @shlomi-noach / @deepthi to review. After we agree on the approach I can complete the unit testing, add suggestions, etc

@timvaillancourt timvaillancourt requested a review from sougou as a code owner August 1, 2020 16:04
@timvaillancourt timvaillancourt marked this pull request as draft August 1, 2020 16:04
@deepthi
Copy link
Copy Markdown
Collaborator

deepthi commented Aug 13, 2020

The approach looks fine to me.

Signed-off-by: Tim Vaillancourt <timvaillancourt@github.com>
Signed-off-by: Tim Vaillancourt <timvaillancourt@github.com>
Signed-off-by: Tim Vaillancourt <timvaillancourt@github.com>
Signed-off-by: Tim Vaillancourt <timvaillancourt@github.com>
Signed-off-by: Tim Vaillancourt <timvaillancourt@github.com>
Signed-off-by: Tim Vaillancourt <timvaillancourt@github.com>
@timvaillancourt
Copy link
Copy Markdown
Contributor Author

Closing due to DCO / git rebase issues, in favour of #6569

@timvaillancourt timvaillancourt deleted the add-stats-to-vtctld-keyspace-tablets-api branch August 14, 2020 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants