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

[#IOPID-1314] Add OPEX for api_fast_login #1092

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

gquadrati
Copy link
Contributor

List of Changes

  • Add new GH action for managing OPEX dashboard and alert for api_fast_login

Motivation and Context

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.

Copy link

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOPID-1314

Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

Terraform Plan 📖

Terraform Plan
rdId"
                                        },
                                      + {
                                          + 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/fast-login"
                                                | 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/fast-login"
                                        },
                                      + {
                                          + 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/fast-login"
                                                | 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       = 0
                                }
                            }
                          + "1" = {
                              + 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-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + 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/fast-login";
                                                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/fast-login"
                                        },
                                      + {
                                          + 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/fast-login";
                                                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       = 0
                                }
                            }
                          + "2" = {
                              + 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-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + 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/fast-login"
                                                | 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/fast-login"
                                        },
                                      + {
                                          + 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/fast-login"
                                                | 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       = 0
                                }
                            }
                          + "3" = {
                              + 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-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + 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/fast-login/nonce/generate"
                                                | 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/fast-login/nonce/generate"
                                        },
                                      + {
                                          + 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/fast-login/nonce/generate"
                                                | 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       = 4
                                }
                            }
                          + "4" = {
                              + 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-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + 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/fast-login/nonce/generate";
                                                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/fast-login/nonce/generate"
                                        },
                                      + {
                                          + 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/fast-login/nonce/generate";
                                                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       = 4
                                }
                            }
                          + "5" = {
                              + 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-rg-external/providers/Microsoft.Network/applicationGateways/io-p-appgateway",
                                                ]
                                            }
                                        },
                                      + {
                                          + 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/fast-login/nonce/generate"
                                                | 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/fast-login/nonce/generate"
                                        },
                                      + {
                                          + 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/fast-login/nonce/generate"
                                                | 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       = 4
                                }
                            }
                        }
                    }
                }
              + metadata = {
                  + model = {
                      + filterLocale = {
                          + value = "en-us"
                        }
                      + filters      = {
                          + value = {
                              + MsPortalFx_TimeRange = {
                                  + displayCache    = {
                                      + name  = "Local Time"
                                      + value = "Past 48 hours"
                                    }
                                  + filteredPartIds = [
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432ed",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432ef",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f1",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f3",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f5",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f7",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f9",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432fb",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432fd",
                                    ]
                                  + model           = {
                                      + format      = "local"
                                      + granularity = "auto"
                                      + relative    = "48h"
                                    }
                                }
                            }
                        }
                      + timeRange    = {
                          + type  = "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"
                          + value = {
                              + relative = {
                                  + duration = 24
                                  + timeUnit = 1
                                }
                            }
                        }
                    }
                }
            }
        )
      + id                   = (known after apply)
      + location             = "westeurope"
      + name                 = "io-p-opex_iobackend_api_fast_login"
      + resource_group_name  = "dashboards"
      + tags                 = {
          + "CostCenter"  = "TS310 - PAGAMENTI & SERVIZI"
          + "CreatedBy"   = "Terraform"
          + "Environment" = "Prod"
          + "Owner"       = "io"
          + "Source"      = "https://github.com/pagopa/io-backend"
        }
    }

Plan: 5 to add, 0 to change, 0 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...

@gquadrati gquadrati marked this pull request as ready for review January 15, 2024 16:56
@gquadrati gquadrati requested a review from a team as a code owner January 15, 2024 16:56
@gquadrati gquadrati merged commit 7d4b415 into master Jan 15, 2024
6 checks passed
@gquadrati gquadrati deleted the IOPID-1314--add-api_fast_login_opex branch January 15, 2024 17:10
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