jertel / elastalert2

ElastAlert 2 is a continuation of the original yelp/elastalert project. Pull requests are appreciated!
https://elastalert2.readthedocs.org
Apache License 2.0
859 stars 277 forks source link

Allow any msg color for Slack #1375

Closed thecatontheflat closed 1 month ago

thecatontheflat commented 5 months ago

Description

Allows any color for Slack messages. Currently only 3 values are supported in the library, but I would like it to be any hex color value as per their docs: https://api.slack.com/reference/messaging/attachments#fieldsts

Changes the color of the border on the left side of this attachment from the default gray. Can either be one of good (green), warning (yellow), danger (red), or any hex color code (eg. #439FE0)

Checklist

Questions or Comments

If you think this change makes sense, I'll continue with the checklist

jertel commented 5 months ago

I think it sounds like a good improvement. It would be good to document what the behavior is if an invalid color name or hex code is given, so that users can be aware of what to look for in case they make a mistake. Such as forgetting to prepend the hex char, etc.

nsano-rururu commented 5 months ago

I think the documentation should be updated as well. https://github.com/jertel/elastalert2/blob/master/docs/source/alerts.rst

nsano-rururu commented 5 months ago

I think similar settings for mattermost and rocketcat need modification as well.

thecatontheflat commented 5 months ago

Updated the docs according to Slack documentation for the color.

jertel commented 4 months ago

@thecatontheflat Once you complete the remaining checklist items I will merge this. It looks like you already completed the doc updates so that can probably be checked off, and I'm not sure whether a unit test is feasible for a schema change, but the other two checklist items need completed.

github-actions[bot] commented 3 months ago

This PR is stale because it has been open for 30 days with no activity. The longer a PR remains stale the more out of date with the main branch it becomes.

nsano-rururu commented 3 months ago

@thecatontheflat

Have you verified that the settings are working?

nsano-rururu commented 3 months ago

@thecatontheflat

Please update CHANGELOG.md.

nsano-rururu commented 3 months ago

@thecatontheflat

Is it possible to create test code?

github-actions[bot] commented 2 months ago

This PR is stale because it has been open for 30 days with no activity. The longer a PR remains stale the more out of date with the main branch it becomes.

github-actions[bot] commented 1 month ago

This PR was closed because it has been inactive for 30 days since being marked as stale. It will be automatically locked after an additional 30 days. If there is still a commitment to finishing this PR please re-open it, or request that a project maintainer re-open it before it becomes locked.