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

fix: 00_alert_gpd_ingestion.tf #2694

Merged
merged 4 commits into from
Dec 24, 2024
Merged
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
41 changes: 21 additions & 20 deletions src/domains/gps-app/00_alert_gpd_ingestion.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ locals {

fn_name_for_alerts_exceptions = var.env_short != "p" ? [] : [
{
id : "paymentoptionprocessor"
name : "PaymentOptionProcessor"
id : "cdc-raw-auto.apd.payment_option"
name : "cdc-raw-auto.apd.payment_option"
},
{
id : "paymentpositionprocessor"
name : "PaymentPositionProcessor"
id : "cdc-raw-auto.apd.payment_position"
name : "cdc-raw-auto.apd.payment_position"
},
{
id : "transferprocessor"
name : "TransferProcessor"
id : "cdc-raw-auto.apd.transfer"
name : "cdc-raw-auto.apd.transfer"
}
]

Expand Down Expand Up @@ -41,7 +41,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-av
query = format(<<-QUERY
let threshold = 0.99;
union traces, exceptions
| where cloud_RoleName == "pagopa-gpd-ingestion-manager"
| where cloud_RoleName == "pagopagpdingestionmanager"
| where operation_Name == "%s"
//| summarize count() by operation_Name, itemType
| summarize
Expand Down Expand Up @@ -75,15 +75,15 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
custom_webhook_payload = "{}"
}
data_source_id = data.azurerm_application_insights.application_insights.id
description = "Error on JsonProcessing gpd-ingestion ${each.value.name}"
description = "${each.value.name} ingestion error JsonProcessingException"
enabled = true
query = format(<<-QUERY
traces
| where cloud_RoleName == "%s"
| order by timestamp desc
| where message contains "function error JsonProcessingException"
| where message contains "${each.value.name} ingestion error JsonProcessingException"
QUERY
, "pagopa-gpd-ingestion-manager"
, "pagopagpdingestionmanager"
)
severity = 2 // Sev 2 Warning
frequency = 15
Expand Down Expand Up @@ -115,7 +115,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
| order by timestamp desc
| where message contains "function error Generic exception at"
QUERY
, "pagopa-gpd-ingestion-manager"
, "pagopagpdingestionmanager"
)
severity = 2 // Sev 2 Warning
frequency = 15
Expand All @@ -139,15 +139,15 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
custom_webhook_payload = "{}"
}
data_source_id = data.azurerm_application_insights.application_insights.id
description = "Error on PDVTokenizerException gpd-ingestion ${each.value.name}"
description = "${each.value.name} ingestion error PDVTokenizerException"
enabled = true
query = format(<<-QUERY
traces
| where cloud_RoleName == "%s"
| order by timestamp desc
| where message contains "function error PDVTokenizerException exception at"
| where message contains "${each.value.name} ingestion error PDVTokenizerException"
QUERY
, "pagopa-gpd-ingestion-manager"
, "pagopagpdingestionmanager"
)
severity = 2 // Sev 2 Warning
frequency = 15
Expand All @@ -171,15 +171,15 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
custom_webhook_payload = "{}"
}
data_source_id = data.azurerm_application_insights.application_insights.id
description = "Error on PDVTokenizerUnexpectedException gpd-ingestion ${each.value.name}"
description = "${each.value.name} ingestion error PDVTokenizerUnexpectedException"
enabled = true
query = format(<<-QUERY
traces
| where cloud_RoleName == "%s"
| order by timestamp desc
| where message contains "function error PDVTokenizerUnexpectedException exception at"
| where message contains "${each.value.name} ingestion error PDVTokenizerUnexpectedException"
QUERY
, "pagopa-gpd-ingestion-manager"
, "pagopagpdingestionmanager"
)
severity = 2 // Sev 2 Warning
frequency = 15
Expand Down Expand Up @@ -209,17 +209,18 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
query = format(<<-QUERY
exceptions
| where cloud_RoleName == "%s"
| where outerMessage contains "Exception while executing function: Functions.${each.value.name}"
//| where outerMessage contains "${each.value.name} ingestion error Generic exception"
| where operation_Name startswith "${each.value.name}"
| order by timestamp desc
QUERY
, "pagopa-gpd-ingestion-manager" # from HELM's parameter WEBSITE_SITE_NAME
, "pagopagpdingestionmanager" # from HELM's parameter WEBSITE_SITE_NAME
)
severity = 2 // Sev 2 Warning
frequency = 15
time_window = 15
trigger {
operator = "GreaterThanOrEqual"
threshold = 20
threshold = 30
}

}
Loading