1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/configuring-logging-loki-ruler.adoc
Satyajeet Munje cc94fd4ee0 OBSDOCS-693
2024-04-24 18:11:38 +00:00

44 lines
1.4 KiB
Plaintext

// Module included in the following assemblies:
//
// * observability/logging/logging_alerts/custom-logging-alerts.adoc
:_mod-docs-content-type: PROCEDURE
[id="configuring-logging-loki-ruler_{context}"]
= Configuring the ruler
When the LokiStack ruler component is enabled, users can define a group of link:https://grafana.com/docs/loki/latest/query/[LogQL] expressions that trigger logging alerts or recorded metrics.
Administrators can enable the ruler by modifying the `LokiStack` custom resource (CR).
.Prerequisites
* You have installed the {clo} and the {loki-op}.
* You have created a `LokiStack` CR.
* You have administrator permissions.
.Procedure
* Enable the ruler by ensuring that the `LokiStack` CR contains the following spec configuration:
+
[source,yaml]
----
apiVersion: loki.grafana.com/v1
kind: LokiStack
metadata:
name: <name>
namespace: <namespace>
spec:
# ...
rules:
enabled: true <1>
selector:
matchLabels:
openshift.io/<label_name>: "true" <2>
namespaceSelector:
matchLabels:
openshift.io/<label_name>: "true" <3>
----
<1> Enable Loki alerting and recording rules in your cluster.
<2> Add a custom label that can be added to namespaces where you want to enable the use of logging alerts and metrics.
<3> Add a custom label that can be added to namespaces where you want to enable the use of logging alerts and metrics.