-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
#3925 Enable Sending AdaptiveCards to Webex for Enhanced Alert Notifi… #3926
base: main
Are you sure you want to change the base?
Conversation
…ert Notifications Signed-off-by: florianspk <[email protected]>
Add I rename the type of the struc Webex and not Webhook |
We have the same problem in other integrations. For example, supporting AdaptiveCards in Microsoft Teams. However, I'm not a fan of giving users a big JSON blob to template. I have past experience of templating JSON and YAML in Jinja2 and it was awful. I don't want to push that onto users. @gotjosh and @simonpasquier might have different opinions from mine, so I'll wait for them to give their thoughts on this. |
I understand your point. However, at the moment, we have tools that allow us to generate that large JSON blob, and this also helps us customize AdaptiveCards according to the alerts, which is what I’m doing in my case. |
@gotjosh and @simonpasquier, do you have any thoughts on this topic? |
That's great, but what about other Alertmanager users? That is the main problem I'm getting at here. You need tools to make generating JSON templates usable, and most users won't have such tools. Is the expectation on them to build their own? |
I understand, and I think we can try to find a compromise between our two ideas. Why not offer a default template where we could simply fill in the title, body, buttons, etc., as you suggest in your PR? At the same time, we could also allow the integration of a JSON blob for those who want to customize their AdaptiveCard. There are tools like Adaptive Cards Designer or Webex Cards Designer that make generating these blobs easier. |
I don't think either of those suggestions address the fundamental issue I'm afraid. Here is an example of a template that outputs invalid JSON if there are more than two alerts in the notification. This is quite a basic example, but what about debugging a template that is 10x the size with nested loops and if statements? It's these kind of issues that make me hesitant to allow templating of JSON blobs. {
"type": "AdaptiveCard",
"body": [
{{ range .Alerts.Firing -}}
{
"type": "TextBlock",
"text": "{{ .Labels }}",
"wrap": true
},
{
"type": "ActionSet",
"actions": [{
"type": "Action.OpenUrl",
"title": "Silence",
"url": "{{ .SilenceURL }}"
}]
}
{{ end -}}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.6"
} |
I understand your concern, and you're probably right that we need to find a solution to facilitate the integration of Adaptive Cards. I noticed your PR (#3381) regarding Adaptive Cards; have you received any feedback on it? I've also seen open PRs for integrating this feature into Slack, Teams, and Webex. I think it would be beneficial for us to discuss and come up with a common solution, especially since this feature is being requested across multiple platforms. What do you think? |
Issue: #3925
I've implemented the feature to enable sending AdaptiveCards to Webex from Alertmanager. This enhancement aims to improve the clarity and interactivity of alert notifications.
I have conducted some tests, and you can find the attached results directly on the test Webex channel. If you have any questions or need further clarification, please feel free to reach out. I'm available for any discussions or additional testing as needed.
Thank you for considering this improvement!
@simonpasquier