Skip to content

Commit

Permalink
fix: [CHK-3593] Parametric percentage threshold for real time process…
Browse files Browse the repository at this point in the history
…ing queue alert (#2725)

* use percentage threshold in place of fixed value for high traffic

* set percentage threshold for real time processing queue

* fix description

---------

Co-authored-by: Gianluca Ciuffa <[email protected]>
  • Loading branch information
ciuffagianluca and Gianluca Ciuffa authored Jan 17, 2025
1 parent 58f58e5 commit 0830a1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/domains/ecommerce-common/03_storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "ecommerce_transient_enqu
custom_webhook_payload = "{}"
}
data_source_id = module.ecommerce_storage_transient.id
description = format("Enqueuing rate for queue %s > ${each.value.threshold} during last ${each.value.time_window} minutes", replace("${each.value.queue_key}", "-", " "))
description = format("Enqueuing rate for queue %s > 1 percent threshold of 'PutMessage' (at least 10) during last ${each.value.time_window} minutes", replace("${each.value.queue_key}", "-", " "))
enabled = true
query = format(<<-QUERY
let OpCountForQueue = (operation: string, queueKey: string) {
Expand All @@ -365,7 +365,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "ecommerce_transient_enqu
| project PutCount, DeleteCount, Diff
};
MessageRateForQueue("%s")
| where Diff > ${each.value.threshold}
| where Diff > max_of(PutCount/100, ${each.value.threshold})
QUERY
, "/${module.ecommerce_storage_transient.name}/${local.project}-${each.value.queue_key}"
)
Expand Down

0 comments on commit 0830a1b

Please sign in to comment.