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

MAIN-2798 - Opsgenie slack #1673

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

MAIN-2798 - Opsgenie slack #1673

wants to merge 7 commits into from

Conversation

Avi-Robusta
Copy link
Contributor

@Avi-Robusta Avi-Robusta commented Jan 2, 2025

this adds additional params to every action from a slack callback
slack_username - the user that clicked on the slack callback
slack_message - has metadata that can be used to change the slack message on button click

customPlaybooks:
 - actions:
 # adds link to opsgenie alert in slack
   - opsgenie_link_enricher:
       url_base: robusta-test-url.app.eu.opsgenie.com #needed here, url isnt in opsgenie config
   - ack_slack_opsgenie_enricher: {}
   triggers:
   - on_prometheus_alert: {}

@Avi-Robusta Avi-Robusta changed the title Opsgenie slack MAIN-2798 - Opsgenie slack Jan 7, 2025
@Avi-Robusta Avi-Robusta marked this pull request as ready for review January 7, 2025 07:13
Copy link
Contributor

@moshemorad moshemorad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments, let me know what do you think.

playbooks/robusta_playbooks/sink_enrichments.py Outdated Show resolved Hide resolved
playbooks/robusta_playbooks/sink_enrichments.py Outdated Show resolved Hide resolved
src/robusta/core/reporting/base.py Outdated Show resolved Hide resolved
playbooks/robusta_playbooks/sink_enrichments.py Outdated Show resolved Hide resolved
playbooks/robusta_playbooks/sink_enrichments.py Outdated Show resolved Hide resolved
src/robusta/core/sinks/opsgenie/opsgenie_sink.py Outdated Show resolved Hide resolved
src/robusta/core/sinks/opsgenie/opsgenie_sink.py Outdated Show resolved Hide resolved
src/robusta/integrations/receiver.py Outdated Show resolved Hide resolved
logging.warning("No actions found in the Slack message.")
return

block_id = actions[0].get("block_id")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If in the future we will have mutlipe action what will happen? Why we aren't also checking the action name and making sure that this is indeed the action block and not only assume it is the first one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2025-01-08 at 14 19 46
screen shot of the slack action, in the future it will be broken.
This is not currently a functionality we can support or handle on our end so more dev will need to be done to support it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we can't find the right action using the text of something like that?

Copy link
Contributor Author

@Avi-Robusta Avi-Robusta Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name is not always guaranteed, the text here has no action as you see
The only thing guarenteed here is the block_id that was clicked in the callback
Also simplicity is key, if we overcomplicate it by searching for specific text and the text changes in runner that is worse than relying on the ID

Copy link
Contributor

@moshemorad moshemorad Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly i don't think it is worst, If you think it is high effort open ticket to support multiple action in that case and we will do it on next sprint.
Thanks.

src/robusta/core/sinks/slack/slack_sink.py Outdated Show resolved Hide resolved
Copy link
Contributor

@moshemorad moshemorad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small things.

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.

2 participants