From 868023ed074dcd1d03423a2a7d3639e2c73b414b Mon Sep 17 00:00:00 2001 From: Joseph Barnes Date: Wed, 27 Sep 2023 10:31:03 -0500 Subject: [PATCH] updated formating of alert properties --- .../partials/activityAlertProperties.html | 45 +++++++++++++++++++ docs/layouts/partials/logAlertProperties.html | 40 +++++++++++++++++ .../partials/metricAlertProperties.html | 44 ++++++++++++++++++ docs/layouts/shortcodes/alertList.html | 28 +++--------- 4 files changed, 135 insertions(+), 22 deletions(-) create mode 100644 docs/layouts/partials/activityAlertProperties.html create mode 100644 docs/layouts/partials/logAlertProperties.html create mode 100644 docs/layouts/partials/metricAlertProperties.html diff --git a/docs/layouts/partials/activityAlertProperties.html b/docs/layouts/partials/activityAlertProperties.html new file mode 100644 index 000000000..594bc7f3a --- /dev/null +++ b/docs/layouts/partials/activityAlertProperties.html @@ -0,0 +1,45 @@ + + + + + {{ if eq .category "Administrative" }} + + + {{ else if eq .category "ResourceHealth" }} + + + {{ else if eq .category "ServiceHealth" }} + + {{ end }} + + + + + {{ if eq .category "Administrative" }} + + + {{ else if eq .category "ResourceHealth" }} + + + {{ else if eq .category "ServiceHealth" }} + + {{ end }} + +
CategoryOperation NameStatusCausesHealth StatusIncident Type
{{ .category }}{{ .operationName }} + {{ if or (reflect.IsMap .status) (reflect.IsSlice .status) }} + {{ transform.Highlight (encoding.Jsonify (dict "prefix" "\n" "indent" " ") .status) "json" }} + {{ else }} + {{ .status }} + {{ end }} + {{ if or (reflect.IsMap .causes) (reflect.IsSlice .causes) }} + {{ transform.Highlight (encoding.Jsonify (dict "prefix" "\n" "indent" " ") .causes) "json" }} + {{ else }} + {{ .causes }} + {{ end }} + + {{ if or (reflect.IsMap .currentHealthStatus) (reflect.IsSlice .currentHealthStatus) }} + {{ transform.Highlight (encoding.Jsonify (dict "prefix" "\n" "indent" " ") .currentHealthStatus) "json" }} + {{ else }} + {{ .currentHealthStatus }} + {{ end }} + {{ .incidentType }}
diff --git a/docs/layouts/partials/logAlertProperties.html b/docs/layouts/partials/logAlertProperties.html new file mode 100644 index 000000000..278d6f624 --- /dev/null +++ b/docs/layouts/partials/logAlertProperties.html @@ -0,0 +1,40 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
DimensionsFailing PeriodsAggregationOperatorThresholdWindowFrequencySeverityMetric Measure ColumnResource ID Column
+ {{ if or (reflect.IsMap .dimensions) (reflect.IsSlice .dimensions) }} + {{ transform.Highlight (encoding.Jsonify (dict "prefix" "\n" "indent" " ") .dimensions) "json" }} + {{ else }} + {{ .dimensions }} + {{ end }} + + {{ if or (reflect.IsMap .failingPeriods) (reflect.IsSlice .failingPeriods) }} + {{ transform.Highlight (encoding.Jsonify (dict "prefix" "\n" "indent" " ") .failingPeriods) "json" }} + {{ else }} + {{ .failingPeriods }} + {{ end }} + {{ .timeAggregation }}{{ .operator }}{{ .threshold }}{{ .windowSize }}{{ .evaluationFrequency }}{{ .severity }}{{ .metricMeasureColumn }}{{ .resouceIdColumn }}
diff --git a/docs/layouts/partials/metricAlertProperties.html b/docs/layouts/partials/metricAlertProperties.html new file mode 100644 index 000000000..a847359ef --- /dev/null +++ b/docs/layouts/partials/metricAlertProperties.html @@ -0,0 +1,44 @@ + +
+ + + + {{ if eq .criterionType "DynamicThresholdCriterion" }} + + + {{ end }} + + + + + + + + + + + + {{ if eq .criterionType "DynamicThresholdCriterion" }} + + + {{ end }} + + + + + + + +
Criterion TypeDimensionsAlert SensitivityFailing PeriodsAggregationOperatorThresholdWindowFrequencySeverity
{{ .criterionType }} + {{ if or (reflect.IsMap .dimensions) (reflect.IsSlice .dimensions) }} + {{ transform.Highlight (encoding.Jsonify (dict "prefix" "\n" "indent" " ") .dimensions) "json" }} + {{ else }} + {{ .dimensions }} + {{ end }} + {{ .alertSensitivity }} + {{ if or (reflect.IsMap .failingPeriods) (reflect.IsSlice .failingPeriods) }} + {{ transform.Highlight (encoding.Jsonify (dict "prefix" "\n" "indent" " ") .failingPeriods) "json" }} + {{ else }} + {{ .failingPeriods }} + {{ end }} + {{ .timeAggregation }}{{ .operator }}{{ .threshold }}{{ .windowSize }}{{ .evaluationFrequency }}{{ .severity }}
diff --git a/docs/layouts/shortcodes/alertList.html b/docs/layouts/shortcodes/alertList.html index 2c8df77cd..ac2bae1dd 100644 --- a/docs/layouts/shortcodes/alertList.html +++ b/docs/layouts/shortcodes/alertList.html @@ -39,28 +39,12 @@

{{ .name }} - {{ .type }} Alert

{{ .description }}

Recommended Properties:

- {{ range $key, $value := .properties }} -
- {{ if reflect.IsMap $value }} - {{ humanize $key }}: - {{ range $key, $value := $value }} -
- {{ if reflect.IsMap $value }} - {{ humanize $key }}: - {{ range $key, $value := $value }} -
- {{ humanize $key }}: {{ $value }} -
- {{ end }} - {{ else }} - {{ humanize $key }}: {{ $value }} - {{ end }} -
- {{ end }} - {{ else if ne $key "query" }} - {{ humanize $key }}: {{ $value }} - {{ end }} -
+ {{ if eq .type "Metric" }} + {{- partial "metricAlertProperties" .properties }} + {{ else if eq .type "Log" }} + {{- partial "logAlertProperties" .properties }} + {{ else if eq .type "ActivityLog" }} + {{- partial "activityAlertProperties" .properties }} {{ end }} {{ if .properties.query }}