|
| 1 | +:_mod-docs-content-type: ASSEMBLY |
| 2 | +[id="custom-logging-alerts"] |
| 3 | +include::_attributes/common-attributes.adoc[] |
| 4 | += Custom logging alerts |
| 5 | +:context: custom-logging-alerts |
| 6 | + |
| 7 | +toc::[] |
| 8 | + |
| 9 | +In logging 5.7 and later versions, users can configure the LokiStack deployment to produce customized alerts and recorded metrics. If you want to use customized link:https://grafana.com/docs/loki/latest/alert/[alerting and recording rules], you must enable the LokiStack ruler component. |
| 10 | + |
| 11 | +LokiStack log-based alerts and recorded metrics are triggered by providing link:https://grafana.com/docs/loki/latest/query/[LogQL] expressions to the ruler component. The {loki-op} manages a ruler that is optimized for the selected LokiStack size, which can be `1x.extra-small`, `1x.small`, or `1x.medium`. |
| 12 | + |
| 13 | +To provide these expressions, you must create an `AlertingRule` custom resource (CR) containing Prometheus-compatible link:https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/[alerting rules], or a `RecordingRule` CR containing Prometheus-compatible link:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/[recording rules]. |
| 14 | + |
| 15 | +Administrators can configure log-based alerts or recorded metrics for `application`, `audit`, or `infrastructure` tenants. Users without administrator permissions can configure log-based alerts or recorded metrics for `application` tenants of the applications that they have access to. |
| 16 | + |
| 17 | +Application, audit, and infrastructure alerts are sent by default to the {ocp-product-title} monitoring stack Alertmanager in the `openshift-monitoring` namespace, unless you have disabled the local Alertmanager instance. If the Alertmanager that is used to monitor user-defined projects in the `openshift-user-workload-monitoring` namespace is enabled, application alerts are sent to the Alertmanager in this namespace by default. |
| 18 | + |
| 19 | +include::modules/configuring-logging-loki-ruler.adoc[leveloffset=+1] |
| 20 | +include::modules/loki-rbac-rules-permissions.adoc[leveloffset=+1] |
| 21 | + |
| 22 | + |
| 23 | +[role="_additional-resources"] |
| 24 | +.Additional resources |
| 25 | +* link:https://docs.openshift.com/container-platform/latest/authentication/using-rbac.adoc#using-rbac[Using RBAC to define and apply permissions] |
| 26 | +
|
| 27 | +include::modules/logging-enabling-loki-alerts.adoc[leveloffset=+1] |
| 28 | + |
| 29 | +[role="_additional-resources"] |
| 30 | +[id="additional-resources_custom-logging-alerts"] |
| 31 | +== Additional resources |
| 32 | +//TODO ROSA |
| 33 | +ifdef::openshift-dedicated,openshift-rosa[] |
| 34 | +* xref:../../../observability/monitoring/monitoring-overview.adoc#about-openshift-monitoring[About {product-title} monitoring] |
| 35 | +endif::openshift-dedicated,openshift-rosa[] |
| 36 | + |
| 37 | +* link:https://docs.openshift.com/container-platform/latest/observability/monitoring/about-ocp-monitoring/about-ocp-monitoring.adoc#about-ocp-monitoring[About {ocp-product-title} monitoring] |
| 38 | +* link:https://docs.openshift.com/container-platform/latest/post_installation_configuration/configuring-alert-notifications.adoc#configuring-alert-notifications[Configuring alert notifications] |
| 39 | +// maybe need an update to https://docs.openshift.com/container-platform/4.13/observability/monitoring/monitoring-overview.html#default-monitoring-targets_monitoring-overview to talk about Loki and Vector now? Are these part of default monitoring? |
0 commit comments