@@ -2,16 +2,16 @@ locals {
22
33 fn_name_for_alerts_exceptions = var. env_short != " p" ? [] : [
44 {
5- id : " paymentoptionprocessor "
6- name : " PaymentOptionProcessor "
5+ id : " cdc-raw-auto.apd.payment_option "
6+ name : " cdc-raw-auto.apd.payment_option "
77 },
88 {
9- id : " paymentpositionprocessor "
10- name : " PaymentPositionProcessor "
9+ id : " cdc-raw-auto.apd.payment_position "
10+ name : " cdc-raw-auto.apd.payment_position "
1111 },
1212 {
13- id : " transferprocessor "
14- name : " TransferProcessor "
13+ id : " cdc-raw-auto.apd.transfer "
14+ name : " cdc-raw-auto.apd.transfer "
1515 }
1616 ]
1717
@@ -41,7 +41,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-av
4141 query = format (<<- QUERY
4242let threshold = 0.99;
4343union traces, exceptions
44- | where cloud_RoleName == "pagopa-gpd-ingestion-manager "
44+ | where cloud_RoleName == "pagopagpdingestionmanager "
4545| where operation_Name == "%s"
4646//| summarize count() by operation_Name, itemType
4747| summarize
@@ -75,15 +75,15 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
7575 custom_webhook_payload = " {}"
7676 }
7777 data_source_id = data. azurerm_application_insights . application_insights . id
78- description = " Error on JsonProcessing gpd-ingestion ${ each . value . name } "
78+ description = " ${ each . value . name } ingestion error JsonProcessingException "
7979 enabled = true
8080 query = format (<<- QUERY
8181 traces
8282 | where cloud_RoleName == "%s"
8383 | order by timestamp desc
84- | where message contains "function error JsonProcessingException"
84+ | where message contains "${ each . value . name } ingestion error JsonProcessingException"
8585 QUERY
86- , " pagopa-gpd-ingestion-manager "
86+ , " pagopagpdingestionmanager "
8787 )
8888 severity = 2 // Sev 2 Warning
8989 frequency = 15
@@ -115,7 +115,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
115115 | order by timestamp desc
116116 | where message contains "function error Generic exception at"
117117 QUERY
118- , " pagopa-gpd-ingestion-manager "
118+ , " pagopagpdingestionmanager "
119119 )
120120 severity = 2 // Sev 2 Warning
121121 frequency = 15
@@ -139,15 +139,15 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
139139 custom_webhook_payload = " {}"
140140 }
141141 data_source_id = data. azurerm_application_insights . application_insights . id
142- description = " Error on PDVTokenizerException gpd-ingestion ${ each . value . name } "
142+ description = " ${ each . value . name } ingestion error PDVTokenizerException "
143143 enabled = true
144144 query = format (<<- QUERY
145145 traces
146146 | where cloud_RoleName == "%s"
147147 | order by timestamp desc
148- | where message contains "function error PDVTokenizerException exception at "
148+ | where message contains "${ each . value . name } ingestion error PDVTokenizerException"
149149 QUERY
150- , " pagopa-gpd-ingestion-manager "
150+ , " pagopagpdingestionmanager "
151151 )
152152 severity = 2 // Sev 2 Warning
153153 frequency = 15
@@ -171,15 +171,15 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
171171 custom_webhook_payload = " {}"
172172 }
173173 data_source_id = data. azurerm_application_insights . application_insights . id
174- description = " Error on PDVTokenizerUnexpectedException gpd-ingestion ${ each . value . name } "
174+ description = " ${ each . value . name } ingestion error PDVTokenizerUnexpectedException "
175175 enabled = true
176176 query = format (<<- QUERY
177177 traces
178178 | where cloud_RoleName == "%s"
179179 | order by timestamp desc
180- | where message contains "function error PDVTokenizerUnexpectedException exception at "
180+ | where message contains "${ each . value . name } ingestion error PDVTokenizerUnexpectedException"
181181 QUERY
182- , " pagopa-gpd-ingestion-manager "
182+ , " pagopagpdingestionmanager "
183183 )
184184 severity = 2 // Sev 2 Warning
185185 frequency = 15
@@ -209,17 +209,18 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "gpd-ingestion-manager-er
209209 query = format (<<- QUERY
210210 exceptions
211211 | where cloud_RoleName == "%s"
212- | where outerMessage contains "Exception while executing function: Functions.${ each . value . name } "
212+ //| where outerMessage contains "${ each . value . name } ingestion error Generic exception"
213+ | where operation_Name startswith "${ each . value . name } "
213214 | order by timestamp desc
214215 QUERY
215- , " pagopa-gpd-ingestion-manager " # from HELM's parameter WEBSITE_SITE_NAME
216+ , " pagopagpdingestionmanager " # from HELM's parameter WEBSITE_SITE_NAME
216217 )
217218 severity = 2 // Sev 2 Warning
218219 frequency = 15
219220 time_window = 15
220221 trigger {
221222 operator = " GreaterThanOrEqual"
222- threshold = 20
223+ threshold = 30
223224 }
224225
225226}
0 commit comments