expose /metrics from vtbackup at http --port#76
Closed
maxenglander wants to merge 1 commit intovtbackup_flagsfrom
Closed
expose /metrics from vtbackup at http --port#76maxenglander wants to merge 1 commit intovtbackup_flagsfrom
maxenglander wants to merge 1 commit intovtbackup_flagsfrom
Conversation
Signed-off-by: Max Englander <max@planetscale.com>
maxenglander
commented
Sep 28, 2022
| } | ||
|
|
||
| func init() { | ||
| mathrand.Seed(time.Now().UnixNano()) |
Author
There was a problem hiding this comment.
Not sure if we want/need this. Copy-pasted from elsewhere.
maxenglander
commented
Sep 28, 2022
| func init() { | ||
| mathrand.Seed(time.Now().UnixNano()) | ||
| servenv.RegisterDefaultFlags() | ||
| servenv.RegisterFlags() |
Author
There was a problem hiding this comment.
Think maybe we could do without servenv.RegisterFlags
maxenglander
commented
Sep 28, 2022
| // Catch SIGTERM and SIGINT so we get a chance to clean up. | ||
| ctx, cancel := context.WithCancel(context.Background()) | ||
| sigChan := make(chan os.Signal, 1) | ||
| signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) |
Author
There was a problem hiding this comment.
Signal handling now done by servenv
maxenglander
commented
Sep 28, 2022
| exit.Return(1) | ||
| } | ||
|
|
||
| if keepAliveTimeout > 0 { |
Author
There was a problem hiding this comment.
Added this for local testing, but I think this could also be useful in a K8s context to allow the next Prometheus scrape interval to pass before the process exits.
Author
|
Closed this in favor of vitessio#11388 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NB: Have opened this PR against https://github.com/planetscale/vitess/tree/vtbackup_flags, but don't want to merge against that branch. Plan to wait for that to merge to
mainbefore considering merging this one.Description
As far as I can tell
vtbackupdoes not currently publish metrics. It would be awesome if it did. In particular it would be great to have the following timings:This PR modifies
vtbackupcommand so that a server is started on--port. The server is similar to that launched by other VT components, and includes a/metricsendpoint. Currently this endpoint will include two metrics which are managed by themysqlctlpackage:vtbackup_restore_duration_secondsvtbackup_backup_duration_secondsKeeping this PR small just to lay the groundwork. The other metrics can come in a later PR if we're OK with this overall approach.
Use cases
PlanetScale makes ongoing internal and public efforts to improve backup and restore performance. It would be great to have detailed metrics on current performance so that we can make more informed decisions on where to put our energy.