-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[kube-prometheus-stack] msteams_configs not found in type config.plain #3724
Comments
|
Hey @SergkeiM 👋 , |
Hi @dbluxo I have 2 templates for title: '{% raw %}{{ if eq .Status "firing" }}🚨 <b>FIRING</b> 🔥{{- else -}}🙌 <b>RESOLVED</b> 🍻{{- end -}}{% endraw %}'
text: '{% raw %}
<b>Alert:</b> <code>{{ .CommonLabels.alertname }}</code><br>
<b>Severity:</b> <code>{{ .CommonLabels.severity | title -}}</code><br>
{{- if (index .Alerts 0).Annotations.summary }}<b>Summary:</b> {{ (index .Alerts 0).Annotations.summary }}<br><br>{{- end }}
{{ range .Alerts }}
{{- if .Annotations.description }}{{ .Annotations.description }}<br><br>{{- end }}
{{- if .Annotations.message }}{{ .Annotations.message }}<br><br>{{- end }}
{{- end }}{% endraw %}' And this one in title: '{{ if eq .Status "firing" }}🚨 **FIRING** 🔥{{- else -}}🙌 **RESOLVED** 🍻{{- end -}}'
text: '{{ template "msteams.text" . }}' msteams.tmpl: |
{{ define "msteams.text" -}}
**Alert:** {{ .CommonLabels.alertname }}\
**Service:** {{ .CommonLabels.service }}\
**Severity:** {{ .CommonLabels.severity | title -}}\
{{- if (index .Alerts 0).Annotations.summary }}
**Summary:** {{ (index .Alerts 0).Annotations.summary }}
{{- end }}
{{ range .Alerts }}
{{- if .Annotations.description }}{{ .Annotations.description }}\{{- end }}
{{- if .Annotations.message }}{{ .Annotations.message }}\{{- end }}
{{- end }}
{{- end }} For some reason HTML doesn't work in Prometheus (Alertmanager) so had to use markdown. |
This is still a problem with v49 of the chart (with updated alertmanager etc). |
Hi @EraYaN This is becuase The last version
So we need to wait until 'prometheus' image is released (v2.47.0), and after chart is updated. But is defintley confusing, I think first all related things has to be updated, and after the charts, not vice-versa. |
Hi @arukiidou the above was fixed with release of
|
To make matters worse, |
and now what? |
Support for the msteams receiver is present in the latest Prometheus operator release 0.69.0. You can try that out (with CRDs from the same release) or wait until the next chart's major release is out. |
With @tadavid-cae we found that the issue was fixed in: prometheus/alertmanager#3495, and it has not been released yet, but it is merged to the main branch. alertmanager:
tag: main@sha256:1c3941499c0379e516b75fcfa28f991342e12e922cdf499620a7e4b33dd5060e |
Hi @95gabor I don't think is alertmanager issue, becuase I do use MSTeams in ceph with alertmanager 0.26, also works in grafana, the only problems is prometheus and we wait for 2.48 |
@SergkeiM Probably I am missing something, but how would prometheus be problematic here when sending alerts to teams is not working which is done by alertmanager? |
Can anyone confirm if latest version on kube-prometheus-stack already addresses this problem? |
I can confirm this is working with here is an example: apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
name: test-service
namespace: test-service
labels:
app: alertmanager-config
spec:
route:
receiver: 'test-service'
routes:
- receiver: 'test-service'
continue: true
matchers:
- name: 'namespace'
matchType: '='
value: 'test-service'
- name: 'severity'
matchType: '=~'
value: 'warning|critical|WARNING|CRITICAL'
receivers:
- name: 'test-service'
msteamsConfigs:
- webhookUrl:
key: webhook_url
name: test-service-secret
sendResolved: true
title: '{{ template "msteams.default.title" . }}'
text: '{{ template "msteams.default.text" . }}' |
@mihaico lastest chart version is 54.2.2, does that version still requires that workaround? |
I see its using |
Ok thanks for confirming @mihaico . I'll give it a try because I am currently using another deployment (prometheus-msteams) to be able to send notifications to teams via alertmanager and this default integration is way better 😉 |
Confirm, in Helm chart version |
Weird, not working for me yet.
|
Hi @trallnag They key is: example: receivers:
- name: 'msteams'
msteams_configs:
- webhook_url: 'WEBHOOK_URLf'
send_resolved: true
title: '{{ if eq .Status "firing" }}🚨 [FIRING] 🔥{{- else -}}🙌 [RESOLVED] 🍻{{- end -}}'
text: '{{ template "msteams.text" . }}' |
Amazing, nice catch. Thanks! |
Hi @SergkeiM |
Describe the bug a clear and concise description of what the bug is.
After upgrading to
48.4.0
and trying to usemsteams
in alertmanager:I get this error:
sync "kube-prometheus-stack/kube-prometheus-stack-alertmanager" failed: provision alertmanager configuration: failed to initialize from secret: yaml: unmarshal errors: line 32: field msteams_configs not found in type config.plain
What's your helm version?
v3.10.3
What's your kubectl version?
v1.23.6
Which chart?
kube-prometheus-stack
What's the chart version?
48.4.0
What happened?
No response
What you expected to happen?
No response
How to reproduce it?
No response
Enter the changed values of values.yaml?
No response
Enter the command that you execute and failing/misfunctioning.
helm upgrade kube-prometheus-stack prometheus-community/kube-prometheus-stack
--version 48.4.0
--namespace kube-prometheus-stack
--values values.yml
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: