Initialize all handlers metrics#547
Merged
saswatamcode merged 3 commits intoobservatorium:mainfrom Jul 31, 2023
Merged
Conversation
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
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.
This PR initializes all the metrics from the metrics APIs (v1 and legacy) to ensure they are present on a restart of the application, even without traffic.
We were having issues with the Pyrra SLOs firing the
SLOMetricAbsentin these scenarios. This should prevent these alerts.A small refactor was done to stop trying to guess the group and handler based on the URL path at request time. Instead, these are added through handler wrappers that store the group and handler in the context. The list of groups and handlers are used to initialize the metrics.
A bigger refactor can be done to improve this further, making the registration of the group and handler names of an endpoint initialize the metric. This will require many more changes, including changing interfaces in the code, so I didn't do it in this PR.
Signed-off-by: Douglas Camata 159076+douglascamata@users.noreply.github.com