Skip to content

Commit

Permalink
updated alz alert details to be data driven
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBarnes committed Oct 3, 2023
1 parent bf5dd84 commit e295e37
Show file tree
Hide file tree
Showing 34 changed files with 1,518 additions and 339 deletions.
89 changes: 6 additions & 83 deletions docs/content/patterns/alz/Alerts-Details.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/alertList.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h4>Deployment Templates:</h4>
<table>
{{ range .deployments }}
<tr>
<td>{{ .description }}</td>
<td>{{ .name }}</td>
{{ $url := path.Join $.Page.File.Dir .template }}
<td>
<a href="{{ relURL $url }}" target="_blank">View</a> | <a href="{{ relURL $url }}" download>Download</a>
Expand Down
73 changes: 73 additions & 0 deletions docs/layouts/shortcodes/alzActivityLogAdministrativeAlerts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<div><table>
<tr>
<th>Alert Policy Name</th>
<th>Alert Name</th>
<th>PolicyScope</th>
<th>category</th>
<th>operationName</th>
<th>status</th>
<th>Scope</th>
<th>Documented</th>
<th>References</th>
</tr>

{{ range $category, $types := $.Site.Data }}
{{ range $type, $rules := $types }}
{{ range $rules.alerts }}
{{ if or (eq .visible true) (eq $.Site.Params.ambaDevMode true) }}
{{ if and (eq .type "ActivityLog") (in .tags "alz") (eq .properties.category "Administrative") }}
{{ $data := newScratch }}
{{ if isset . "deployments" }}
{{ range where .deployments "type" "Policy" }}
{{ if and (in .tags "alz") }}
{{ $data.Set "name" .name }}
{{ $data.Set "url" (relURL (path.Join "services" $category $type .template)) }}
{{ $data.Set "scope" .properties.scope }}
{{ $data.Set "policyScope" .properties.policyScope }}
{{ $data.Set "documented" .properties.documented }}
{{ $data.Set "alertName" .properties.alertName }}
{{ end }}
{{ end }}
{{ end }}
<tr>
<td>
<a href='{{ $data.Get "url" }}'>{{ $data.Get "name" }}</a>
</td>
<td>
{{ $data.Get "alertName" }}
</td>
<td>
{{ $data.Get "policyScope" }}
</td>
<td>
{{ .properties.category }}
</td>
<td>
{{ .properties.operationName }}
</td>
<td>
{{ .properties.status }}
</td>
<td>
{{ $data.Get "scope" }}
</td>
<td>
{{ if ($data.Get "documented") }}
Yes
{{ else }}
No
{{ end }}
</td>
<td>
{{ range .references }}
<a href="{{ .url }}" target="_blank">{{ .name }}</a>
{{ end }}
</td>
</tr>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}

</table></div>
72 changes: 72 additions & 0 deletions docs/layouts/shortcodes/alzActivityLogResourceHealthAlerts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<div><table>
<tr>
<th>Alert Policy Name</th>
<th>Alert Name</th>
<th>targetScope</th>
<th>Category</th>
<th>Properties.cause</th>
<th>Properties.currentHealthStatus</th>
<th>Scope</th>
<th>Verified</th>
<th>References</th>
</tr>

{{ range $category, $types := $.Site.Data }}
{{ range $type, $rules := $types }}
{{ range $rules.alerts }}
{{ if or (eq .visible true) (eq $.Site.Params.ambaDevMode true) }}
{{ if and (eq .type "ActivityLog") (in .tags "alz") (eq .properties.category "ResourceHealth") }}
{{ $data := newScratch }}
{{ if isset . "deployments" }}
{{ range where .deployments "type" "Policy" }}
{{ if and (in .tags "alz") }}
{{ $data.Set "name" .name }}
{{ $data.Set "url" (relURL (path.Join "services" $category $type .template)) }}
{{ $data.Set "scope" .properties.scope }}
{{ $data.Set "policyScope" .properties.policyScope }}
{{ $data.Set "alertName" .properties.alertName }}
{{ end }}
{{ end }}
{{ end }}
<tr>
<td>
<a href='{{ $data.Get "url" }}'>{{ $data.Get "name" }}</a>
</td>
<td>
{{ $data.Get "alertName" }}
</td>
<td>
{{ $data.Get "policyScope" }}
</td>
<td>
{{ .properties.category }}
</td>
<td>
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .properties.causes) "json" }}
</td>
<td>
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") .properties.currentHealthStatus) "json" }}
</td>
<td>
{{ $data.Get "scope" }}
</td>
<td>
{{ if .verified }}
Y
{{ else }}
N
{{ end }}
</td>
<td>
{{ range .references }}
<a href="{{ .url }}" target="_blank">{{ .name }}</a>
{{ end }}
</td>
</tr>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}

