Challenge - 5 Problems
PagerDuty and Slack Integration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of Airflow task notifying PagerDuty
Given this Airflow PythonOperator task code snippet that triggers a PagerDuty incident notification, what will be the output in the Airflow logs if the PagerDuty API key is invalid?
Apache Airflow
def notify_pagerduty(): import requests url = 'https://events.pagerduty.com/v2/enqueue' payload = { "routing_key": "INVALID_API_KEY", "event_action": "trigger", "payload": { "summary": "Test incident", "source": "airflow", "severity": "error" } } response = requests.post(url, json=payload) print(response.status_code) print(response.json())
Attempts:
2 left
💡 Hint
Think about what HTTP status code PagerDuty returns for invalid keys.
✗ Incorrect
PagerDuty returns a 400 Bad Request status with a message indicating the routing key is invalid when the API key is wrong.
❓ Configuration
intermediate1:30remaining
Correct Slack webhook URL format in Airflow Variable
Which of the following is the correct format to store a Slack Incoming Webhook URL in an Airflow Variable for use in a Slack notification task?
Attempts:
2 left
💡 Hint
Slack webhooks use HTTPS URLs starting with https://
✗ Incorrect
The Slack Incoming Webhook URL must start with https:// to be valid and secure.
🔀 Workflow
advanced2:30remaining
Order of steps to integrate Airflow with PagerDuty and Slack
Arrange the steps in the correct order to integrate Airflow with PagerDuty and Slack for alert notifications.
Attempts:
2 left
💡 Hint
Think about what credentials you need before storing and using them.
✗ Incorrect
You must first create the PagerDuty service and Slack webhook, then store their keys in Airflow, and finally create tasks that use those keys.
❓ Troubleshoot
advanced2:00remaining
Identifying cause of Slack notification failure in Airflow
An Airflow task that sends Slack notifications fails with this error: "requests.exceptions.ConnectionError: HTTPSConnectionPool(host='hooks.slack.com', port=443): Max retries exceeded". What is the most likely cause?
Attempts:
2 left
💡 Hint
Connection errors usually relate to network problems.
✗ Incorrect
Max retries exceeded on HTTPS connection usually means network connectivity issues, such as no internet access from Airflow worker.
✅ Best Practice
expert3:00remaining
Best practice for secure storage of PagerDuty and Slack credentials in Airflow
Which is the best practice for securely managing PagerDuty routing keys and Slack webhook URLs in Airflow for production use?
Attempts:
2 left
💡 Hint
Think about how to keep secrets safe and avoid exposure in code or UI.
✗ Incorrect
Using Airflow's Secret Backend allows secure encrypted storage and controlled access to sensitive keys.