Skip to content
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

MSTeams integration message cards actions not supported #3642

Open
rgarcia89 opened this issue Dec 18, 2023 · 2 comments
Open

MSTeams integration message cards actions not supported #3642

rgarcia89 opened this issue Dec 18, 2023 · 2 comments

Comments

@rgarcia89
Copy link

rgarcia89 commented Dec 18, 2023

With the current state of the MSTeams integration we are not able to define actions next to the title, text and summary. Due to this it is not possible to define buttons that would, for example, provide a silence functionality or a URL to Prometheus, Alertmanager, Runbook or whatever.

https://learn.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#openuri-action

Environment

  • Alertmanager version: 0.26.0

    insert output of alertmanager --version here (repeat for each alertmanager
    version in your cluster, if relevant to the issue)

  • Prometheus version: 0.70.0

    insert output of prometheus --version here (repeat for each prometheus
    version in your cluster, if relevant to the issue)

@PatrickSpies
Copy link

As a kind of workaround: We use html inside the text to add a silence-link:

      msteamsConfigs:
        - text: |2-
            {{ range $index, $alert := .Alerts }}
              {{ if $index }}
            <br />
              {{ end }}
            <hr style='border-color: #{{ if eq $.Status "resolved" }}2DC72D{{ else if eq $.Status "firing" }}{{ if eq $.CommonLabels.severity "critical" }}8C1A1A{{ else if eq $.CommonLabels.severity "error" }}FF4D00{{ else if eq $.CommonLabels.severity "warning" }}FFA500{{ else }}808080{{ end }}{{ else }}808080{{ end }}; border-width: 5px;' />
            <strong>{{ $alert.Annotations.description }}</strong><br />
            <br />
              {{ range $key, $value := $alert.Annotations }}
                {{- if and (ne $key "description") (ne $key "runbook_url") }}
            <strong>{{ $key }}</strong> {{ $value }}<br />
                {{ end -}}
              {{ end -}}
              {{- range $key, $value := $alert.Labels }}
                {{- if ne $key "prometheus" }}
            <strong>{{ $key }}</strong> {{ $value }}<br />
                {{ end -}}
              {{ end }}
              {{ if eq $.Status "firing" -}}
            <br />
            <a href="{{ $.ExternalURL }}/#/silences/new?filter=%7B{{$c := 0}}{{ range $key, $value := $alert.Labels }}{{if $c}}%22%2C%20{{ end }}{{ $c = 1 }}{{ $key }}%3D%22{{ $value }}{{- end }}%22%7D" target='_blank'><button>Silence alert</button></a><br />
              {{- end }}
            {{ end }}

image

@TheMeier
Copy link
Contributor

See #3324 (comment)

Support for AdaptiveCards would be nice, maybe you can provide a merge request to implement that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants