-
Notifications
You must be signed in to change notification settings - Fork 113
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
Use labels for mapping metric types to metrics #219
Merged
Merged
Conversation
This file contains 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
@mikkeloscar can we log a warning in case old style is used? |
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
88295dd
to
dbb59a0
Compare
@szuecs added a warning log |
👍 |
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Found a bug where the fallback didn't work in case some labels were defined for the metric. Fixed and added tests to cover this. |
👍 |
2 similar comments
👍 |
👍 |
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.
For historical reasons (i.e. use of previous autoscaling API versions) we have been mapping metric names to the different collector types. I.e. if you wanted a metric based on
prometheus
you would name the metricprometheus-query
.This design has the downside that multiple metrics will have the same name and it becomes hard to distinguish as reported in #104
In some cases it can even prevent having more than a single metric of a certain type i.e. if you use the
zmon-check
metric and have the samecheck-id
but different complex keys defined (complex keys must be defined as annotation, and this will overlap if you have more than a single zmon-check metric defined).It was initially done because we didn't have any other identifiers in the HPA spec, at least for custom metrics, and this limitation was accidentally carried over for External metrics even though they have labels which can be used for such extra information. With
v2beta2
we have selector/labels for all the metric types and this can then be used to store this information.This PR introduces support for multiple metrics of the same type by adding a convention of a
type
label on the metrics e.g.type: prometheus
which is used to identify which collector type should be used.I have also aligned some of the naming for the types so they are more simple i.e.
prometheus-query
becomes typeprometheus
.To provide backwards compatibility the old metric names are still supported, but marked as legacy so we eventually can deprecate and remove them.
Fix #104