-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'EES-5687-add-resource-utilisation-metric-alerts-with-ba…
…se-alerts' into EES-5687-add-resource-utilisation-metric-alerts
- Loading branch information
Showing
15 changed files
with
162 additions
and
165 deletions.
There are no files selected for viewing
23 changes: 5 additions & 18 deletions
23
infrastructure/templates/public-api/components/alerts/appGateways/responseTimeAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import { Severity } from '../types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts '../dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}ResponseTimeAlertModule' | ||
module alerts '../baseResponseTimeAlert.bicep' = { | ||
name: '${resourceNames[0]}ResponseTimeAlertModule' | ||
params: { | ||
alertName: '${name}-response-time' | ||
resourceIds: [resourceId('Microsoft.Network/applicationGateways', name)] | ||
resourceNames: resourceNames | ||
resourceType: 'Microsoft.Network/applicationGateways' | ||
query: { | ||
metric: 'ApplicationGatewayTotalTime' | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT1M' | ||
windowSize: 'PT5M' | ||
severity: severity | ||
metricName: 'ApplicationGatewayTotalTime' | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] | ||
} |
23 changes: 5 additions & 18 deletions
23
...structure/templates/public-api/components/alerts/appServicePlans/cpuPercentageAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import { Severity } from '../types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts '../dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}CpuPercentageAlertModule' | ||
module alerts '../baseCpuPercentageAlert.bicep' = { | ||
name: '${resourceNames[0]}CpuPercentageAlertModule' | ||
params: { | ||
alertName: '${name}-cpu-percentage' | ||
resourceIds: [resourceId('Microsoft.Web/serverfarms', name)] | ||
resourceNames: resourceNames | ||
resourceType: 'Microsoft.Web/serverfarms' | ||
query: { | ||
metric: 'CpuPercentage' | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT5M' | ||
windowSize: 'PT15M' | ||
severity: severity | ||
metricName: 'CpuPercentage' | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] | ||
} |
23 changes: 5 additions & 18 deletions
23
...ucture/templates/public-api/components/alerts/appServicePlans/memoryPercentageAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import { Severity } from '../types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts '../dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}MemoryPercentageAlertModule' | ||
module alerts '../baseMemoryPercentageAlert.bicep' = { | ||
name: '${resourceNames[0]}MemoryPercentageAlertModule' | ||
params: { | ||
alertName: '${name}-memory-percentage' | ||
resourceIds: [resourceId('Microsoft.Web/serverfarms', name)] | ||
resourceNames: resourceNames | ||
resourceType: 'Microsoft.Web/serverfarms' | ||
query: { | ||
metric: 'MemoryPercentage' | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT5M' | ||
windowSize: 'PT15M' | ||
severity: severity | ||
metricName: 'MemoryPercentage' | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] | ||
} |
38 changes: 38 additions & 0 deletions
38
infrastructure/templates/public-api/components/alerts/baseCpuPercentageAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Severity } from 'types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceType string | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param metricName string | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts 'dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}CpuPercentBaseAlertModule' | ||
params: { | ||
alertName: '${name}-cpu-percentage' | ||
resourceIds: [resourceId(resourceType, name)] | ||
resourceType: resourceType | ||
query: { | ||
metric: metricName | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT5M' | ||
windowSize: 'PT15M' | ||
severity: severity | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] |
38 changes: 38 additions & 0 deletions
38
infrastructure/templates/public-api/components/alerts/baseMemoryPercentageAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Severity } from 'types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceType string | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param metricName string | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts 'dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}MemoryPercentBaseAlertModule' | ||
params: { | ||
alertName: '${name}-memory-percentage' | ||
resourceIds: [resourceId(resourceType, name)] | ||
resourceType: resourceType | ||
query: { | ||
metric: metricName | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT5M' | ||
windowSize: 'PT15M' | ||
severity: severity | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] |
38 changes: 38 additions & 0 deletions
38
infrastructure/templates/public-api/components/alerts/baseResponseTimeAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Severity } from 'types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceType string | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param metricName string | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts 'dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}ResponseTimeBaseAlertModule' | ||
params: { | ||
alertName: '${name}-response-time' | ||
resourceIds: [resourceId(resourceType, name)] | ||
resourceType: resourceType | ||
query: { | ||
metric: metricName | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT5M' | ||
windowSize: 'PT15M' | ||
severity: severity | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] |
23 changes: 5 additions & 18 deletions
23
infrastructure/templates/public-api/components/alerts/containerApps/cpuPercentageAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import { Severity } from '../types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts '../dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}CpuPercentageAlertModule' | ||
module alerts '../baseCpuPercentageAlert.bicep' = { | ||
name: '${resourceNames[0]}CpuPercentageAlertModule' | ||
params: { | ||
alertName: '${name}-cpu-percentage' | ||
resourceIds: [resourceId('Microsoft.App/containerApps', name)] | ||
resourceNames: resourceNames | ||
resourceType: 'Microsoft.App/containerApps' | ||
query: { | ||
metric: 'CpuPercentage' | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT5M' | ||
windowSize: 'PT15M' | ||
severity: severity | ||
metricName: 'CpuPercentage' | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] | ||
} |
23 changes: 5 additions & 18 deletions
23
...tructure/templates/public-api/components/alerts/containerApps/memoryPercentageAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import { Severity } from '../types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts '../dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}MemoryPercentageAlertModule' | ||
module alerts '../baseMemoryPercentageAlert.bicep' = { | ||
name: '${resourceNames[0]}MemoryPercentageAlertModule' | ||
params: { | ||
alertName: '${name}-memory-percentage' | ||
resourceIds: [resourceId('Microsoft.App/containerApps', name)] | ||
resourceNames: resourceNames | ||
resourceType: 'Microsoft.App/containerApps' | ||
query: { | ||
metric: 'MemoryPercentage' | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT5M' | ||
windowSize: 'PT15M' | ||
severity: severity | ||
metricName: 'MemoryPercentage' | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] | ||
} |
23 changes: 5 additions & 18 deletions
23
infrastructure/templates/public-api/components/alerts/containerApps/responseTimeAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import { Severity } from '../types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts '../dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}LatencyAlertModule' | ||
module alerts '../baseResponseTimeAlert.bicep' = { | ||
name: '${resourceNames[0]}ResponseTimeAlertModule' | ||
params: { | ||
alertName: '${name}-latency' | ||
resourceIds: [resourceId('Microsoft.App/containerApps', name)] | ||
resourceNames: resourceNames | ||
resourceType: 'Microsoft.App/containerApps' | ||
query: { | ||
metric: 'ResponseTime' | ||
aggregation: 'Average' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT1M' | ||
windowSize: 'PT5M' | ||
severity: severity | ||
metricName: 'ResponseTime' | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 5 additions & 18 deletions
23
...structure/templates/public-api/components/alerts/flexibleServers/cpuPercentageAlert.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import { Severity } from '../types.bicep' | ||
|
||
@description('Names of the resources that these alerts are being applied to.') | ||
param resourceNames string[] | ||
|
||
@description('The alert severity.') | ||
param severity Severity = 'Warning' | ||
|
||
@description('Name of the Alerts Group used to send alert messages.') | ||
param alertsGroupName string | ||
|
||
@description('Tags with which to tag the resource in Azure.') | ||
param tagValues object | ||
|
||
module alerts '../dynamicMetricAlert.bicep' = [for name in resourceNames: { | ||
name: '${name}CpuPercentageAlertModule' | ||
module alerts '../baseCpuPercentageAlert.bicep' = { | ||
name: '${resourceNames[0]}CpuPercentageAlertModule' | ||
params: { | ||
alertName: '${name}-cpu-percentage' | ||
resourceIds: [resourceId('Microsoft.DBforPostgreSQL/flexibleServers', name)] | ||
resourceNames: resourceNames | ||
resourceType: 'Microsoft.DBforPostgreSQL/flexibleServers' | ||
query: { | ||
metric: 'cpu_percent' | ||
aggregation: 'Maximum' | ||
operator: 'GreaterThan' | ||
} | ||
evaluationFrequency: 'PT5M' | ||
windowSize: 'PT15M' | ||
severity: severity | ||
metricName: 'cpu_percent' | ||
alertsGroupName: alertsGroupName | ||
tagValues: tagValues | ||
} | ||
}] | ||
} |
Oops, something went wrong.