feat(): Add alertmanagerconfig_matcher block to mimir.alerts.kubernetes component to change the matcher strategy#5072
Conversation
a2afd08 to
7402388
Compare
|
Thanks for implementing this. So we can simulate the namespace matching, and it would work in the same way if we watched the Alertmanager config? UPD: This can be an overhead, though, since we already have access to set the type to None, which will do the same thing basically.
|
|
Maybe it makes sense to add the So when we set the: If the AlertmanagerConfig manifest is located in the "testing" namespace, it will generate the config without matchers by the namespace for this instance. But it would be the same if we set the alertmanager_matching_strategy to In this case, we won't accidentally load the tenant's configuration into the global matcher scope. We could probably do the same thing using the |
08178e8 to
7cb46a3
Compare
|
I have implemented the strategy, but I have had some problems with adding a test. I will continue on Monday. |
|
I added the test for the last strategy. I also had to fix an error in the existing tests where a second namespace was not correctly discovered. |
docs/sources/reference/components/mimir/mimir.alerts.kubernetes.md
Outdated
Show resolved
Hide resolved
docs/sources/reference/components/mimir/mimir.alerts.kubernetes.md
Outdated
Show resolved
Hide resolved
90b0eee to
f43e87d
Compare
ptodev
left a comment
There was a problem hiding this comment.
Thank you! Looks good from a code point of view. The docs need just a bit more polishing.
docs/sources/reference/components/mimir/mimir.alerts.kubernetes.md
Outdated
Show resolved
Hide resolved
2298890 to
8ed28a8
Compare
|
@ptodev I updated the docs according to your suggestions. I also added a section to the example, what do you think? |
docs/sources/reference/components/mimir/mimir.alerts.kubernetes.md
Outdated
Show resolved
Hide resolved
docs/sources/reference/components/mimir/mimir.alerts.kubernetes.md
Outdated
Show resolved
Hide resolved
docs/sources/reference/components/mimir/mimir.alerts.kubernetes.md
Outdated
Show resolved
Hide resolved
docs/sources/reference/components/mimir/mimir.alerts.kubernetes.md
Outdated
Show resolved
Hide resolved
docs/sources/reference/components/mimir/mimir.alerts.kubernetes.md
Outdated
Show resolved
Hide resolved
ptodev
left a comment
There was a problem hiding this comment.
Thank you! We can merge it once @clayton-cornell approves on the docs side
| | Name | Type | Description | Default | Required | | ||
| | ------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------- | --------------- | --------------------------------------------------------------------- | | ||
| | `strategy` | `string` | Strategy for adding matchers to AlertmanagerConfig CRDs. | `"OnNamespace"` | no | | ||
| | `alertmanager_namespace` | `string` | Namespace to use when `alertmanagerconfig_matcher_strategy` is set to `"OnNamespaceExceptForAlertmanagerNamespace"`. | | only when `strategy` is `"OnNamespaceExceptForAlertmanagerNamespace"` | |
There was a problem hiding this comment.
@clayton-cornell is it ok if the "Required" column is populated like this? Is it too verbose? I couldn't run make docs locally due to a docker error so I can't visualise it.
There was a problem hiding this comment.
Yeah I wondered about that too. Ultimately we decide for ourselves what we want in each column and what limits we want to place... the site generator doesn't care.
The doc for otelcol.receiver.awss3 has similar conditional elements
Arguments table:
start_time- shows "Required if fetching by time."end_time- shows "Required if fetching by time."
Blocks table:
sqsblock - shows "Required if fetching by SQS notification."
Since strategy can have 3 different values, and alertmanager_namespace is only required for one of the three strategy values... I think this might be the least ambiguous way of presenting this conditional requirement. It does make the table column wider, but... it doesn't leave the discovery of the requirement to chance.
I'd say... leave it for this PR and we can change it if needed in a future PR.
alertmanagerconfig_matcher block to mimir.alerts.kubernetes component to change the matcher strategy
…s.md Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…s.md Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…s.md Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
…s.md Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
66bdf4c to
9515633
Compare
|
@ptodev I rebased on the main branch. Can we get this merged? |
alertmanagerconfig_matcher block to mimir.alerts.kubernetes component to change the matcher strategyalertmanagerconfig_matcher block to mimir.alerts.kubernetes component to change the matcher strategy
PR Description
Which issue(s) this PR fixes
Fixes #5038
Notes to the Reviewer
I also had to update one of the existing tests because the second namespace had not been added to the namespace indexer. The tests was therefore testing wrong behavior.
PR Checklist
BEGIN_COMMIT_OVERRIDE
feat(mimir.alerts.kubernetes): Add
alertmanagerconfig_matcherblock to change the matcher strategyEND_COMMIT_OVERRIDE