Skip to content

Conversation

robbcocco
Copy link
Collaborator

@robbcocco robbcocco commented Jun 30, 2025

Depends on #1206 and #1234, io-infra PR 1591

List of Changes

Duplication of all endpoints following option 2 from RFC 1156

Motivation and Context

These changes enable us to seamlessly update the client to the new routes without service interruptions by having both new and legacy endpoints available at the same time

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

BurnedMarshal and others added 30 commits May 19, 2025 17:38
* Remove local package definition reference with remote url

* Remove unused user-metadata apis

* Migrate api_backend.template.yaml to OpenAPI 3

* Refactor Services domain API specifications

* Remove unused bonus api and related code

* Refactor cgn into a single file
Update dependencies

* Update link to card-func openapi

* Refactor notifications

* Refactor openapi public and trial into platform

* Refactor app_io_*

* Restore root files

* Update openapi cgn

* Refactor openapi session

* Fix lint errors

* Fix type import in unit test

---------

Co-authored-by: Daniele Manni <dan.manni@gmail.com>

Fix Opex pipelines
Fix base path first lollipop consumer

Update specs after rebase

Add missing operation id to getServicesStatus API
Co-authored-by: Greta Quadrati <75862507+gquadrati@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Jun 30, 2025

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOPLT-1167

@robbcocco robbcocco force-pushed the IOPLT-1167-duplication-of-endpoints-for-proxy branch from 946aaf4 to 6e81d9f Compare July 1, 2025 10:31
@robbcocco robbcocco force-pushed the IOPLT-1167-duplication-of-endpoints-for-proxy branch from 6e81d9f to f52c4c1 Compare July 2, 2025 16:19
Copy link
Contributor

github-actions bot commented Jul 15, 2025

Terraform Plan 📖

