Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: emit tablet type metric from vttablet to Prometheus #14300

Open
maxenglander opened this issue Oct 18, 2023 · 0 comments
Open
Assignees
Labels
Component: Observability Pull requests that touch tracing/metrics/monitoring Type: Feature

Comments

@maxenglander
Copy link
Collaborator

maxenglander commented Oct 18, 2023

Feature Description

Emit a metric, available in Prometheus, like vttablet_tablet_type metric to indicate if that tablet target type is currently primary, replica, etc. Alternately include tablet type in existing status metrics like vttablet_tablet_state.

Use Case(s)

Use case is to detect when the primary is not in serving state. We have vttablet_tablet_state metric for that, but it does not include the tablet type.

The vttablet_tablet_type_count metric doesn't tell us what the current target type of the tablet is, so it doesn't help very much with this use case. The TabletType stat does have what we want, but it is not exported to Prometheus.

Metrics recently added by @rafer can very nearly be used to satisfy this use case: #13521. However, those metrics are not updated when there are no queries, nor in the case of FailedPrecondition errors like wrong tablet type:

if sm.state != StateServing || !sm.replHealthy {
// This specific error string needs to be returned for vtgate buffering to work.
return vterrors.New(vtrpcpb.Code_CLUSTER_EVENT, vterrors.NotServing)
}
shuttingDown := sm.wantState != StateServing
if shuttingDown && !allowOnShutdown {
// This specific error string needs to be returned for vtgate buffering to work.
return vterrors.New(vtrpcpb.Code_CLUSTER_EVENT, vterrors.ShuttingDown)
}
err = sm.verifyTargetLocked(ctx, target)
if err != nil {
return err
}

@maxenglander maxenglander added Type: Feature Needs Triage This issue needs to be correctly labelled and triaged labels Oct 18, 2023
@maxenglander maxenglander changed the title Feature Request: emit target type metric from vttablet Feature Request: emit target type metric from vttablet to Prometheus Oct 18, 2023
@maxenglander maxenglander added Component: Observability Pull requests that touch tracing/metrics/monitoring Component: TabletManager and removed Component: TabletManager labels Oct 18, 2023
@maxenglander maxenglander changed the title Feature Request: emit target type metric from vttablet to Prometheus Feature Request: emit tablet type metric from vttablet to Prometheus Oct 18, 2023
@mattlord mattlord removed the Needs Triage This issue needs to be correctly labelled and triaged label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Observability Pull requests that touch tracing/metrics/monitoring Type: Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants