From 54e8e29d3bbcb9e338476c96e3fcccf2f66fc87e Mon Sep 17 00:00:00 2001 From: Luca Cavallaro Date: Wed, 7 Feb 2024 14:48:48 +0100 Subject: [PATCH] [IOPID-1399] Add opex dashboard for "api_backend" (#1095) --- .github/workflows/opex_api_backend.yml | 23 ++++++++++++++++ .github/workflows/pr_opex_api_backend.yml | 30 +++++++++++++++++++++ .opex/api_backend/env/prod/backend.ini | 1 + .opex/api_backend/env/prod/backend.tfvars | 4 +++ .opex/api_backend/env/prod/config.yaml | 18 +++++++++++++ .opex/api_backend/env/prod/terraform.tfvars | 10 +++++++ 6 files changed, 86 insertions(+) create mode 100644 .github/workflows/opex_api_backend.yml create mode 100644 .github/workflows/pr_opex_api_backend.yml create mode 100644 .opex/api_backend/env/prod/backend.ini create mode 100644 .opex/api_backend/env/prod/backend.tfvars create mode 100644 .opex/api_backend/env/prod/config.yaml create mode 100644 .opex/api_backend/env/prod/terraform.tfvars diff --git a/.github/workflows/opex_api_backend.yml b/.github/workflows/opex_api_backend.yml new file mode 100644 index 000000000..608d78310 --- /dev/null +++ b/.github/workflows/opex_api_backend.yml @@ -0,0 +1,23 @@ +name: Opex Dashboard api_backend + +on: + push: + branches: + - master + paths: + - 'openapi/generated/api_backend.yaml' + - '.github/workflows/opex_api_backend.yml' + - '.opex/api_backend/**' + + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + +jobs: + apply: + uses: ./.github/workflows/call_opex_api.yml + name: Apply changes to Production + secrets: inherit + with: + api_name: api_backend diff --git a/.github/workflows/pr_opex_api_backend.yml b/.github/workflows/pr_opex_api_backend.yml new file mode 100644 index 000000000..a5de55f4f --- /dev/null +++ b/.github/workflows/pr_opex_api_backend.yml @@ -0,0 +1,30 @@ +name: PR - Opex Dashboard api_backend + +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + branches: + - master + paths: + - 'api_backend.yaml' + - '.github/workflows/pr_opex_api_backend.yml' + - '.github/workflows/opex_api_backend.yml' + - '.opex/api_backend/**' + + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: false + +jobs: + plan: + uses: ./.github/workflows/call_pr_opex_api.yml + name: Plan changes against Production + secrets: inherit + with: + api_name: api_backend diff --git a/.opex/api_backend/env/prod/backend.ini b/.opex/api_backend/env/prod/backend.ini new file mode 100644 index 000000000..cf83055f5 --- /dev/null +++ b/.opex/api_backend/env/prod/backend.ini @@ -0,0 +1 @@ +subscription=PROD-IO diff --git a/.opex/api_backend/env/prod/backend.tfvars b/.opex/api_backend/env/prod/backend.tfvars new file mode 100644 index 000000000..de73692f8 --- /dev/null +++ b/.opex/api_backend/env/prod/backend.tfvars @@ -0,0 +1,4 @@ +resource_group_name = "terraform-state-rg" +storage_account_name = "tfappprodio" +container_name = "terraform-state" +key = "opex.io-backend.api_backend.tfstate" diff --git a/.opex/api_backend/env/prod/config.yaml b/.opex/api_backend/env/prod/config.yaml new file mode 100644 index 000000000..7a9160956 --- /dev/null +++ b/.opex/api_backend/env/prod/config.yaml @@ -0,0 +1,18 @@ +oa3_spec: api_backend.yaml +name: opex_iobackend_api_backend +location: West Europe +timespan: 5m +evaluation_frequency: 10 +evaluation_time_window: 30 +event_occurrences: 4 # After 5*4=20 min +data_source: /subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway +action_groups: + - /subscriptions/EC285037-C673-4F58-B594-D7C480DA4E8B/resourceGroups/io-p-rg-common/providers/microsoft.insights/actionGroups/iopquarantineerror +overrides: + hosts: + - app-backend.io.italia.it + - api-app.io.pagopa.it + endpoints: + /api/v1/profile: + response_time_threshold: 8 + availability_threshold: 0.70 \ No newline at end of file diff --git a/.opex/api_backend/env/prod/terraform.tfvars b/.opex/api_backend/env/prod/terraform.tfvars new file mode 100644 index 000000000..1ac0be8f7 --- /dev/null +++ b/.opex/api_backend/env/prod/terraform.tfvars @@ -0,0 +1,10 @@ +prefix = "io" +env_short = "p" + +tags = { + CreatedBy = "Terraform" + Environment = "Prod" + Owner = "io" + Source = "https://github.com/pagopa/io-backend" + CostCenter = "TS310 - PAGAMENTI & SERVIZI" +}