diff --git a/modules/monitoring-attaching-additional-labels-to-your-time-series-and-alerts.adoc b/modules/monitoring-attaching-additional-labels-to-your-time-series-and-alerts.adoc index 8262f380dc33..0fb3662af9ec 100644 --- a/modules/monitoring-attaching-additional-labels-to-your-time-series-and-alerts.adoc +++ b/modules/monitoring-attaching-additional-labels-to-your-time-series-and-alerts.adoc @@ -6,7 +6,7 @@ [id="attaching-additional-labels-to-your-time-series-and-alerts_{context}"] = Attaching additional labels to your time series and alerts -Using the external labels feature of Prometheus, you can attach custom labels to all time series and alerts leaving Prometheus. +You can attach custom labels to all time series and alerts leaving Prometheus by using the external labels feature of Prometheus. .Prerequisites @@ -49,17 +49,19 @@ data: config.yaml: | prometheusK8s: externalLabels: - : <1> + : # <1> ---- + <1> Substitute `: ` with a map of key-value pairs where `` is a unique name for the new label and `` is its value. + [WARNING] ==== -Do not use `prometheus` or `prometheus_replica` as key names, because they are reserved and will be overwritten. +* Do not use `prometheus` or `prometheus_replica` as key names, because they are reserved and will be overwritten. + +* Do not use `cluster` or `managed_cluster` as key names. Using them can cause issues where you are unable to see data in the developer dashboards. ==== + -For example, to add metadata about the region and environment to all time series and alerts, use: +For example, to add metadata about the region and environment to all time series and alerts, use the following example: + [source,yaml] ---- @@ -98,14 +100,16 @@ data: config.yaml: | prometheus: externalLabels: - : <1> + : # <1> ---- + <1> Substitute `: ` with a map of key-value pairs where `` is a unique name for the new label and `` is its value. + [WARNING] ==== -Do not use `prometheus` or `prometheus_replica` as key names, because they are reserved and will be overwritten. +* Do not use `prometheus` or `prometheus_replica` as key names, because they are reserved and will be overwritten. + +* Do not use `cluster` or `managed_cluster` as key names. Using them can cause issues where you are unable to see data in the developer dashboards. ==== + [NOTE] @@ -113,7 +117,7 @@ Do not use `prometheus` or `prometheus_replica` as key names, because they are r In the `openshift-user-workload-monitoring` project, Prometheus handles metrics and Thanos Ruler handles alerting and recording rules. Setting `externalLabels` for `prometheus` in the `user-workload-monitoring-config` `ConfigMap` object will only configure external labels for metrics and not for any rules. ==== + -For example, to add metadata about the region and environment to all time series and alerts related to user-defined projects, use: +For example, to add metadata about the region and environment to all time series and alerts related to user-defined projects, use the following example: + [source,yaml] ----