-
Notifications
You must be signed in to change notification settings - Fork 176
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
Support configure alertmanager #148
Conversation
Signed-off-by: clyang82 <chuyang@redhat.com>
'--alertmanagers.url=' + alertmanagerURL, | ||
for alertmanagerURL in tr.config.alertmanagersURL | ||
] + [ | ||
'--rule-file=/etc/thanos/rules/*.rules.yaml', |
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.
This assumes that the key used in the configmap ends in rules.yaml
, which is mysterious because it is not communicated to the user. Can we instead use the pattern of requiring a rulesFileKey
in the jsonnet config and use that name instead?
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.
Great comments. Thanks @squat I would like to just use *.yaml
instead, because the configmap may contain multiple files. Is that OK?
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.
The trouble is that there is no guarantee that the configmap key will even end in .yaml
. The user could write a configmap where the keys are
foo: ...
bar: ...
rules: ...
each of these keys could have a valid rules file for the value, but the keys don't end in .yaml
and thus this flag wouldn't work. File extensions are helpful hints and conventions but are not required.
Similarly, what if the configmap hold multiple keys that end in .yaml
but only ONE of them is actually a rules file? Then the ruler would be attempting to read something it can't understand, potentially causing problems.
Signed-off-by: clyang82 <chuyang@redhat.com>
Signed-off-by: clyang82 <chuyang@redhat.com>
withAlertmanagers:: { | ||
local tr = self, | ||
config+:: { | ||
ruleConfigMapName: error 'must provide rulesConfigMapName', |
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.
we need to be consistent here; it should either be rulesConfigMapName
or ruleConfigMapName
without the s
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.
forgot to update the message.
Signed-off-by: clyang82 <chuyang@redhat.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 from my side
Cc @metalmatze
Definitely a really good change and addition 👍
|
Signed-off-by: clyang82 <chuyang@redhat.com>
2d5e6ac
to
e31eea1
Compare
Signed-off-by: clyang82 <chuyang@redhat.com>
e31eea1
to
e701891
Compare
Perfect! 👍 |
Allow to configured alertmanager in ruler and then enabling me to easily forward alerts from alertmanager:
alertmanagersURL
to be able to configure alertmanager urlrulesConfig
to be able to configure name and key/assign @squat