</table></div>
69 changes: 69 additions & 0 deletions docs/layouts/shortcodes/alzActivityLogServiceHealthAlerts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<div><table>
<tr>
<th>Alert Policy Name</th>
<th>Alert Name</th>
<th>PolicyScope</th>
<th>Category</th>
<th>Properties.incidentType</th>
<th>Scope</th>
<th>Documented</th>
<th>References</th>
</tr>

{{ range $category, $types := $.Site.Data }}
{{ range $type, $rules := $types }}
{{ range $rules.alerts }}
{{ if or (eq .visible true) (eq $.Site.Params.ambaDevMode true) }}
{{ if and (eq .type "ActivityLog") (in .tags "alz") (eq .properties.category "ServiceHealth") }}
{{ $data := newScratch }}
{{ if isset . "deployments" }}
{{ range where .deployments "type" "Policy" }}
{{ if and (in .tags "alz") }}
{{ $data.Set "name" .name }}
{{ $data.Set "url" (relURL (path.Join "services" $category $type .template)) }}
{{ $data.Set "scope" .properties.scope }}
{{ $data.Set "policyScope" .properties.policyScope }}
{{ $data.Set "documented" .properties.documented }}
{{ $data.Set "alertName" .properties.alertName }}
{{ end }}
{{ end }}
{{ end }}
<tr>
<td>
<a href='{{ $data.Get "url" }}'>{{ $data.Get "name" }}</a>
</td>
<td>
{{ $data.Get "alertName" }}
</td>
<td>
{{ $data.Get "policyScope" }}
</td>
<td>
{{ .properties.category }}
</td>
<td>
{{ .properties.incidentType }}
</td>
<td>
{{ $data.Get "scope" }}
</td>
<td>
{{ if ($data.Get "documented") }}
Yes
{{ else }}
No
{{ end }}
</td>
<td>
{{ range .references }}
<a href="{{ .url }}" target="_blank">{{ .name }}</a>
{{ end }}
</td>
</tr>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}

</table></div>
95 changes: 95 additions & 0 deletions docs/layouts/shortcodes/alzMetricAlerts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<div><table>
<tr>
<th>Alert Name</th>
<th>Component</th>
<th>Metric</th>
<th>Aggregation</th>
<th>Operator</th>
<th>Threshold</th>
<th>Window</th>
<th>Frequency</th>
<th>Severity</th>
<th>Scope</th>
<th>Support for Multiple Resoruces</th>
<th>Verified</th>
<th>References</th>
</tr>

{{ range $category, $types := $.Site.Data }}
{{ range $type, $rules := $types }}
{{ range $rules.alerts }}
{{ if or (eq .visible true) (eq $.Site.Params.ambaDevMode true) }}
{{ if and (eq .type "Metric") (in .tags "alz") }}
{{ $data := newScratch }}
{{ if isset . "deployments" }}
{{ range where .deployments "type" "Policy" }}
{{ if and (in .tags "alz") }}
{{ $data.Set "name" .name }}
{{ $data.Set "url" (relURL (path.Join "services" $category $type .template)) }}
{{ $data.Set "scope" .properties.scope }}
{{ $data.Set "multiResource" .properties.multiResource }}
{{ end }}
{{ end }}
{{ end }}
<tr>
<td>
<a href='{{ $data.Get "url" }}'>{{ $data.Get "name" }}</a>
</td>
<td>
{{ .properties.metricNamespace }}
</td>
<td>
{{ .properties.metricName }}
</td>
<td>
{{ .properties.timeAggregation }}
</td>
<td>
{{ .properties.operator }}
</td>
<td>
{{ if eq .properties.criterionType "DynamicThresholdCriterion" }}
dynamic
{{ else }}
{{ .properties.threshold }}
{{ end }}
</td>
<td>
{{ .properties.windowSize }}
</td>
<td>
{{ .properties.evaluationFrequency }}
</td>
<td>
{{ .properties.severity }}
</td>
<td>
{{ $data.Get "scope" }}
</td>
<td>
{{ if ($data.Get "multiResource") }}
Yes
{{ else }}
No
{{ end }}
</td>
<td>
{{ if .verified }}
Y
{{ else }}
N
{{ end }}
</td>
<td>
{{ range .references }}
<a href="{{ .url }}" target="_blank">{{ .name }}</a>
{{ end }}
</td>
</tr>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}

</table></div>
Loading

0 comments on commit e295e37

Please sign in to comment.