Terraform Plan
                                            ]
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "count_"
                                                      + type = "long"
                                                    },
                                                ]
                                            }
                                          + PartTitle     = "Response Codes (5m)"
                                          + Query         = <<-EOT
                                                let api_url = "/api/auth/first-lollipop/sign$";
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex api_url
                                                | extend HTTPStatus = case(
                                                  httpStatus_d between (100 .. 199), "1XX",
                                                  httpStatus_d between (200 .. 299), "2XX",
                                                  httpStatus_d between (300 .. 399), "3XX",
                                                  httpStatus_d between (400 .. 499), "4XX",
                                                  "5XX")
                                                | summarize count() by HTTPStatus, bin(TimeGenerated, 5m)
                                                | render areachart with (xtitle = "time", ytitle= "count")
                                            EOT
                                          + SpecificChart = "StackedArea"
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 6
                                  + y       = 60
                                }
                            }
                          + "47" = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/applicationGateways/io-p-itn-agw-01",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 1;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/auth/first-lollipop/sign$"
                                                | summarize
                                                    watermark=threshold,
                                                    duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "StackedColumn"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Percentile Response Time (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/auth/first-lollipop/sign"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "duration_percentile_95"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + Dimensions    = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "watermark"
                                                      + type = "long"
                                                    },
                                                  + {
                                                      + name = "duration_percentile_95"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                          + PartTitle     = "Percentile Response Time (5m)"
                                          + Query         = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 1;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/auth/first-lollipop/sign$"
                                                | summarize
                                                    watermark=threshold,
                                                    duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                          + SpecificChart = "Line"
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 12
                                  + y       = 60
                                }
                            }
                          ~ "5"  = {
                              ~ metadata = {
                                  ~ inputs   = [
                                        # (1 unchanged element hidden)
                                        {
                                            isOptional = true
                                            name       = "ComponentId"
                                        },
                                      ~ {
                                            name       = "Scope"
                                          ~ value      = {
                                              ~ resourceIds = [
                                                  - "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/applicationGateways/io-p-itn-agw-01",
                                                ]
                                            }
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "PartId"
                                        },
                                        # (3 unchanged elements hidden)
                                        {
                                            isOptional = true
                                            name       = "DraftRequestParameters"
                                            value      = {
                                                scope = "hierarchy"
                                            }
                                        },
                                      ~ {
                                            name       = "Query"
                                          ~ value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                              - let threshold = 1;
                                              + let threshold = 8;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                              - | where requestUri_s matches regex "/user-identity"
                                              + | where requestUri_s matches regex "/api/v1/profile$"
                                                | summarize
                                                    watermark=threshold,
                                              -     duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 10m)
                                              +     duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "ControlType"
                                            value      = "FrameControlChart"
                                        },
                                        {
                                            isOptional = true
                                            name       = "SpecificChart"
                                            value      = "StackedColumn"
                                        },
                                      ~ {
                                            name       = "PartTitle"
                                          ~ value      = "Percentile Response Time (10m)" -> "Percentile Response Time (5m)"
                                            # (1 unchanged attribute hidden)
                                        },
                                      ~ {
                                            name       = "PartSubTitle"
                                          ~ value      = "/user-identity" -> "/api/v1/profile"
                                            # (1 unchanged attribute hidden)
                                        },
                                        {
                                            isOptional = true
                                            name       = "Dimensions"
                                            value      = {
                                                aggregation = "Sum"
                                                splitBy     = []
                                                xAxis       = {
                                                    name = "TimeGenerated"
                                                    type = "datetime"
                                                }
                                                yAxis       = [
                                                    {
                                                        name = "duration_percentile_95"
                                                        type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                        # (2 unchanged elements hidden)
                                    ]
                                  ~ settings = {
                                      ~ content = {
                                          ~ PartTitle     = "Percentile Response Time (10m)" -> "Percentile Response Time (5m)"
                                          ~ Query         = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                              - let threshold = 1;
                                              + let threshold = 8;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                              - | where requestUri_s matches regex "/user-identity"
                                              + | where requestUri_s matches regex "/api/v1/profile$"
                                                | summarize
                                                    watermark=threshold,
                                              -     duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 10m)
                                              +     duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                            # (2 unchanged attributes hidden)
                                        }
                                    }
                                    # (1 unchanged attribute hidden)
                                }
                                # (1 unchanged attribute hidden)
                            }
                          + "6"  = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/applicationGateways/io-p-itn-agw-01",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 0.99;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/api-profile$"
                                                | summarize
                                                  Total=count(),
                                                  Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "Line"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Availability (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/v1/api-profile"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "availability"
                                                      + type = "real"
                                                    },
                                                  + {
                                                      + name = "watermark"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + PartTitle = "Availability (5m)"
                                          + Query     = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 0.99;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/api-profile$"
                                                | summarize
                                                  Total=count(),
                                                  Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 0
                                  + y       = 8
                                }
                            }
                          + "7"  = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/applicationGateways/io-p-itn-agw-01",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_url = "/api/v1/api-profile$";
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex api_url
                                                | extend HTTPStatus = case(
                                                  httpStatus_d between (100 .. 199), "1XX",
                                                  httpStatus_d between (200 .. 299), "2XX",
                                                  httpStatus_d between (300 .. 399), "3XX",
                                                  httpStatus_d between (400 .. 499), "4XX",
                                                  "5XX")
                                                | summarize count() by HTTPStatus, bin(TimeGenerated, 5m)
                                                | render areachart with (xtitle = "time", ytitle= "count")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "Pie"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Response Codes (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/v1/api-profile"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "httpStatus_d"
                                                  + type = "string"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "count_"
                                                      + type = "long"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + Dimensions    = {
                                              + aggregation = "Sum"
                                              + splitBy     = [
                                                  + {
                                                      + name = "HTTPStatus"
                                                      + type = "string"
                                                    },
                                                ]
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "count_"
                                                      + type = "long"
                                                    },
                                                ]
                                            }
                                          + PartTitle     = "Response Codes (5m)"
                                          + Query         = <<-EOT
                                                let api_url = "/api/v1/api-profile$";
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex api_url
                                                | extend HTTPStatus = case(
                                                  httpStatus_d between (100 .. 199), "1XX",
                                                  httpStatus_d between (200 .. 299), "2XX",
                                                  httpStatus_d between (300 .. 399), "3XX",
                                                  httpStatus_d between (400 .. 499), "4XX",
                                                  "5XX")
                                                | summarize count() by HTTPStatus, bin(TimeGenerated, 5m)
                                                | render areachart with (xtitle = "time", ytitle= "count")
                                            EOT
                                          + SpecificChart = "StackedArea"
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 6
                                  + y       = 8
                                }
                            }
                          + "8"  = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/applicationGateways/io-p-itn-agw-01",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 1;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/api-profile$"
                                                | summarize
                                                    watermark=threshold,
                                                    duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "StackedColumn"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Percentile Response Time (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/v1/api-profile"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "duration_percentile_95"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + Dimensions    = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "watermark"
                                                      + type = "long"
                                                    },
                                                  + {
                                                      + name = "duration_percentile_95"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                          + PartTitle     = "Percentile Response Time (5m)"
                                          + Query         = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 1;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/api-profile$"
                                                | summarize
                                                    watermark=threshold,
                                                    duration_percentile_95=percentiles(timeTaken_d, 95) by bin(TimeGenerated, 5m)
                                                | render timechart with (xtitle = "time", ytitle= "response time(s)")
                                            EOT
                                          + SpecificChart = "Line"
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 12
                                  + y       = 8
                                }
                            }
                          + "9"  = {
                              + metadata = {
                                  + inputs   = [
                                      + {
                                          + isOptional = true
                                          + name       = "resourceTypeMode"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ComponentId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Scope"
                                          + value      = {
                                              + resourceIds = [
                                                  + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/applicationGateways/io-p-itn-agw-01",
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Version"
                                          + value      = "2.0"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "TimeRange"
                                          + value      = "PT4H"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DashboardId"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "DraftRequestParameters"
                                          + value      = {
                                              + scope = "hierarchy"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Query"
                                          + value      = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 0.99;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/email-validation-process$"
                                                | summarize
                                                  Total=count(),
                                                  Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "ControlType"
                                          + value      = "FrameControlChart"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "SpecificChart"
                                          + value      = "Line"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartTitle"
                                          + value      = "Availability (5m)"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "PartSubTitle"
                                          + value      = "/api/v1/email-validation-process"
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "Dimensions"
                                          + value      = {
                                              + aggregation = "Sum"
                                              + splitBy     = []
                                              + xAxis       = {
                                                  + name = "TimeGenerated"
                                                  + type = "datetime"
                                                }
                                              + yAxis       = [
                                                  + {
                                                      + name = "availability"
                                                      + type = "real"
                                                    },
                                                  + {
                                                      + name = "watermark"
                                                      + type = "real"
                                                    },
                                                ]
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "LegendOptions"
                                          + value      = {
                                              + isEnabled = true
                                              + position  = "Bottom"
                                            }
                                        },
                                      + {
                                          + isOptional = true
                                          + name       = "IsQueryContainTimeRange"
                                          + value      = false
                                        },
                                    ]
                                  + settings = {
                                      + content = {
                                          + PartTitle = "Availability (5m)"
                                          + Query     = <<-EOT
                                                let api_hosts = datatable (name: string) ["app-backend.io.italia.it", "api-app.io.pagopa.it"];
                                                let threshold = 0.99;
                                                AzureDiagnostics
                                                | where originalHost_s in (api_hosts)
                                                | where requestUri_s matches regex "/api/v1/email-validation-process$"
                                                | summarize
                                                  Total=count(),
                                                  Success=count(httpStatus_d < 500) by bin(TimeGenerated, 5m)
                                                | extend availability=toreal(Success) / Total
                                                | project TimeGenerated, availability, watermark=threshold
                                                | render timechart with (xtitle = "time", ytitle= "availability(%)")
                                            EOT
                                        }
                                    }
                                  + type     = "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart"
                                }
                              + position = {
                                  + colSpan = 6
                                  + rowSpan = 4
                                  + x       = 0
                                  + y       = 12
                                }
                            }
                        }
                        # (1 unchanged attribute hidden)
                    }
                }
                # (1 unchanged attribute hidden)
            }
        )
        id                   = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/dashboards/providers/Microsoft.Portal/dashboards/io-p-opex_iobackend_api_auth"
        name                 = "io-p-opex_iobackend_api_auth"
      ~ tags                 = {
          - "BusinessUnit" = "App IO" -> null
            "CostCenter"   = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"    = "Terraform"
            "Environment"  = "Prod"
            "Owner"        = "io"
            "Source"       = "https://github.com/pagopa/io-backend"
        }
        # (2 unchanged attributes hidden)
    }

Plan: 32 to add, 1 to change, 4 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.
Releasing state lock. This may take a few moments...

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants