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

Add card feature to msteamsv2_config #4243

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jverger
Copy link

@jverger jverger commented Feb 3, 2025

The goal of this PR is to add an option card to the msteamsv2_config configuration.

If this card option is not used, the default behaviour is keept using title and text values.

Here is an example screenshot of the default result in msteams channel:
image

When using card option, the user is able to customize the msteams card rendering output by using a custom template file and configuring card option to use this template.

Here is an example screenshot of the output result in msteams channel when using card option:
image

To be honest, it's the first time i'm developing in go and create a PR.
Hope it will be not so bad :)

@jverger
Copy link
Author

jverger commented Feb 3, 2025

All checks have passed 🎉 , waiting for someone to merge this PR ⌚

@grobinson-grafana
Copy link
Contributor

I would really like to avoid pushing users towards templating JSON blobs. It has a lot of problems that I've explained in a couple other PRs such as #3799 (comment).

I think supporting cards would be excellent, because visually its a massive improvement, but just not with templated JSON.

@jverger
Copy link
Author

jverger commented Feb 3, 2025

Nevermind, I would have try.
Thank you for your answer.

@grobinson-grafana
Copy link
Contributor

What if you made cards the default instead of a separate field, using the template you have already written? Visually it looks so much better in my opinion!

@jverger
Copy link
Author

jverger commented Feb 7, 2025

Hello @grobinson-grafana !

I'm trying to add a card template in the default.tmpl file but it does not work (and i don't know why 😢 )
The error message looks like this:
level=ERROR source=dispatch.go:360 msg="Notify for alerts failed" component=dispatcher num_alerts=1 err="teams/msteamsv2[0]: notify retry canceled due to unrecoverable error after 1 attempts: template: :1:12: executing \"\" at <{{template \"msteamsv2.default.card\" .}}>: template \"msteamsv2.default.card\" not defined"

I think that i've correctly defined the card template but it does not seem to detect it...

Some help is needed

@ewencodes
Copy link

ewencodes commented Feb 24, 2025

Hi @jverger, did you rename your template function to msteamsv2.default.card in default.tmpl ?

Your card is more readable then the existing one, we need your template to be used as default one :)

@deejiw deejiw force-pushed the feature/msteams_card branch 2 times, most recently from 2978d90 to df4fd79 Compare February 26, 2025 16:03
jverger and others added 9 commits February 26, 2025 23:06
Signed-off-by: jverger <[email protected]>
Signed-off-by: Tossaporn Jiw <[email protected]>
Signed-off-by: jverger <[email protected]>
Signed-off-by: Tossaporn Jiw <[email protected]>
Signed-off-by: Anastasios_Dados <[email protected]>
Signed-off-by: Tossaporn Jiw <[email protected]>
…on (prometheus#4258)

The update addresses failing GitHub Actions caused by the deprecation of
v3 actions/upload-artifact and actions/download-artifact APIs.

This change:
- Updates promci from previous version to v0.4.6
- I hope resolves CI failures in artifact upload/download steps

Signed-off-by: Raúl Naveiras <[email protected]>
Signed-off-by: Tossaporn Jiw <[email protected]>
…on (prometheus#4259)

Same as prometheus#4258

The update addresses failing GitHub Actions caused by the deprecation of
v3 actions/upload-artifact and actions/download-artifact APIs.

This change:
- Updates promci from previous version to v0.4.6
- I hope resolves CI failures in artifact upload/download steps

https://github.com/prometheus/promci/releases/tag/v0.4.6
https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/

Signed-off-by: Raúl Naveiras <[email protected]>
Signed-off-by: Tossaporn Jiw <[email protected]>
Signed-off-by: Tossaporn Jiw <[email protected]>
Signed-off-by: Tossaporn Jiw <[email protected]>
Signed-off-by: Tossaporn Jiw <[email protected]>
@deejiw deejiw force-pushed the feature/msteams_card branch from 98cbaa5 to f69c86a Compare February 26, 2025 16:06
@deejiw
Copy link

deejiw commented Feb 26, 2025

@ewencodes @grobinson-grafana I have updated the default card template as per request. Is it what you are expected?

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

Successfully merging this pull request may close these issues.

6 participants