diff --git a/docs/sources/alerting/alerting-rules/templates/examples.md b/docs/sources/alerting/alerting-rules/templates/examples.md index e31cda2f626..c8c6f9dbb40 100644 --- a/docs/sources/alerting/alerting-rules/templates/examples.md +++ b/docs/sources/alerting/alerting-rules/templates/examples.md @@ -193,15 +193,11 @@ For additional functions to display or format data, refer to: Here’s an example of creating a `severity` label based on a query value: ```go -{{ if (gt $values.A.Value 90.0) -}} -critical -{{ else if (gt $values.A.Value 80.0) -}} -high -{{ else if (gt $values.A.Value 60.0) -}} -medium -{{ else -}} -low -{{- end }} +{{- if (gt $values.A.Value 90.0) -}}critical +{{- else if (gt $values.A.Value 80.0) -}}high +{{- else if (gt $values.A.Value 60.0) -}}medium +{{- else -}}low +{{- end -}} ``` In this example, the `severity` label is determined by the query value: @@ -222,10 +218,13 @@ You should avoid displaying query values in labels, as this may create many aler You can use labels to differentiate alerts coming from various environments (e.g., production, staging, dev). For example, you may want to add a label that sets the environment based on the instance’s label. Here’s how you can template it: ```go -{{ if eq $labels.instance "prod-server-1" }}production -{{ else if eq $labels.instance "staging-server-1" }}staging -{{ else }}development -{{ end }} +{{- if eq $labels.instance "prod-server-1" -}} +production +{{- else if eq $labels.instance "staging-server-1" -}} +staging +{{- else -}} +development +{{- end -}} ``` This would print: @@ -237,10 +236,13 @@ This would print: To make this template more flexible, you can use a regular expression that matches the instance name with the instance name prefix using the [`match()`](ref:reference-match) function: ```go -{{ if match "^prod-server-.*" $labels.instance }}production -{{ else if match "^staging-server-.*" $labels.instance}}staging -{{ else }}development -{{ end }} +{{- if match "^prod-server-.*" $labels.instance -}} +production +{{- else if match "^staging-server-.*" $labels.instance -}} +staging +{{- else -}} +development +{{- end -}} ``` {{< collapse title="Legacy Alerting templates" >}} diff --git a/docs/sources/alerting/fundamentals/alert-rule-evaluation/state-and-health.md b/docs/sources/alerting/fundamentals/alert-rule-evaluation/state-and-health.md index cb4f932a5f6..e42e40a3a04 100644 --- a/docs/sources/alerting/fundamentals/alert-rule-evaluation/state-and-health.md +++ b/docs/sources/alerting/fundamentals/alert-rule-evaluation/state-and-health.md @@ -91,7 +91,7 @@ Note that `No Data` and `Error` states are supported only for Grafana-managed al {{< docs/shared lookup="alerts/table-configure-no-data-and-error.md" source="grafana" version="" >}} -Note that when you configure the **No Data** or **Error** behavior to `Alerting` or `Normal`, Grafana attempts to keep a stable set of fields under notification `Values`. If your query returns no data or an error, Grafana re-uses the latest known set of fields in `Values`, but will use `-1` in place of the measured value. +Note that when you configure the **No Data** or **Error** behavior to `Alerting` or `Normal`, Grafana attempts to keep a stable set of fields under notification `Values`. If your query returns no data or an error, Grafana reuses the latest known set of fields in `Values`, but will use `-1` in place of the measured value. ### Reduce `No Data` or `Error` alerts diff --git a/docs/sources/setup-grafana/installation/helm/index.md b/docs/sources/setup-grafana/installation/helm/index.md index b22cfd4ce5a..1aa96712e89 100644 --- a/docs/sources/setup-grafana/installation/helm/index.md +++ b/docs/sources/setup-grafana/installation/helm/index.md @@ -187,7 +187,7 @@ This section describes the steps you must complete to access Grafana via web bro ## Customize Grafana default configuration -Helm is a popular package manager for Kubernetes. It bundles Kubernetes resource manifests to be re-used across different environments. These manifests are written in a templating language, allowing you to provide configuration values via `values.yaml` file, or in-line using Helm, to replace the placeholders in the manifest where these configurations should reside. +Helm is a popular package manager for Kubernetes. It bundles Kubernetes resource manifests to be reused across different environments. These manifests are written in a templating language, allowing you to provide configuration values via `values.yaml` file, or in-line using Helm, to replace the placeholders in the manifest where these configurations should reside. The `values.yaml` file allows you to customize the chart's configuration by specifying values for various parameters such as image versions, resource limits, service configurations, etc.