-
Notifications
You must be signed in to change notification settings - Fork 739
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
Add support for custom variables in metric templates #1355
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for opening this PR! it'd also be nice to have some tests for observers.RenderQuery()
since that deals with the actual templating and it has zero test coverage at the moment. would you like to try and add them? no need to add tests for every edge case, just a few cases should be a good start.
@aryan9600 thanks for the feedback. I've added tests to cover some basic scenarios for |
Codecov ReportBase: 54.37% // Head: 54.41% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1355 +/- ##
==========================================
+ Coverage 54.37% 54.41% +0.04%
==========================================
Files 84 84
Lines 10044 10047 +3
==========================================
+ Hits 5461 5467 +6
+ Misses 3927 3925 -2
+ Partials 656 655 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Is there a problem with the OSM e2e test? It failed to fetch the
|
@njohnstone2 a couple of things need to be done and then we can merge this PR:
thanks! |
Signed-off-by: Nelson Johnstone <93178586+njohnstone2@users.noreply.github.com>
Signed-off-by: Nelson Johnstone <93178586+njohnstone2@users.noreply.github.com>
@aryan9600 thanks for the feedback! I have updated the e2e tests that use This is to keep tutorials and other examples using the minimum required config to define the metric template and avoid adding complexity. Please let me know if you don't agree with this and I can update the rest of the references to |
The osm e2e test should be fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a few minor nitpicks in the docs, but othwerwise its looking good!
@stefanprodan could you also take a final look at the docs?
Signed-off-by: Nelson Johnstone <93178586+njohnstone2@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! thanks @njohnstone2 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Awesome job @njohnstone2 thanks 🥇 Also thanks @aryan9600 for the reviews.
Thanks team! Really appreciate the guidance getting this added to the project. |
This PR is in response to #1351. The aim here is to provide the ability to support the use of custom variables on metric templates.
Templating lets us define common properties in a single location. It feels like a logical extension of the
metricTemplate
resource to support a common query that uses dynamic metric labels.Use Case
In my case i have a large number of deployments that i would like to implement canary deployments on (e.g. 300). These deployments can be broken down into several types that share common KPI's.
I am already using
helm
to manage the templating of these projects so it is possible to template the query directly on the canary resource.However this feels like an anti pattern since all properties of the
metricTemplate
would need to be applied to allcanary
resources (e.g. metrics_url, auth secret, query). Ideally I would like to use themetricTemplate
CRD to define the common properties of each metrics grouping in a single location as opposed to eachcanary
definition.