Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,16 @@ resources:
pause_status: "UNPAUSED"
quartz_cron_schedule: "0 0 8 * * ?" # Run daily at 8 AM UTC
timezone_id: "UTC"

# This alert is configured identically to the above alert, but it refers to a .dbalert.json file
# instead of inlining the configuration in YAML. We recommend inlining the configuration in YAML
# when you need to productionize the alert across different target (dev, staging, prod) and
# using a .dbalert.json file when you have a single target alert that you author in the Databricks UI
# or using the databricks bundle generate alert command.
nyc_taxi_daily_revenue_as_file:
permissions:
- level: CAN_MANAGE
user_name: user@company.com
display_name: "NYC Taxi Daily Revenue Alert as File"
warehouse_id: ${var.warehouse_id}
file_path: ./nyc_taxi_daily_revenue_as_file.dbalert.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"custom_summary": "Alert when NYC Taxi daily revenue exceeds threshold",
"evaluation": {
"source": {
"name": "amount",
"display": "amount",
"aggregation": "MAX"
},
"comparison_operator": "GREATER_THAN",
"threshold": {
"value": {
"double_value": 1000000.0
}
},
"notification": {
"retrigger_seconds": 3600,
"notify_on_ok": false
}
},
"schedule": {
"quartz_cron_schedule": "0 0 8 * * ?",
"timezone_id": "UTC"
},
"query_lines": [
"SELECT",
" to_date(tpep_pickup_datetime) as date,",
" SUM(fare_amount) as amount",
"FROM",
" `samples`.`nyctaxi`.`trips`",
"GROUP BY",
" ALL",
"ORDER BY",
" 1 DESC"
]
}