feat: Alert Knob - #857
Draft
sinapah wants to merge 3 commits into
Draft
feat: Alert Knob#857sinapah wants to merge 3 commits into
sinapah wants to merge 3 commits into
Conversation
4 tasks
sinapah
commented
Aug 24, 2026
| "ops[tracing]", | ||
| "pyyaml", | ||
| "cosl", | ||
| "cosl@git+https://github.com/canonical/cos-lib.git@feat/rules-customization", |
Contributor
Author
There was a problem hiding this comment.
When canonical/cos-lib#205 goes in, remove branch pinning and bump to latest available cosl version.
sed-i
reviewed
Aug 25, 2026
| labels: | ||
| severity: warning | ||
|
|
||
| add: |
Contributor
There was a problem hiding this comment.
The add directive is interesting: it overlaps with side-loading rules via charm resource via cos-config charm.
On one hand, having one way to do things, as well as scoped responsibilities, points us at not having an add directive. Otoh, it is quite powerful and handy. Any thoughts on this?
Contributor
There was a problem hiding this comment.
- Would we benefit from a feature file here?
- Do we have a test that captures what happens when we attempt to patch somethings that has no match?
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.
Issue
Based on changes in canonical/cos-lib#205.
Solution
Context
Testing Instructions
To test, first deploy the following bundle:
You should then expect to see in Prometheus's
prometheuscontainer at/etc/prometheus/rules, the following file:juju_test_a3ea41d9_otelcol.rules. The content of the file should be:Now, let's refresh the charm and then perform the following modifcations:
juju_charmis equal toavalanche-k8s.test_a3ea41d9_otelcol_Receiver_rules.critical. This should result in the removal of theHostMetricsMissingalert.forto 1h instead of the current15m.AggregatorMetricsMissingand change itsannotations.summaryto be "XYZ".high-cpu-usageand change itsexprfrommax(rate(otelcol_process_cpu_seconds_total{juju_application="otelcol",juju_model="test",juju_model_uuid="a3ea41d9-8d54-4897-8098-dde7bc214ea3"}[5m])tomax(rate(otelcol_process_cpu_seconds_total{juju_application="otelcol",juju_model="test",juju_model_uuid="a3ea41d9-8d54-4897-8098-dde7bc214ea3"}[45m]).To apply the changes above, we need a YAML block that looks like:
The resulting diff is:
Upgrade Notes