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

Allow users to customize the Teams message card #12

Closed
bzon opened this issue Mar 23, 2018 · 12 comments
Closed

Allow users to customize the Teams message card #12

bzon opened this issue Mar 23, 2018 · 12 comments
Labels

Comments

@bzon
Copy link
Collaborator

bzon commented Mar 23, 2018

Using the Go templating engine, we can include a feature to let the user create their own YAML templates and feed it to prometheus-msteams. The teams message card creation reference is here https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/cards/cards-reference.

We can add a new function named CreateCardFromTemplates that will be called if the user use the --card-template $TEMPLATE_FILE.

@bzon bzon added the enhancement New feature or request label Mar 23, 2018
@bzon bzon closed this as completed Apr 30, 2018
@bzon bzon reopened this Nov 5, 2018
@bzon bzon changed the title The JSON schema to be sent in Teams can come from a Template Allow users to customize the Teams message card Nov 5, 2018
@bzon bzon added feature and removed enhancement New feature or request labels Nov 5, 2018
@Knappek
Copy link
Collaborator

Knappek commented Jan 29, 2019

Did somebody already start to work on that? If not, I would do so.

@bzon
Copy link
Collaborator Author

bzon commented Jan 30, 2019

@Knappek I haven’t planned on working on this yet. Feel free to play around and see how you can bring this feature to life. Thanks.

@Knappek
Copy link
Collaborator

Knappek commented Mar 11, 2019

Just realized that a message card is not only limited to a size of 14KB but also to a maximum number of 10 sections (see https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/cards/cards-reference#notes-on-the-office-365-connector-card). Hence, we still have a bug that seemed to be fixed #29 . I will address this in the PR for this issue.

@Knappek
Copy link
Collaborator

Knappek commented Mar 11, 2019

@bzon I have created another PR draft: #37. We might need to talk about how to handle too large message cards as I think this might not be possible anymore using this templating approach (see my last commit).
Therefore, I thought of make it super easy and send out a teams message for each and every prometheus alert.

@Knappek
Copy link
Collaborator

Knappek commented Mar 12, 2019

@bzon is very busy these days, therefor I'd like to have some input from other folks. @LudwigTirazona @shabeermm @daviddob what do you think about sending out a teams message for each and every prometheus alert and don't combine multiple alerts to a single teams message card. Would that be a problem for you? I want to have your opinion on that as you were involved in #29.

@LudwigTirazona
Copy link

LudwigTirazona commented Mar 12, 2019 via email

@Knappek
Copy link
Collaborator

Knappek commented Mar 12, 2019

Good point, I didn't know about the MS Teams api rate limit. I agree that it is more appropriate to bundle alerts to single message cards...

Then I'd like to verify my assumptions how to split messages in case that they are too big: Referencing a detailed example teams message card we need to split the sections part as this is the part where we loop over the prometheus alerts as shown in this example card template, am I right?

@LudwigTirazona
Copy link

Correct! :)

@Knappek
Copy link
Collaborator

Knappek commented Mar 18, 2019

PR #37 implements the functionality described in this issue. Just a few little things missing (like updating Readme etc.) that I will add in the upcoming days.
Would be great if some people can already test it and provide some feedback. @sosoriov this might be of interest for you as well.

@Knappek
Copy link
Collaborator

Knappek commented Mar 22, 2019

@cordula-grau fyi, this enhancement solves #27 .

@Knappek
Copy link
Collaborator

Knappek commented Mar 25, 2019

opened PR #37 . Would appreciate some code review, otherwise I'll merge it in the next couple of days and create the minor release 1.1.0.

@Knappek
Copy link
Collaborator

Knappek commented Mar 26, 2019

This feature is now available in v1.1.0 release.

@Knappek Knappek closed this as completed Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants