Azure / alz-monitor

Repository for collaboration on monitor baselines for ALZ
MIT License
171 stars 83 forks source link

ALZ Monitor Customisation #241

Open gerrynicol opened 1 year ago

gerrynicol commented 1 year ago

HI there,

Possibly wrong forum for this (and have raised a ticket for this also) but I have been doing some customisation on the ALZ monitor bicep files to suit our requirements. One of theses is to define the actual alert rules you want included in an alert processing rule. See below for an example (under conditions). This works as expected, however, if I was then to go an add an additional alert rule name under the conditions and push it, the azure policy definition is updated, but the actual alert processing rule is not. The only way round this seems to be to delete the current assignment, the existing alert processing rules and action groups and redeploy. Is there an alternative to this approach that could be recommmended? I have a feeling that this level of customisation to select particular alert rules may be a good enhancement when ALZ monitor becomes part of the overall ALZ architecture.

                        type: 'Microsoft.AlertsManagement/actionRules'
                        apiVersion: '2021-08-08'
                        name: 'Alz Alert Processing Rule - ServiceHealth'
                        location: 'global'
                         dependsOn: [
                        '[concat(\'Microsoft.Insights/actionGroups/\', \'AlzActGrpSrv\')]'
                         ]
                         tags: {
                          _deployed_by_alz_monitor: true
                        }
                        properties: {
                          scopes: [
                            '[subscription().Id]'
                          ]
                          description: 'Alz Alert Processing Rule - ServiceHealth'
                          enabled: true
                          actions: [
                            {
                              actiongroupIds: [
                                '''[concat(subscription().Id, '/resourceGroups/', parameters('ALZMonitorResourceGroupName'), '/providers/Microsoft.Insights/actionGroups/AlzActGrpSrv')]'''
                              ]
                              actionType: 'AddActionGroups'
                            }
                          ]
                          conditions: [
                            {
                              field: 'AlertRuleName'
                              operator: 'Equals'
                              values: [
                                'ServiceHealthAdvisoryEvent'
                                'ServiceHealthIncident'
                                'ServiceHealthPlannedMaintenance'
                                'ServiceHealthSecurityIncident'
                              ]
                            }
arjenhuitema commented 1 year ago

Hello @gerrynicol, you are in the correct place, and thank for your feedback. We will review the enhancement you suggested and keep you posted.

paulgrimley commented 1 year ago

@gerrynicol thanks for sharing this, we will look to investigate this in October.

paulgrimley commented 1 year ago

@gerrynicol we're archiving this repo, please could you add an issue on our new repo https://github.com/Azure/azure-monitor-baseline-alerts/issues as we unfortunately cannot transfer issues between repos.