Skip to content
Draft
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
10 changes: 10 additions & 0 deletions knowledge_base/alerts/resources/high_value_orders.alert.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resources:
alerts:
high_value_orders:
permissions:
- level: CAN_MANAGE
user_name: user@company.com

warehouse_id: ${var.warehouse_id}
display_name: "High Value Urgent Orders Alert"
file_path: ./high_value_orders.dbalert.json
43 changes: 43 additions & 0 deletions knowledge_base/alerts/resources/high_value_orders.dbalert.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"custom_summary": "Alert when high-value urgent orders are detected",
"custom_description_lines": [
"This alert monitors urgent orders (priority 1-URGENT) in the TPC-H dataset",
"and triggers when the total order value exceeds a threshold.",
"Use this to track potentially important customer orders that need immediate attention."
],
"evaluation": {
"comparison_operator": "GREATER_THAN",
"notification": {
"notify_on_ok": false,
"retrigger_seconds": 7200
},
"source": {
"aggregation": "MAX",
"display": "total_urgent_value",
"name": "total_urgent_value"
},
"threshold": {
"value": {
"double_value": 500000.0
}
}
},
"query_lines": [
"SELECT",
" o_orderpriority,",
" COUNT(*) as order_count,",
" SUM(o_totalprice) as total_urgent_value",
"FROM",
" samples.tpch.orders",
"WHERE",
" o_orderpriority = '1-URGENT'",
" AND o_orderdate >= CURRENT_DATE() - INTERVAL 7 DAYS",
"GROUP BY",
" o_orderpriority"
],
"schedule": {
"pause_status": "UNPAUSED",
"quartz_cron_schedule": "0 0 */6 * * ?",
"timezone_id": "UTC"
}
}