Skip to content

Commit

Permalink
Merge branch 'EES-5687-add-resource-utilisation-metric-alerts-with-ba…
Browse files Browse the repository at this point in the history
…se-alerts' into EES-5687-add-resource-utilisation-metric-alerts
  • Loading branch information
duncan-at-hiveit committed Dec 12, 2024
2 parents ed4b6c4 + 268dd34 commit 2cb2aa9
Show file tree
Hide file tree
Showing 15 changed files with 162 additions and 165 deletions.
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
}
}]
}
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
}
}]
}
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
}
}]
}
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
}
}]
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
}
}]
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
}
}]
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
}
}]
}
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
}
}]
}
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
}
}]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ param alertsGroupName string
param tagValues object

module alerts '../dynamicMetricAlert.bicep' = [for name in resourceNames: {
name: '${name}ClientConnectionsAlertModule'
name: '${name}ClientConnectionsWaitingAlertModule'
params: {
alertName: '${name}-query-time'
resourceIds: [resourceId('Microsoft.DBforPostgreSQL/flexibleServers', name)]
Expand Down
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
}
}]
}
Loading

0 comments on commit 2cb2aa9

Please sign in to comment.