Skip to content

Commit

Permalink
enabled cdd gpd ingestion PROD
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqualespica committed Dec 18, 2024
1 parent 2189bb6 commit 4202bf3
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 80 deletions.
2 changes: 1 addition & 1 deletion src/domains/gps-app/env/weu-prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ postgres_db_name = "apd"
tasks_max = "1"
container_registry = "pagopapcommonacr.azurecr.io"
max_threads = 10
gpd_cdc_enabled = false
gpd_cdc_enabled = true
2 changes: 1 addition & 1 deletion src/domains/gps-common/env/weu-prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ gpd_sftp_sa_delete = 60
# GPD Archive account
gpd_archive_replication_type = "GZRS"
gpd_sftp_ip_rules = ["37.179.98.148"]
gpd_cdc_enabled = false
gpd_cdc_enabled = true
2 changes: 1 addition & 1 deletion src/domains/observability/03_eventhub_msg_gdp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module "eventhub_namespace_observability_gpd" {
]

metric_alerts_create = var.ehns_alerts_enabled
# metric_alerts = var.ehns_metric_alerts_gpd
metric_alerts = var.ehns_metric_alerts_gpd

tags = var.tags
}
Expand Down
105 changes: 52 additions & 53 deletions src/domains/observability/env/uat/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ eventhubs_gpd = [
name = "gpd-ingestion.apd.payment_option"
partitions = 1
message_retention = 1
consumers = ["gpd-ingestion.apd.payment_option-rx-dl", ]
consumers = ["gpd-ingestion.apd.payment_option-rx-dl"]
keys = [
{
name = "gpd-ingestion.apd.payment_option-rx-dl"
Expand All @@ -306,7 +306,7 @@ eventhubs_gpd = [
name = "gpd-ingestion.apd.payment_position"
partitions = 1
message_retention = 1
consumers = ["gpd-ingestion.apd.payment_position-rx-dl", ]
consumers = ["gpd-ingestion.apd.payment_position-rx-dl"]
keys = [
{
name = "gpd-ingestion.apd.payment_position-rx-dl"
Expand All @@ -326,7 +326,7 @@ eventhubs_gpd = [
name = "gpd-ingestion.apd.transfer"
partitions = 1
message_retention = 1
consumers = ["gpd-ingestion.apd.transfer-rx-dl", ]
consumers = ["gpd-ingestion.apd.transfer-rx-dl"]
keys = [
{
name = "gpd-ingestion.apd.transfer-rx-dl"
Expand All @@ -345,53 +345,52 @@ eventhubs_gpd = [
]


# alert evh
# ehns_metric_alerts_gpd = {
# no_trx = {
# aggregation = "Total"
# metric_name = "IncomingMessages"
# description = "No transactions received from acquirer in the last 24h"
# operator = "LessThanOrEqual"
# threshold = 1000
# frequency = "PT1H"
# window_size = "P1D"
# dimension = [
# {
# name = "EntityName"
# operator = "Include"
# values = ["gec-ingestion-bundles-evt-tx", "gec-ingestion-cibundles-evt-tx", "gec-ingestion-paymenttypes-evt-tx", "gec-ingestion-touchpoints-evt-tx"]
# }
# ],
# },
# active_connections = {
# aggregation = "Average"
# metric_name = "ActiveConnections"
# description = null
# operator = "LessThanOrEqual"
# threshold = 0
# frequency = "PT5M"
# window_size = "PT15M"
# dimension = [],
# },
# error_trx = {
# aggregation = "Total"
# metric_name = "IncomingMessages"
# description = "Transactions rejected from one acquirer file received. trx write on eventhub. check immediately"
# operator = "GreaterThan"
# threshold = 0
# frequency = "PT5M"
# window_size = "PT30M"
# dimension = [
# {
# name = "EntityName"
# operator = "Include"
# values = [
# "gec-ingestion-bundles-evt-rx-pdnd",
# "gec-ingestion-cibundles-evt-rx-pdnd",
# "gec-ingestion-paymenttypes-evt-rx-pdnd",
# "gec-ingestion-touchpoints-evt-rx-pdnd"
# ]
# }
# ],
# },
# }
#  alert evh
ehns_metric_alerts_gpd = {
no_trx = {
aggregation = "Total"
metric_name = "IncomingMessages"
description = "No transactions received from acquirer in the last 24h"
operator = "LessThanOrEqual"
threshold = 1000
frequency = "PT1H"
window_size = "P1D"
dimension = [
{
name = "EntityName"
operator = "Include"
values = ["gpd-ingestion.apd.payment_option-tx", "gpd-ingestion.apd.payment_position-tx","gpd-ingestion.apd.transfer-tx"]
}
],
},
active_connections = {
aggregation = "Average"
metric_name = "ActiveConnections"
description = null
operator = "LessThanOrEqual"
threshold = 0
frequency = "PT5M"
window_size = "PT15M"
dimension = [],
},
error_trx = {
aggregation = "Total"
metric_name = "IncomingMessages"
description = "Transactions rejected from one acquirer file received. trx write on eventhub. check immediately"
operator = "GreaterThan"
threshold = 0
frequency = "PT5M"
window_size = "PT30M"
dimension = [
{
name = "EntityName"
operator = "Include"
values = [
"gpd-ingestion.apd.payment_option-rx-dl",
"gpd-ingestion.apd.payment_position-rx-dl",
"gpd-ingestion.apd.transfer-rx-dl"
]
}
],
},
}
59 changes: 35 additions & 24 deletions src/domains/observability/gpd_evh_create__az.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ set -e

env=$1

if [ "$env" != "p" ]; then
partitioncount=1
retentiontime=24 #hh = 1day
else
partitioncount=32
retentiontime=168 #hh = 1week
fi

echo "partitioncount >> ${partitioncount}"
echo "retentiontime >> ${retentiontime}"


echo ">>>>>> 1"

Expand All @@ -17,8 +28,8 @@ az eventhubs eventhub create \
--namespace-name pagopa-$env-itn-observ-gpd-evh \
--cleanup-policy "Compact" \
--status "Active" \
--partition-count 1 \
--retention-time 24
--partition-count ${partitioncount} \
--retention-time ${retentiontime}

echo ">>>>>> 2"

Expand All @@ -28,8 +39,8 @@ az eventhubs eventhub create \
--namespace-name pagopa-$env-itn-observ-gpd-evh \
--cleanup-policy "Compact" \
--status "Active" \
--partition-count 1 \
--retention-time 24
--partition-count ${partitioncount} \
--retention-time ${retentiontime}

echo ">>>>>> 3"

Expand All @@ -39,8 +50,8 @@ az eventhubs eventhub create \
--namespace-name pagopa-$env-itn-observ-gpd-evh \
--cleanup-policy "Compact" \
--status "Active" \
--partition-count 1 \
--retention-time 24
--partition-count ${partitioncount} \
--retention-time ${retentiontime}

# ==============================================================
# logical topics
Expand All @@ -54,8 +65,8 @@ az eventhubs eventhub create \
--namespace-name pagopa-$env-itn-observ-gpd-evh \
--cleanup-policy "Compact" \
--status "Active" \
--partition-count 1 \
--retention-time 24
--partition-count ${partitioncount} \
--retention-time ${retentiontime}

az eventhubs eventhub authorization-rule create \
--resource-group pagopa-$env-itn-observ-evh-rg \
Expand All @@ -72,15 +83,15 @@ az eventhubs eventhub create \
--namespace-name pagopa-$env-itn-observ-gpd-evh \
--cleanup-policy "Compact" \
--status "Active" \
--partition-count 1 \
--retention-time 24
--partition-count ${partitioncount} \
--retention-time ${retentiontime}

az eventhubs eventhub authorization-rule create \
--resource-group pagopa-$env-itn-observ-evh-rg \
--namespace-name pagopa-$env-itn-observ-gpd-evh \
--eventhub-name cdc-raw-auto.apd.payment_position \
--name cdc-raw-auto.apd.payment_position-rx \
--rights Listen
# az eventhubs eventhub authorization-rule create \
# --resource-group pagopa-$env-itn-observ-evh-rg \
# --namespace-name pagopa-$env-itn-observ-gpd-evh \
# --eventhub-name cdc-raw-auto.apd.payment_position \
# --name cdc-raw-auto.apd.payment_position-rx \
# --rights Listen

echo ">>>>>> 6"

Expand All @@ -90,13 +101,13 @@ az eventhubs eventhub create \
--namespace-name pagopa-$env-itn-observ-gpd-evh \
--cleanup-policy "Compact" \
--status "Active" \
--partition-count 1 \
--retention-time 24
--partition-count ${partitioncount} \
--retention-time ${retentiontime}


az eventhubs eventhub authorization-rule create \
--resource-group pagopa-$env-itn-observ-evh-rg \
--namespace-name pagopa-$env-itn-observ-gpd-evh \
--eventhub-name cdc-raw-auto.apd.transfer \
--name cdc-raw-auto.apd.transfer-rx \
--rights Listen
# az eventhubs eventhub authorization-rule create \
# --resource-group pagopa-$env-itn-observ-evh-rg \
# --namespace-name pagopa-$env-itn-observ-gpd-evh \
# --eventhub-name cdc-raw-auto.apd.transfer \
# --name cdc-raw-auto.apd.transfer-rx \
# --rights Listen

0 comments on commit 4202bf3

Please sign in to comment.