-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from JoeyBarnes/main
Updated Alert Rules detail sections and added tabbed Templates dialog.
- Loading branch information
Showing
32 changed files
with
1,746 additions
and
105 deletions.
There are no files selected for viewing
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,45 +1,49 @@ | ||
|
||
<table> | ||
<tr> | ||
<th>Category</th> | ||
{{ if eq .category "Administrative" }} | ||
<th>Operation Name</th> | ||
<th>Status</th> | ||
{{ else if eq .category "ResourceHealth" }} | ||
<th>Causes</th> | ||
<th>Health Status</th> | ||
{{ else if eq .category "ServiceHealth" }} | ||
<th>Incident Type</th> | ||
{{ end }} | ||
</tr> | ||
|
||
<tr> | ||
<td>Category</td> | ||
<td>{{ .category }}</td> | ||
{{ if eq .category "Administrative" }} | ||
</tr> | ||
{{ if eq .category "Administrative" }} | ||
<tr> | ||
<td>Operation Name</td> | ||
<td>{{ .operationName }}</td> | ||
</tr> | ||
<tr> | ||
<td>Status</td> | ||
<td> | ||
{{ if or (reflect.IsMap .status) (reflect.IsSlice .status) }} | ||
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .status) "json" }} | ||
{{ else }} | ||
{{ .status }} | ||
{{ end }} </td> | ||
{{ else if eq .category "ResourceHealth" }} | ||
{{ end }} | ||
</td> | ||
</tr> | ||
{{ else if eq .category "ResourceHealth" }} | ||
<tr> | ||
<td>Causes</td> | ||
<td> | ||
{{ if or (reflect.IsMap .causes) (reflect.IsSlice .causes) }} | ||
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .causes) "json" }} | ||
{{ else }} | ||
{{ .causes }} | ||
{{ end }} | ||
</td> | ||
<td> | ||
</tr> | ||
<tr> | ||
<td>Health Status</td> | ||
<td> | ||
{{ if or (reflect.IsMap .currentHealthStatus) (reflect.IsSlice .currentHealthStatus) }} | ||
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .currentHealthStatus) "json" }} | ||
{{ else }} | ||
{{ .currentHealthStatus }} | ||
{{ end }} | ||
</td> | ||
{{ else if eq .category "ServiceHealth" }} | ||
</tr> | ||
{{ else if eq .category "ServiceHealth" }} | ||
<tr> | ||
<td>Incident Type</td> | ||
<td>{{ .incidentType }}</td> | ||
{{ end }} | ||
</tr> | ||
</tr> | ||
{{ end }} | ||
</table> |
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,44 +1,57 @@ | ||
|
||
<div><table> | ||
<tr> | ||
{{ if isset . "dimensions" }} | ||
<th>Dimensions</th> | ||
{{ end }} | ||
<th>Failing Periods</th> | ||
<th>Aggregation</th> | ||
<th>Operator</th> | ||
<th>Threshold</th> | ||
<th>Window</th> | ||
<th>Frequency</th> | ||
<th>Severity</th> | ||
<th>Metric Measure Column</th> | ||
<th>Resource ID Column</th> | ||
</tr> | ||
|
||
<tr> | ||
{{ if isset . "dimensions" }} | ||
{{ if isset . "dimensions" }} | ||
<tr> | ||
<td>Dimensions</td> | ||
<td> | ||
{{ if or (reflect.IsMap .dimensions) (reflect.IsSlice .dimensions) }} | ||
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .dimensions) "json" }} | ||
{{ else }} | ||
{{ .dimensions }} | ||
{{ end }} | ||
</td> | ||
{{ end }} | ||
</tr> | ||
{{ end }} | ||
<tr> | ||
<td>Failing Periods</td> | ||
<td> | ||
{{ if or (reflect.IsMap .failingPeriods) (reflect.IsSlice .failingPeriods) }} | ||
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .failingPeriods) "json" }} | ||
{{ else }} | ||
{{ .failingPeriods }} | ||
{{ end }} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Aggregation</td> | ||
<td>{{ .timeAggregation }}</td> | ||
</tr> | ||
<tr> | ||
<td>Operator</td> | ||
<td>{{ .operator }}</td> | ||
</tr> | ||
<tr> | ||
<td>Threshold</td> | ||
<td>{{ .threshold }}</td> | ||
</tr> | ||
<tr> | ||
<td>Window</td> | ||
<td>{{ .windowSize }}</td> | ||
</tr> | ||
<tr> | ||
<td>Frequency</td> | ||
<td>{{ .evaluationFrequency }}</td> | ||
</tr> | ||
<tr> | ||
<td>Severity</td> | ||
<td>{{ .severity }}</td> | ||
</tr> | ||
<tr> | ||
<td>Metric Measure Column</td> | ||
<td>{{ .metricMeasureColumn }}</td> | ||
</tr> | ||
<tr> | ||
<td>Resource ID Column</td> | ||
<td>{{ .resouceIdColumn }}</td> | ||
</tr> | ||
</table></div> |
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,50 +1,60 @@ | ||
|
||
<div><table> | ||
<tr> | ||
<th>Operator</th> | ||
<th>Aggregation</th> | ||
{{ if eq .criterionType "DynamicThresholdCriterion" }} | ||
<th>Alert Sensitivity</th> | ||
<th>Failing Periods</th> | ||
{{ else }} | ||
<th>Threshold</th> | ||
{{ end }} | ||
<th>Window</th> | ||
<th>Frequency</th> | ||
<th>Severity</th> | ||
{{ if isset . "dimensions" }} | ||
<th>Dimensions</th> | ||
{{ end }} | ||
<th>Criterion Type</th> | ||
<td>Operator</td> | ||
<td>{{ .operator }}</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>{{ .operator }}</td> | ||
<td>Aggregation</td> | ||
<td>{{ .timeAggregation }}</td> | ||
{{ if eq .criterionType "DynamicThresholdCriterion" }} | ||
</tr> | ||
{{ if eq .criterionType "DynamicThresholdCriterion" }} | ||
<tr> | ||
<td>Alert Sensitivity</td> | ||
<td>{{ .alertSensitivity }}</td> | ||
</tr> | ||
<tr> | ||
<td>Failing Periods</td> | ||
<td> | ||
{{ if or (reflect.IsMap .failingPeriods) (reflect.IsSlice .failingPeriods) }} | ||
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .failingPeriods) "json" }} | ||
{{ else }} | ||
{{ .failingPeriods }} | ||
{{ end }} | ||
</td> | ||
{{ else }} | ||
</tr> | ||
{{ else }} | ||
<tr> | ||
<td>Threshold</td> | ||
<td>{{ cast.ToString .threshold }}</td> | ||
{{ end }} | ||
</tr> | ||
{{ end }} | ||
<tr> | ||
<td>Window</td> | ||
<td>{{ .windowSize }}</td> | ||
</tr> | ||
<tr> | ||
<td>Frequency</td> | ||
<td>{{ .evaluationFrequency }}</td> | ||
</tr> | ||
<tr> | ||
<td>Severity</td> | ||
<td>{{ .severity }}</td> | ||
{{ if isset . "dimensions" }} | ||
</tr> | ||
{{ if isset . "dimensions" }} | ||
<tr> | ||
<td>Dimensions</td> | ||
<td> | ||
{{ if or (reflect.IsMap .dimensions) (reflect.IsSlice .dimensions) }} | ||
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .dimensions) "json" }} | ||
{{ else }} | ||
{{ .dimensions }} | ||
{{ end }} | ||
</td> | ||
{{ end }} | ||
{{ if or (reflect.IsMap .dimensions) (reflect.IsSlice .dimensions) }} | ||
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .dimensions) "json" }} | ||
{{ else }} | ||
{{ .dimensions }} | ||
{{ end }} | ||
</td> | ||
</tr> | ||
{{ end }} | ||
<tr> | ||
<td>Criterion Type</td> | ||
<td>{{ .criterionType }}</td> | ||
</tr> | ||
</table></div> |
74 changes: 74 additions & 0 deletions
74
docs/layouts/partials/templates/arm/activity-administrative.html
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,74 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"activityLogAlertName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Unique name (within the Resource Group) for the Activity log alert." | ||
} | ||
}, | ||
"alertDescription": { | ||
"type": "string", | ||
"defaultValue": "{{ .description }}", | ||
"metadata": { | ||
"description": "Description of alert" | ||
} | ||
}, | ||
"activityLogAlertEnabled": { | ||
"type": "bool", | ||
"defaultValue": true, | ||
"metadata": { | ||
"description": "Indicates whether or not the alert is enabled." | ||
} | ||
}, | ||
"actionGroupResourceId": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Resource Id for the Action group." | ||
} | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Insights/activityLogAlerts", | ||
"apiVersion": "2017-04-01", | ||
"name": "[parameters('activityLogAlertName')]", | ||
"location": "Global", | ||
"tags": { | ||
"_deployed_by_amba": true | ||
}, | ||
"properties": { | ||
"description": "[parameters('alertDescription')]", | ||
"scopes": [ | ||
"[subscription().id]" | ||
], | ||
"enabled": "[parameters('activityLogAlertEnabled')]", | ||
"condition": { | ||
"allOf": [ | ||
{ | ||
"field": "category", | ||
"equals": "Administrative" | ||
}, | ||
{ | ||
"field": "operationName", | ||
"equals": "{{ .properties.operationName }}" | ||
}, | ||
{ | ||
"field": "status", | ||
"containsAny": [{{ range $idx1, $value1 := .properties.status }}{{ if ne $idx1 0}},{{ end }}"{{ $value1 }}"{{ end }}] | ||
} | ||
] | ||
}, | ||
"actions": { | ||
"actionGroups": | ||
[ | ||
{ | ||
"actionGroupId": "[parameters('actionGroupResourceId')]" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
82 changes: 82 additions & 0 deletions
82
docs/layouts/partials/templates/arm/activity-resourcehealth.html
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,82 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"activityLogAlertName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Unique name (within the Resource Group) for the Activity log alert." | ||
} | ||
}, | ||
"alertDescription": { | ||
"type": "string", | ||
"defaultValue": "{{ .description }}", | ||
"metadata": { | ||
"description": "Description of alert" | ||
} | ||
}, | ||
"activityLogAlertEnabled": { | ||
"type": "bool", | ||
"defaultValue": true, | ||
"metadata": { | ||
"description": "Indicates whether or not the alert is enabled." | ||
} | ||
}, | ||
"actionGroupResourceId": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Resource Id for the Action group." | ||
} | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Insights/activityLogAlerts", | ||
"apiVersion": "2017-04-01", | ||
"name": "[parameters('activityLogAlertName')]", | ||
"location": "Global", | ||
"tags": { | ||
"_deployed_by_amba": true | ||
}, | ||
"properties": { | ||
"description": "[parameters('alertDescription')]", | ||
"scopes": [ | ||
"[subscription().id]" | ||
], | ||
"enabled": "[parameters('activityLogAlertEnabled')]", | ||
"condition": { | ||
"allOf": [ | ||
{ | ||
"field": "category", | ||
"equals": "ResourceHealth" | ||
}, | ||
{ | ||
"anyOf": [{{ range $idx, $value := .properties.causes }}{{ if ne $idx 0}},{{ end }} | ||
{ | ||
"field": "properties.cause", | ||
"equals": "{{ $value }}" | ||
}{{ end }} | ||
] | ||
}, | ||
{ | ||
"anyOf": [{{ range $idx, $value := .properties.currentHealthStatus }}{{ if ne $idx 0}},{{ end }} | ||
{ | ||
"field": "properties.currentHealthStatus", | ||
"equals": "{{ $value }}" | ||
}{{ end }} | ||
] | ||
} | ||
] | ||
}, | ||
"actions": { | ||
"actionGroups": | ||
[ | ||
{ | ||
"actionGroupId": "[parameters('actionGroupResourceId')]" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.