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

Remove environment name from Airflow Alerts message username #4613

Closed
sarayourfriend opened this issue Jul 15, 2024 · 3 comments · Fixed by #4652
Closed

Remove environment name from Airflow Alerts message username #4613

sarayourfriend opened this issue Jul 15, 2024 · 3 comments · Fixed by #4652
Assignees
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: infra Related to the Terraform config and other infrastructure 🔒 staff only Restricted to staff members

Comments

@sarayourfriend
Copy link
Contributor

sarayourfriend commented Jul 15, 2024

Problem

Airflow alerts include the environment "production" in the username in Slack:
image

The message above is about the staging ES cluster. But the username of the message makes it easy to get confused and think it's for the production cluster.

Description

We have a single channel for alerts from the live Airflow instance. Any alerts going to that channel must be from the live instance and must never be from another source (outside of specific testing scenarios where this is communicated extremely clearly). The channel is exclusively for important alerts that need to be triaged.

In other words, the contract of that channel is such that the alerts are only from the live instance. This does not need to be clarified in every message from the live instance. Therefore, we can remove the "environment" name from the message username.

To fix this, remove the environment note from the username here:

environment = Variable.get("ENVIRONMENT", default_var="local")
s = SlackMessage(
f"{username} | {environment}",
icon_emoji,
unfurl_links,
unfurl_media,
http_conn_id=http_conn_id,
)

If we want to make sure locally created messages can under no circumstances be confused for real ones, even if they are somehow mistakenly sent to the live channel, we can modify the message body to indicate this when ENVIRONMENT == "local" or something... but I don't think this is expressly necessary.

@sarayourfriend sarayourfriend added 🟧 priority: high Stalls work on the project or its dependents 🤖 aspect: dx Concerns developers' experience with the codebase 🔒 staff only Restricted to staff members 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🧱 stack: infra Related to the Terraform config and other infrastructure labels Jul 15, 2024
@zackkrida
Copy link
Member

For these messages as well, maybe we should pass the service name as the title so the full title would be something like "Airflow Alert | Elasticsearch Staging Cluster"

@sarayourfriend
Copy link
Contributor Author

Nice! Good idea to lead with the environment name, even: "Staging ES cluster"/"Production ES cluster". Along with abbreviating ES in the title, it helps the environment not get lost or glossed over, which is really the important thing here.

@AetherUnbound
Copy link
Contributor

For these kinds of alerts, we can also change the icon used for the alert itself in Slack, perhaps for even further distinction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: infra Related to the Terraform config and other infrastructure 🔒 staff only Restricted to staff members
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants