Alerts
Configuring logging alerts.
Abstract
Chapter 1. Default logging alerts
Logging alerts are installed as part of the Red Hat OpenShift Logging Operator installation. Alerts depend on metrics exported by the log collection and log storage backends. These metrics are enabled if you selected the option to Enable Operator recommended cluster monitoring on this namespace when installing the Red Hat OpenShift Logging Operator.
Default logging alerts are sent to the OpenShift Container Platform monitoring stack Alertmanager in the openshift-monitoring namespace, unless you have disabled the local Alertmanager instance.
1.1. Accessing the Alerting UI from the Administrator perspective
You can access the Alerting user interface (UI) through the Administrator perspective of the OpenShift Container Platform web console.
Prerequisites
- You have administrator permissions.
- You have access to the OpenShift Container Platform web console.
Procedure
- From the Administrator perspective, go to Observe → Alerting. The three main pages in the Alerting UI in this perspective are the Alerts, Silences, and Alerting rules pages.
1.2. Red Hat OpenShift Logging Operator alerts
The following alerts are generated by the Vector collector. You can view these alerts in the OpenShift Container Platform web console.
Table 1.1. Vector collector alerts
| Alert | Message | Description | Severity |
|---|---|---|---|
|
|
| The ClusterLogForwarder has a runtime configuration error where routing of unmatched log entries could result in the logs being dropped. Open an issue with support and include the ClusterLogForwarder and generated collector configuration. | Error |
|
|
| The rate of output errors detected for the pod exceeds the threshold of 10%. This could indicate the output URL is misconfigured, the receiver is unavailable, or there are networking issues for that pod. | Critical |
|
|
| The Azure Monitor HTTP Data Collector API used by the azureMonitor output type will be retired on September 14, 2026. After this date, log forwarding to Azure Monitor using this output type will stop functioning. Administrators must migrate to the Azure Monitor Logs Ingestion output. | Warning |
|
|
| Vector is reporting that Prometheus could not scrape a specific Vector instance. | Critical |
|
|
| Collectors are consuming too much node disk on the host. | Warning |
|
|
| The collector source owned by ClusterLogForwarder is discarding logs. This typically occurs when log lines exceed the configured maxMessageSize limit. | Warning |
|
|
| At least 10% of sent requests responded with "HTTP 403 Forbidden" for collector in namespace for the output. | Critical |
1.3. Loki Operator alerts
The following alerts are generated by the Loki Operator. You can view these alerts in the OpenShift Container Platform web console.
Table 1.2. Loki Operator alerts
| Alert | Message | Description | Severity |
|---|---|---|---|
|
|
| One or more Loki ingesters are failing to flush at least 20% of their chunks to backend storage over a 5-minute period. This indicates issues with storage connectivity, authentication, or storage capacity that require immediate intervention. | critical |
|
|
|
At least 10% of requests result in | critical |
|
|
|
At least 10% of write requests to the lokistack-gateway result in | critical |
|
|
|
At least 10% of query requests to the lokistack-gateway result in | critical |
|
|
| A panic was triggered. | critical |
|
|
| The 99th percentile is experiencing latency higher than 1 second. | critical |
|
|
| At least 10% of requests are received the rate limit error code. | warning |
|
|
| The storage path is experiencing slow write response rates. | warning |
|
|
| The storage path is experiencing slow read response rates. | warning |
|
|
| The write path is experiencing high load causing backpressure storage flushing. | warning |
|
|
| The read path has a high volume of queries, causing longer response times. | warning |
|
|
| Loki is discarding samples during ingestion because they fail validation. | warning |
|
|
|
The | warning |
|
|
| One or more of the deployed LokiStacks has an outdated storage schema configuration. | warning |
1.4. Troubleshooting the CollectorNodeDown alert
The CollectorNodeDown alert fires when Prometheus cannot scrape metrics from a log collector pod for more than 10 minutes. This alert indicates that the collector’s metrics endpoint is unreachable, which might mean the pod is down, crashed, experiencing network issues, or has an unresponsive metrics port. Without metrics, you lose observability for monitoring collector health and performance. Additionally, other collector-related alerts cannot fire, potentially masking additional problems.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
Check the status of collector pods:
$ oc get pods -n openshift-logging -l app.kubernetes.io/component=collector
Examine the details of any problematic pods:
$ oc describe pod _<pod_name>_ -n openshift-logging
Replace
<pod_name>with the name of the affected collector pod.Review the collector pod logs:
$ oc logs _<pod_name>_ -n openshift-logging
Test the metrics endpoint directly:
$ oc exec _<pod_name>_ -n openshift-logging -- curl -s http://localhost:24231/metrics
The default metrics port for the collector is 24231.
Check for network policies that might block metrics scraping:
$ oc get networkpolicies -n openshift-logging
Verify that the ServiceMonitor resource exists:
$ oc get servicemonitor -n openshift-logging
Check the service and endpoints configuration:
$ oc get service -n openshift-logging $ oc get endpoints -n openshift-logging
Troubleshooting
Based on your diagnosis, apply the appropriate mitigation:
If the pod is unhealthy, restart it by deleting the pod. The DaemonSet controller automatically recreates it:
$ oc delete pod _<pod_name>_ -n openshift-logging
- If the pod has resource constraints, check the resource requests and limits, and verify that the node has sufficient capacity.
-
If the
ClusterLogForwarderconfiguration has errors, review and correct the configuration. - If there are node-level issues, check node readiness, taints, and available resources.
- If network connectivity is the issue, verify that network policies, the Service, and the ServiceMonitor are correctly configured to allow Prometheus to scrape the metrics endpoint on port 24231.
Additional resources
1.5. Troubleshooting the CollectorHigh403ForbiddenResponseRate alert
The CollectorHigh403ForbiddenResponseRate alert fires when the log collector experiences a sustained high rate of HTTP 403 Forbidden responses when sending data to the configured log store. A 403 response indicates that the server understood the request but refuses to authorize it. This alert indicates authentication or authorization issues that are causing log data loss at the destination.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
app_kubernetes_io_instance: The collector name -
namespace: The collector namespace -
component_id: The specific failing Vector sink, such asoutput_lokistack_otlp_applicationoroutput_my_splunk
-
Review the
ClusterLogForwarderconfiguration to identify the output definition that matches thecomponent_idfrom the alert:$ oc get clusterlogforwarder _<clusterlogforwarder_name>_ -n _<namespace>_ -o yaml
Locate the Kubernetes secret referenced by the output definition and verify the secret exists:
$ oc get secret _<secret_name>_ -n _<namespace>_
Verify that the secret contains the expected keys with valid, non-empty values:
$ oc get secret _<secret_name>_ -n _<namespace>_ -o yaml
- Confirm that the credentials in the secret have the necessary permissions for write access to the target log store.
Troubleshooting
Based on your diagnosis, apply the appropriate mitigation:
- If authentication credentials are incorrect or expired, update the OpenShift secret with correct and valid credentials.
-
If the
ClusterLogForwarderconfiguration has errors, edit the custom resource to fix any configuration issues. - If the external log store lacks proper authorization, work with the log store administrator to ensure the credentials have proper write permissions through role or access policy adjustments.
For Red Hat managed LokiStack deployments, verify that the
logging-collector-logs-writercluster role exists and is bound to the service account:Check for the cluster role:
$ oc get clusterrole logging-collector-logs-writer
Get the service account associated with the
ClusterLogForwarder:$ oc get clusterlogforwarder _<clusterlogforwarder_name>_ -o jsonpath='{.spec.serviceAccount}' -n _<namespace>_Check which cluster roles the service account is bound to:
$ oc get clusterrolebinding -o json | jq -r 'try .items[]? | select(.subjects[].name=="_<service_account_name>_").roleRef.name'
If the service account is not bound to
logging-collector-logs-writer, create the binding:$ oc adm policy add-cluster-role-to-user logging-collector-logs-writer -z _<service_account_name>_ -n _<service_account_namespace>_
1.6. Troubleshooting the ClusterLogForwarderOutputErrorRate alert
The ClusterLogForwarderOutputErrorRate alert fires when the log collector has at least a 10% error rate over the last 5 minutes when forwarding logs to an output destination. This alert indicates errors for a specific output of a particular ClusterLogForwarder instance and usually points to either a ClusterLogForwarder misconfiguration or destination service unavailability. This can result in log data loss at the configured log store.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
app_kubernetes_io_instance: The collector name -
namespace: The collector namespace -
component_id: The failing sink ID, such asoutput_lokistack_otlp_applicationoroutput_my_splunk -
error_kind: The general error category
-
Check the collector pod logs to identify the specific error details:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/instance=_<collector_name>_ | grep -i error | tail -50
The logs contain detailed error messages such as:
-
error trying to connect: dns error: failed to lookup address information: Name or service not known- DNS resolution failure -
connection refused- Service not listening on the configured port -
certificate verify failed- TLS certificate validation error -
401 Unauthorizedor403 Forbidden- Authentication or authorization failure
-
Review the
ClusterLogForwarderconfiguration to find the output definition that matches thecomponent_idfrom the alert:$ oc get clusterlogforwarder _<clusterlogforwarder_name>_ -n _<namespace>_ -o yaml
- Verify that the log receiver service is available and reachable from the cluster.
- Validate the authorization credentials for the log receiver.
In the
ClusterLogForwarderconfiguration, verify the following:- The output URL is correct
- The TLS configuration in secrets and config maps is valid
- The authorization credentials in secrets are correct
Troubleshooting
Based on your diagnosis and the specific error, apply the appropriate mitigation:
-
If the
ClusterLogForwarderconfiguration has errors, edit the custom resource to correct any typos or misconfigurations. - If authentication credentials are incorrect or expired, update the OpenShift secret with valid credentials.
- If TLS certificates are incorrect or expired, update the secret or config map with the correct certificates.
- If the log receiver service is unavailable, work with the service administrator to restore service availability.
1.7. Troubleshooting the CollectorSourceDiscardedLogs alert
The CollectorSourceDiscardedLogs alert fires when a collector source is discarding logs. This typically occurs when log lines exceed the configured maxMessageSize limit. Discarded logs result in incomplete log data being forwarded to the configured destinations.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The collector namespace -
app_kubernetes_io_instance: TheClusterLogForwarderinstance name -
component_id: The source component that is discarding logs
-
Check the collector pod logs for details about discarded log lines:
$ oc logs _<collector_pod_name>_ -n openshift-logging | grep -i discard
Review the
ClusterLogForwarderconfiguration to check themaxMessageSizesetting:$ oc get clusterlogforwarder _<clusterlogforwarder_name>_ -n _<namespace>_ -o yaml
The default
maxMessageSizeis 3 MB (3145728 bytes). Log lines exceeding this size are discarded.Identify which pods or containers are producing oversized log lines by querying the collector metrics:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'rate(log_source_internal_metrics_events_discarded_total{reason="message_too_large"}[5m]) > 0'The output shows which collector sources (identified by
component_idlabel) are discarding logs.Identify the specific pods or namespaces affected:
$ oc logs _<collector_pod_name>_ -n openshift-logging | grep -i "discarded\|too large" | head -20
Look for log entries indicating which application pod or namespace is generating oversized messages.
Investigate the source of oversized log lines:
- Check application logs for unusually large log entries such as stack traces, debug output, or data dumps
- Review container configurations for verbose logging settings
- Identify if specific error conditions trigger large log messages
Troubleshooting
Based on your diagnosis, apply the appropriate mitigation:
If legitimate log lines are being discarded due to size, increase the
maxMessageSizein theClusterLogForwarderspecification for the affected input:apiVersion: observability.openshift.io/v1 kind: ClusterLogForwarder metadata: name: instance namespace: openshift-logging spec: inputs: - name: my-app-input type: application application: tuning: maxMessageSize: 6Mi # Increase from default 3Mi pipelines: - name: my-pipeline inputRefs: - my-app-input outputRefs: - defaultImportantIncreasing
maxMessageSizeincreases memory usage in the collector pods. Ensure that collector pods have sufficient memory resources.If applications are generating excessively large log lines, work with application developers to:
- Reduce log verbosity
- Split large log entries into multiple smaller entries
- Use structured logging to avoid dumping large data structures
-
If the source of large log lines cannot be reduced, consider using content filtering in the
ClusterLogForwarderto drop or truncate specific log entries before forwarding.
1.8. Troubleshooting the LokiIngesterFlushFailureRateCritical alert
The LokiIngesterFlushFailureRateCritical alert fires when a Loki ingester has a critical flush failure rate of at least 20% over the last 5 minutes. This indicates that data is not being flushed to the object storage backend, which can result in log data loss. This alert requires immediate attention.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
pod: The specific ingester pod experiencing flush failures
-
Check the status of the affected ingester pod:
$ oc get pod _<pod_name>_ -n _<namespace>_
Review the ingester pod logs for flush-related errors:
$ oc logs _<pod_name>_ -n _<namespace>_ | grep -i flush
Look for error messages related to storage connectivity, authentication, or capacity issues.
Verify that the object storage bucket is accessible and has not been deleted or modified:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o yaml
Check the
spec.storagesection for the object storage configuration.Check the secret containing the object storage credentials:
$ oc get secret _<storage_secret_name>_ -n _<namespace>_ -o yaml
Verify that the secret exists and contains valid credentials.
Verify network connectivity from the ingester pod to the object storage endpoint:
$ oc exec _<pod_name>_ -n _<namespace>_ -- curl -v _<storage_endpoint_url>_
- Check for storage capacity issues in the object storage backend by reviewing bucket usage and quotas through your cloud provider’s console or CLI tools.
Troubleshooting
Based on your diagnosis, apply the appropriate mitigation:
- If the storage bucket is inaccessible or has been deleted, restore the bucket or update the LokiStack configuration with the correct bucket name.
If authentication credentials are invalid or expired, update the storage secret with valid credentials:
$ oc edit secret _<storage_secret_name>_ -n _<namespace>_
- If network connectivity is blocked, verify that network policies, firewall rules, or security groups allow egress traffic from the ingester pods to the object storage endpoint.
- If the storage backend is experiencing capacity issues or throttling, work with your storage administrator to increase capacity or adjust rate limits.
If the object storage endpoint URL has changed, update the LokiStack configuration:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Verification
After applying the fix, monitor the alert status:
Check that the flush failure rate decreases:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'rate(loki_ingester_chunks_flush_failures_total[5m]) / rate(loki_ingester_chunks_flush_requests_total[5m])'
- Verify that the alert clears in the Red Hat OpenShift Logging web console after approximately 15 minutes.
1.9. Troubleshooting the LokiStackWriteRequestErrors alert
The LokiStackWriteRequestErrors alert fires when at least 10% of write requests to the LokiStack gateway result in 5xx server errors over a 15-minute period. This indicates that log ingestion is failing, which can result in log data loss.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The LokiStack gateway job experiencing write errors
-
Check the status of the LokiStack gateway pods:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=lokistack-gateway
Review the LokiStack gateway logs for write request errors:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=lokistack-gateway --tail=100 | grep -i error
Check the status of the LokiStack distributor and ingester components:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=distributor $ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=ingester
Review the LokiStack custom resource status for component health:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o jsonpath='{.status}'Check for resource constraints on the ingester pods:
$ oc describe pod -n _<namespace>_ -l app.kubernetes.io/component=ingester
Look for memory or CPU throttling, OOMKilled events, or resource limit warnings.
Verify that the object storage backend is accessible and functioning:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=ingester | grep -i storage
Troubleshooting
Based on your diagnosis, apply the appropriate mitigation:
- If gateway, distributor, or ingester pods are unhealthy, check pod logs for specific errors and restart the affected pods if necessary.
If components are experiencing resource constraints, increase the resource requests and limits in the LokiStack specification:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Adjust the
spec.limitsor use a larger LokiStack size.- If the object storage backend is experiencing issues, verify storage connectivity, credentials, and capacity. See the LokiIngesterFlushFailureRateCritical troubleshooting procedure for detailed storage diagnostics.
If the distributor is rejecting writes due to rate limiting, review and adjust the per-tenant limits:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o yaml
Check the
spec.limits.tenantssection for rate limit configuration.- If network connectivity between components is failing, verify that network policies and service configurations allow traffic between gateway, distributor, and ingester pods.
Verification
After applying the fix, monitor the alert status:
Check the error rate for write requests:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum(rate(lokistack_gateway_http_requests_total{code=~"5..", handler="push"}[5m])) / sum(rate(lokistack_gateway_http_requests_total{handler="push"}[5m]))'- Verify that the alert clears in the Red Hat OpenShift Logging web console after approximately 15 minutes.
1.10. Troubleshooting the LokiStackReadRequestErrors alert
The LokiStackReadRequestErrors alert fires when at least 10% of query requests to the LokiStack gateway result in 5xx server errors over a 15-minute period. This indicates that log queries are failing, preventing users from viewing and analyzing their logs.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The LokiStack gateway job experiencing read errors
-
Check the status of the LokiStack gateway pods:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=lokistack-gateway
Review the LokiStack gateway logs for query request errors:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=lokistack-gateway --tail=100 | grep -i error
Check the status of the LokiStack querier and query front end components:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=querier $ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=query front end
Review the querier logs for specific query errors:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=querier --tail=100 | grep -E 'error|failed|timeout'
Check for resource constraints on the querier pods:
$ oc describe pod -n _<namespace>_ -l app.kubernetes.io/component=querier
Look for memory or CPU throttling, OOMKilled events, or resource limit warnings.
Verify that the object storage backend is accessible:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=querier | grep -i storage
Check if query timeouts are occurring due to expensive queries:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=querier | grep -i timeout
For comprehensive query performance optimization and analysis, see This content is not included.Loki query performance troubleshooting.
Based on your diagnosis, apply the appropriate mitigation:
- If gateway, querier, or query front end pods are unhealthy, check pod logs for specific errors and restart the affected pods if necessary.
If querier pods are experiencing resource constraints, increase the resource requests and limits in the LokiStack specification:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Adjust the
spec.limitsor use a larger LokiStack size.- If the object storage backend is experiencing issues, verify storage connectivity and credentials. Check for slow read performance or storage service degradation.
If queries are timing out due to large time ranges or high cardinality, educate users on query best practices:
- Use specific time ranges instead of querying days or weeks of data
- Add label filters to reduce the data set
- Avoid regex queries on high-cardinality labels
- If the query front end cache is experiencing issues, review the cache configuration and consider increasing cache size or adjusting cache retention policies.
- If network connectivity between components is failing, verify that network policies and service configurations allow traffic between gateway, query front end, querier, and ingester pods.
Verification
After applying the fix, monitor the alert status:
Check the error rate for query requests:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum(rate(lokistack_gateway_http_requests_total{code=~"5..", handler=~"query|query_range"}[5m])) / sum(rate(lokistack_gateway_http_requests_total{handler=~"query|query_range"}[5m]))'- Verify that the alert clears in the Red Hat OpenShift Logging web console after approximately 15 minutes.
1.11. Troubleshooting the LokiRequestErrors alert
The LokiRequestErrors alert fires when at least 10% of requests to a Loki component result in 5xx server errors over a 15-minute period. This is a general alert that indicates internal errors in Loki components such as distributors, ingesters, or queriers. These errors can affect both log ingestion and query operations.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The specific Loki component job experiencing errors, such aslokistack-distributor,lokistack-ingester, orlokistack-querier -
route: The API route experiencing errors
-
Identify the affected Loki component from the
joblabel and check the pod status:$ oc get pods -n _<namespace>_ | grep _<component_name>_
For example, if
job=lokistack-ingester, check ingester pods.Review the component logs for error details:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=_<component_name>_ --tail=100 | grep -E 'error|ERROR|5[0-9]{2}'Check the LokiStack custom resource status:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o jsonpath='{.status.conditions}'Check for resource constraints on the affected component:
$ oc describe pod -n _<namespace>_ -l app.kubernetes.io/component=_<component_name>_
Look for memory or CPU throttling, OOMKilled events, or resource limit warnings.
Review recent configuration changes to the LokiStack:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o yaml
Check for related alerts that might provide more context:
$ oc get prometheusrule -n _<namespace>_ -o yaml | grep -A 10 "LokiStack\|Loki"
Troubleshooting
Based on your diagnosis and the affected component, apply the appropriate mitigation:
If the affected component pods are unhealthy or restarting, check the pod logs for specific errors. Common issues include:
- Configuration errors from recent LokiStack changes
- Resource exhaustion (memory or CPU limits)
- Storage backend connectivity issues
- Network connectivity between components
If components are experiencing resource constraints, increase the resource requests and limits in the LokiStack specification:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Adjust the
spec.limitsor use a larger LokiStack size.If the errors are related to storage operations:
- For distributors or ingesters: Verify object storage connectivity and credentials
- For querier components: Check object storage read performance and accessibility
If the errors are specific to a particular route or operation, consider whether the requests themselves are valid:
- Check for malformed queries or invalid write requests
- Review application logs that are being ingested for unusual patterns
- If configuration changes were recently applied, review and validate the LokiStack specification for errors.
Verification
After applying the fix, monitor the alert status:
Check the error rate for the affected component:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[5m])) by (job, route) / sum(rate(loki_request_duration_seconds_count[5m])) by (job, route)'- Verify that the alert clears in the Red Hat OpenShift Logging web console after approximately 15 minutes.
1.12. Troubleshooting the ClusterLogForwarderRuntimeConfigurationMissingUnmatched alert
The ClusterLogForwarderRuntimeConfigurationMissingUnmatched alert fires when the ClusterLogForwarder has an incomplete configuration where routing of unmatched log entries could result in logs being dropped. This indicates a runtime configuration error that requires immediate attention to prevent log data loss.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing theClusterLogForwarder -
app_kubernetes_io_instance: TheClusterLogForwarderinstance name
-
Review the
ClusterLogForwarderconfiguration:$ oc get clusterlogforwarder _<clusterlogforwarder_name>_ -n _<namespace>_ -o yaml
Check the status of the
ClusterLogForwarderfor configuration errors:$ oc get clusterlogforwarder _<clusterlogforwarder_name>_ -n _<namespace>_ -o jsonpath='{.status.conditions}'Review the collector pod logs for unmatched log entry warnings:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/instance=_<clusterlogforwarder_name>_ | grep -i unmatched
Examine the generated collector configuration:
$ oc get configmap _<collector_configmap_name>_ -n _<namespace>_ -o yaml
The collector configuration is generated from the
ClusterLogForwarderspecification.
Troubleshooting
The most common cause is missing pipeline configuration for certain log types or sources. Apply the appropriate mitigation:
-
Verify that all log sources referenced in pipelines are properly defined in the
spec.inputssection. Ensure that pipelines exist for all expected log types (application, infrastructure, audit) that you want to collect:
apiVersion: logging.openshift.io/v1 kind: ClusterLogForwarder metadata: name: instance spec: pipelines: - name: application-logs inputRefs: - application outputRefs: - default - name: infrastructure-logs inputRefs: - infrastructure outputRefs: - default - name: audit-logs inputRefs: - audit outputRefs: - defaultIf you use custom inputs, verify that they are correctly defined and referenced:
spec: inputs: - name: my-app-logs application: namespaces: - my-namespace pipelines: - name: custom-app-pipeline inputRefs: - my-app-logs outputRefs: - my-output-
Contact Red Hat support and include both the
ClusterLogForwardercustom resource and a logging must-gather for analysis. For information about collecting a logging must-gather, see This content is not included.Collecting logging data for Red Hat Support.
Verification
After fixing the configuration, verify that the alert clears:
Apply the corrected
ClusterLogForwarderconfiguration:$ oc apply -f clusterlogforwarder.yaml
Monitor the collector pod logs to confirm that unmatched log warnings no longer appear:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/instance=_<clusterlogforwarder_name>_ --follow | grep -i unmatched
- Verify that the alert clears in the Red Hat OpenShift Logging web console after approximately 5 minutes.
Additional resources
1.13. Troubleshooting the ClusterLogForwarderAzureMonitorLogsDeprecation alert
The ClusterLogForwarderAzureMonitorLogsDeprecation alert fires when a ClusterLogForwarder is configured to forward logs to Azure Monitor by using the deprecated HTTP Data Collector API. The Azure Monitor HTTP Data Collector API will be retired on September 14, 2026. After this date, log forwarding using the azureMonitor output type will stop functioning.
Support for the Azure Monitor Logs Ingestion API using the azureLogsIngestion output type is available in Red Hat OpenShift Logging 6.6 and later.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc). - You have access to Azure portal or Azure CLI to configure the Logs Ingestion API.
Procedure
Identify the
ClusterLogForwarderinstances using the deprecated API:$ oc get clusterlogforwarder --all-namespaces -o json | jq -r '.items[] | select(.spec.outputs[]?.type == "azureMonitor") | "\(.metadata.namespace)/\(.metadata.name)"'
For each affected
ClusterLogForwarder, review the current configuration:$ oc get clusterlogforwarder _<clusterlogforwarder_name>_ -n _<namespace>_ -o yaml
In the Azure portal, configure the Azure Monitor Logs Ingestion API:
- Create a Data Collection Endpoint (DCE).
- Create a Data Collection Rule (DCR) and associate it with the DCE.
- Create a custom table in your Log Analytics workspace.
- Assign the "Monitoring Metrics Publisher" role to the service principal or managed identity.
- Note the DCE endpoint URL, DCR immutable ID, and stream name for the next step.
Update the
ClusterLogForwarderconfiguration to use the Azure Monitor Logs Ingestion output type:apiVersion: observability.openshift.io/v1 kind: ClusterLogForwarder metadata: name: instance namespace: openshift-logging spec: outputs: - name: azure-monitor-ingestion type: azureLogsIngestion # New output type azureMonitor: authentication: type: servicePrincipal servicePrincipal: clientId: _<client_id>_ tenantId: _<tenant_id>_ clientSecretName: azure-secret dceEndpoint: _<dce_endpoint_url>_ dcrImmutableId: _<dcr_immutable_id>_ streamName: _<stream_name>_ pipelines: - name: application-logs inputRefs: - application outputRefs: - azure-monitor-ingestionCreate or update the secret containing the Azure service principal credentials:
$ oc create secret generic azure-secret \ --from-literal=clientSecret=_<client_secret>_ \ -n _<namespace>_
Apply the updated
ClusterLogForwarderconfiguration:$ oc apply -f clusterlogforwarder.yaml
Verification
After migrating to the Logs Ingestion API, verify that log forwarding is working:
Check the collector pod logs for successful Azure Monitor connections:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/instance=_<clusterlogforwarder_name>_ | grep -i azure
- In the Azure portal, verify that logs are appearing in the custom table.
- Verify that the alert clears in the Red Hat OpenShift Logging web console after approximately 5 minutes.
1.14. Troubleshooting the DiskBufferUsage alert
The DiskBufferUsage alert fires when log collectors are consuming more than 15% of the node’s /var filesystem for disk buffering. High disk buffer usage can indicate that log forwarding is slower than log generation, causing Vector to buffer logs to disk. If left unaddressed, this can fill the node’s disk and affect other workloads.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
-
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the
hostnamelabel to identify the affected node. Check the disk usage on the affected node:
$ oc debug node/_<node_name>_ -- df -h /var
Review the Vector disk buffer configuration and current usage:
$ oc exec -n openshift-logging _<collector_pod_name>_ -- ls -lh /var/lib/vector
Check the collector pod logs for slow output or connection errors:
$ oc logs -n openshift-logging _<collector_pod_name>_ --tail=100 | grep -E 'slow|timeout|error|buffer'
Review the
ClusterLogForwarderconfiguration to identify output destinations:$ oc get clusterlogforwarder -n openshift-logging -o yaml
Check if the output destinations are reachable and responding:
$ oc exec -n openshift-logging _<collector_pod_name>_ -- curl -v _<output_destination_url>_
Review the rate of log generation on the node to determine if it exceeds normal levels:
$ oc exec -n openshift-logging _<collector_pod_name>_ -- vector top
Troubleshooting
Based on your diagnosis, apply the appropriate mitigation:
-
If log forwarding outputs are slow or unavailable, troubleshoot the destination systems. See the
ClusterLogForwarderOutputErrorRatetroubleshooting procedure for detailed diagnostics. If log generation has increased significantly, investigate the source:
- Check for applications with increased verbosity or debug logging enabled
- Look for pods in crash loops generating excessive error logs
- Review recent application deployments that might have changed logging behavior
If the disk buffer is accumulating due to temporary output unavailability, the buffer should drain automatically once the outputs recover. Monitor the buffer usage:
$ watch 'oc exec -n openshift-logging _<collector_pod_name>_ -- du -sh /var/lib/vector'
If normal log generation consistently exceeds forwarding capacity, consider:
- Adding content filtering to reduce log volume
- Increasing collector resource limits to improve throughput
- Optimizing output configurations for better performance
- As a temporary measure to prevent node disk exhaustion, you can reduce the maximum disk buffer size in the Vector configuration. However, this will cause log drops if the buffer fills up.
Verification
After applying the fix, monitor the disk buffer usage:
Check that the buffer usage is decreasing:
$ oc exec -n openshift-logging _<collector_pod_name>_ -- du -sh /var/lib/vector
- Verify that the alert clears in the Red Hat OpenShift Logging web console after buffer usage drops below 15%.
1.15. Troubleshooting the LokistackComponentsNotReadyWarning alert
The LokistackComponentsNotReadyWarning alert fires when a LokiStack has components that have not reached the Ready state for more than 15 minutes. This might be related to OpenShift resources such as pods or deployments, configuration errors, or external dependencies. Until all components are ready, log ingestion or query functionality might be impaired.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
stack_name: The LokiStack instance name
-
Check the LokiStack status for component readiness:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o jsonpath='{.status.conditions}' | jqList all pods associated with the LokiStack and check their status:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/instance=_<lokistack_name>_
Identify pods that are not in Running or Ready state and examine their details:
$ oc describe pod _<pod_name>_ -n _<namespace>_
Review the logs of unhealthy pods:
$ oc logs _<pod_name>_ -n _<namespace>_
Check for resource constraints, image pull errors, or configuration issues in the pod events:
$ oc get events -n _<namespace>_ --field-selector involvedObject.name=_<pod_name>_ --sort-by='.lastTimestamp'
Troubleshooting
Based on your diagnosis, apply the appropriate mitigation:
- If pods are pending due to insufficient resources, check node capacity and pod resource requests. Consider increasing cluster capacity or reducing resource requests.
- If pods are failing due to image pull errors, verify that the LokiStack image references are correct and that image pull secrets are properly configured.
If pods are crashing or failing health checks:
- Review pod logs for startup errors or runtime failures
- Check that the object storage secret is correctly configured and accessible
- Verify that network policies allow communication between LokiStack components
If a deployment is not progressing, check the deployment status:
$ oc get deployment -n _<namespace>_ -l app.kubernetes.io/instance=_<lokistack_name>_ $ oc describe deployment _<deployment_name>_ -n _<namespace>_
If the LokiStack configuration has errors, review and correct the LokiStack custom resource:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o yaml
Verification
After applying the fix, verify that all components become ready:
Check that all pods are running and ready:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/instance=_<lokistack_name>_
Verify the LokiStack status shows all components ready:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o jsonpath='{.status.conditions}' | jq '.[] | select(.type=="Ready")'- Verify that the alert clears in the Red Hat OpenShift Logging web console after all components reach Ready state.
Additional resources
1.16. Troubleshooting the LokistackSchemaUpgradesRequired alert
The LokistackSchemaUpgradesRequired alert fires when a LokiStack is using a storage schema configuration that does not contain the latest schema version. It is recommended to update the schema configuration to use the latest schema version. Outdated schemas might not support newer Loki features or optimizations.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
stack_namespace: The namespace containing the LokiStack -
stack_name: The LokiStack instance name
-
Check the current LokiStack storage schema configuration:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o jsonpath='{.spec.storage.schemas}' | jqReview the LokiStack status for schema update information:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o jsonpath='{.status.conditions}' | jq '.[] | select(.reason=="StorageNeedsSchemaUpdate")'Check the Loki Operator logs for recommended schema version:
$ oc logs -n openshift-logging-operator deployment/loki-operator-controller-manager | grep -i schema
Troubleshooting
Storage schema updates in Loki require careful planning because they affect how data is stored and indexed:
- Review the LokiStack schema configuration and plan the schema update. New schema versions are added to the schema list; existing schemas are never modified to maintain backward compatibility with stored data.
Update the LokiStack custom resource to add the new schema version with an effective date in the future:
apiVersion: loki.grafana.com/v1 kind: LokiStack metadata: name: lokistack-sample spec: storage: schemas: - version: v12 effectiveDate: "2023-01-01" - version: v13 # New schema version effectiveDate: "2024-01-01" # Future date when new schema takes effectImportantSet the
effectiveDatefor the new schema to a future date to avoid data loss. Data written before the effective date uses the old schema; data written after uses the new schema.Apply the updated LokiStack configuration:
$ oc apply -f lokistack.yaml
- For detailed schema update procedures and version-specific requirements, consult the Loki operator documentation and release notes.
Verification
After updating the schema configuration, verify that the alert clears:
Check the LokiStack status to confirm the schema update is acknowledged:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o jsonpath='{.status.conditions}' | jq- Verify that the alert clears in the Red Hat OpenShift Logging web console after approximately 5 minutes.
1.17. Troubleshooting the LokiDiscardedSamplesWarning alert
The LokiDiscardedSamplesWarning alert fires when Loki is discarding samples during ingestion because they fail validation. Common reasons include samples with timestamps too far in the past or future, duplicate timestamps, or exceeding line size limits. Discarded samples result in incomplete log data.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
tenant: The tenant experiencing discarded samples -
reason: The specific reason for sample discard, such asout_of_order,too_far_in_past,too_far_in_future, orline_too_long
-
Review the Loki ingester logs for discard details:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=ingester | grep -i discard
Check the rate of discarded samples:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum by(namespace, tenant, reason) (rate(loki_discarded_samples_total[5m]))'
Review the LokiStack limits configuration:
$ oc get lokistack _<lokistack_name>_ -n _<namespace>_ -o jsonpath='{.spec.limits}' | jq
Troubleshooting
Based on the discard reason, apply the appropriate mitigation:
For
out_of_ordersamples, logs are arriving with timestamps out of chronological order. This can occur when:- Application logs are buffered and sent in batches
- Multiple collectors forward logs from the same source with clock skew
- Applications generate logs with timestamps from different timezones
Consider increasing the
max_chunk_agelimit to allow more timestamp variance.For
too_far_in_pastortoo_far_in_futuresamples, log timestamps are outside the acceptable time range. Common causes:- Application logging with incorrect system time
- Logs replayed from archives with old timestamps
- Time synchronization issues on nodes
Verify that node clocks are synchronized using NTP and that applications use current timestamps.
For
line_too_longsamples, individual log lines exceed the maximum line size. This is similar to the collector discarded logs issue. Consider:- Working with application developers to reduce log line size
- Using structured logging to avoid large data dumps in single log entries
- Increasing the Loki ingester line size limit if legitimate logs are being discarded
To adjust Loki ingestion limits, edit the LokiStack configuration:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Verification
After applying the fix, verify that discarded samples decrease:
Monitor the discard rate:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum by(reason) (rate(loki_discarded_samples_total[5m]))'
- Verify that the alert clears in the Red Hat OpenShift Logging web console after the discard rate drops to zero.
1.18. Troubleshooting the LokiTenantRateLimit alert
The LokiTenantRateLimit alert fires when at least 10% of requests to Loki result in HTTP 429 (rate limit) errors over a 15-minute period. This alert indicates that a tenant is exceeding the configured ingestion or query rate limits. Rate limiting protects the LokiStack from being overwhelmed by excessive requests, but it also means logs might be dropped or queries might fail.
For detailed troubleshooting steps, rate limit diagnostics, and configuration guidance, see This content is not included.Troubleshooting Loki rate limit errors.
1.19. Troubleshooting the LokiRequestPanics alert
The LokiRequestPanics alert fires when Loki components are experiencing code panics. A panic indicates an unexpected error condition that could not be handled gracefully. Panics can cause component restarts and service disruption, affecting log ingestion or query operations.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The specific Loki component experiencing panics
-
Review logs from the affected component to identify the panic details:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=_<component_name>_ --tail=200 | grep -A 20 -i panic
Check if the component pods are in a crash loop:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=_<component_name>_
Examine the pod events for restart information:
$ oc describe pod _<pod_name>_ -n _<namespace>_
- Check if the panics are occurring during specific operations by reviewing the panic stack traces in the logs.
Troubleshooting
Panics often indicate bugs in Loki code or unexpected input that triggers unhandled edge cases. Apply the following mitigation:
Review the panic stack trace in the logs to identify the operation that triggered the panic. Common causes include:
- Malformed queries or write requests
- Resource exhaustion (out of memory)
- Unexpected data formats
- Concurrent operations causing race conditions
If panics occur during query operations, identify problematic queries:
- Check query logs for complex or unusual queries immediately before the panic
- Review queries with very large time ranges or high cardinality
- Look for regex queries on high-cardinality labels
If panics are related to resource exhaustion, check for memory pressure:
$ oc describe pod _<pod_name>_ -n _<namespace>_ | grep -A 5 "State\|Last State"
Consider increasing component resource limits if memory-related panics are occurring.
If the issue persists, collect diagnostic information for Red Hat support:
- Full component logs showing the panic and stack trace
- Pod describe output
- LokiStack configuration
- Prometheus metrics for the time period around the panic
As a temporary workaround, restart the affected component:
$ oc delete pod _<pod_name>_ -n _<namespace>_
Verification
After applying the fix, monitor for additional panics:
Check that the component pods are running without restart loops:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=_<component_name>_ -w
Monitor the panic rate:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum(increase(loki_panic_total[10m])) by (job)'
- Verify that the alert clears in the Red Hat OpenShift Logging web console after panics stop occurring.
Additional resources
1.20. Troubleshooting the LokiRequestLatency alert
The LokiRequestLatency alert fires when the 99th percentile latency for Loki requests exceeds 5 seconds over a 15-minute period. High latency indicates performance issues that can affect both log ingestion and query operations, resulting in slow query responses or delays in log availability.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The Loki component experiencing high latency -
route: The API route with slow responses
-
Check the current latency metrics for the affected route:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[5m])) by (job, route, le))'
Identify whether latency is affecting reads (queries) or writes (ingestion):
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=_<component_name>_ | grep -E 'slow|latency|timeout'
Check for resource constraints on the affected component:
$ oc describe pod -n _<namespace>_ -l app.kubernetes.io/component=_<component_name>_ | grep -A 5 "Limits\|Requests"
- Review object storage performance metrics if available through your cloud provider.
For comprehensive query performance optimization and analysis, see This content is not included.Loki query performance troubleshooting.
Based on whether latency affects reads or writes, apply the appropriate mitigation:
For query latency (routes containing
query):- Review slow queries in the query front end logs
- Educate users on query optimization: use specific time ranges, add label filters, avoid regex on high-cardinality labels
- Consider increasing querier component resources
- Check object storage read performance
For write latency (routes containing
pushordistributor):- Check ingester component resource usage
- Verify object storage write performance
- Review ingester flush settings if write latency is high during flush operations
- Consider scaling up ingester replicas
If latency is storage-related, check for:
- Slow object storage performance (cloud provider issues)
- Network latency between Loki components and object storage
- Storage throttling or rate limiting
Increase component resources if CPU or memory constraints are detected:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Adjust the LokiStack size or component-specific resource limits.
Verification
After applying the fix, monitor latency metrics:
Check that the 99th percentile latency decreases:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[5m])) by (job, route, le))'
- Verify that the alert clears in the Red Hat OpenShift Logging web console after latency drops below 5 seconds.
1.21. Troubleshooting the LokiStorageSlowWrite alert
The LokiStorageSlowWrite alert fires when the object storage backend is experiencing slow write response rates, with the 99th percentile write latency exceeding 1 second over a 15-minute period. Slow storage writes can cause ingester backpressure and affect log ingestion performance.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The Loki component experiencing slow storage writes
-
Check the current storage write latency:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'histogram_quantile(0.99, sum(rate(loki_boltdb_shipper_request_duration_seconds_bucket{operation="WRITE"}[5m])) by (job, le))'Review ingester logs for storage-related errors or slow flush operations:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=ingester | grep -E 'flush|storage|slow'
Verify object storage credentials and connectivity:
$ oc get secret _<storage_secret_name>_ -n _<namespace>_ -o yaml
- Check cloud provider storage service status and performance metrics.
Troubleshooting
Slow storage writes are typically caused by issues with the object storage backend. Apply the appropriate mitigation:
Check the object storage service status in your cloud provider console:
-
AWS S3: Check CloudWatch metrics for
PutRequestslatency - Azure Blob: Check Azure Monitor for storage account performance
- GCS: Check Google Google Cloud console for bucket operation latency
-
AWS S3: Check CloudWatch metrics for
- Verify that the storage bucket is in the same region as the cluster to minimize network latency.
Check for storage throttling or rate limiting:
- Review cloud provider quotas and limits
- Check for throttling errors in ingester logs
- Verify that the storage account or bucket has adequate IOPS provisioned
If network connectivity is slow, check:
- VPC peering or network routing between cluster and storage
- Firewall rules or security groups affecting storage traffic
- DNS resolution time for storage endpoints
If the storage backend is experiencing degraded performance, consider:
- Contacting cloud provider support
- Migrating to a different storage class with better performance characteristics
- Distributing load across multiple buckets if supported by your configuration
- Monitor the object storage backend health independently of Loki to determine if this is a storage service issue.
Verification
After addressing storage performance issues, verify that write latency decreases:
Monitor storage write latency:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'histogram_quantile(0.99, sum(rate(loki_boltdb_shipper_request_duration_seconds_bucket{operation="WRITE"}[5m])) by (job, le))'- Verify that the alert clears in the Red Hat OpenShift Logging web console after write latency drops below 1 second.
1.22. Troubleshooting the LokiStorageSlowRead alert
The LokiStorageSlowRead alert fires when the object storage backend is experiencing slow read response rates, with the 99th percentile read latency exceeding 5 seconds over a 15-minute period. Slow storage reads affect query performance and can result in query timeouts or slow log viewing in the console.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The Loki component experiencing slow storage reads
-
Check the current storage read latency:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'histogram_quantile(0.99, sum(rate(loki_boltdb_shipper_request_duration_seconds_bucket{operation="Shipper.Query"}[5m])) by (job, le))'Review querier logs for storage-related errors or slow read operations:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=querier | grep -E 'storage|slow|timeout'
- Check cloud provider storage service status and performance metrics.
Troubleshooting
Slow storage reads are typically caused by issues with the object storage backend or the volume of data being queried. Apply the appropriate mitigation:
Check the object storage service status in your cloud provider console:
-
AWS S3: Check CloudWatch metrics for
GetObjectlatency - Azure Blob: Check Azure Monitor for read operation performance
- GCS: Check Google Google Cloud console for bucket read latency
-
AWS S3: Check CloudWatch metrics for
- Verify that the storage bucket is in the same region as the cluster to minimize network latency.
If queries are reading large amounts of data from storage, optimize query patterns:
- Use smaller time ranges to reduce data scanned
- Add more specific label filters to narrow the data set
- Review the query performance troubleshooting documentation
Check for storage throttling or rate limiting:
- Review cloud provider quotas and limits for read operations
- Verify that the storage account has adequate read IOPS
- Check for throttling errors in querier logs
If network connectivity is slow between the querier and storage:
- Check VPC peering or network routing
- Verify firewall rules or security groups
- Test storage endpoint connectivity and DNS resolution
Consider enabling or tuning the query cache to reduce repeated storage reads:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Verification
After addressing storage performance issues, verify that read latency decreases:
Monitor storage read latency:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'histogram_quantile(0.99, sum(rate(loki_boltdb_shipper_request_duration_seconds_bucket{operation="Shipper.Query"}[5m])) by (job, le))'- Verify that the alert clears in the Red Hat OpenShift Logging web console after read latency drops below 5 seconds.
1.23. Troubleshooting the LokiWritePathHighLoad alert
The LokiWritePathHighLoad alert fires when the Loki write path is experiencing high load, causing backpressure during storage flushing. This indicates that ingesters are struggling to flush chunks to object storage fast enough, which can lead to increased memory usage and potential data loss if ingesters run out of memory.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The Loki ingester job experiencing backpressure
-
Check the status of ingester pods and their resource usage:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=ingester $ oc top pods -n _<namespace>_ -l app.kubernetes.io/component=ingester
Review ingester logs for flush-related warnings or errors:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=ingester | grep -E 'flush|backpressure|WAL'
Check ingester memory usage and limits:
$ oc describe pod -n _<namespace>_ -l app.kubernetes.io/component=ingester | grep -A 5 "Limits\|Requests"
- Verify object storage write performance. See the LokiStorageSlowWrite troubleshooting procedure for storage diagnostics.
Troubleshooting
High write path load is typically caused by one or more of the following:
High ingestion rate exceeding ingester capacity. Check the current ingestion rate:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum(rate(loki_distributor_bytes_received_total[5m]))'
If ingestion rate has increased significantly, consider:
- Scaling up the number of ingester replicas
- Increasing ingester resource limits
- Using a larger LokiStack size
Slow object storage writes causing flush backlog. If storage write latency is high:
- See the LokiStorageSlowWrite troubleshooting procedure
- Verify storage backend performance with your cloud provider
- Check for storage throttling or rate limiting
Insufficient ingester resources causing slow flush operations:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Increase ingester CPU and memory limits, or use a larger LokiStack size.
Increased log volume from applications. Investigate the source:
- Check for applications with increased logging verbosity
- Look for pods generating excessive logs
- Consider implementing content filtering to reduce log volume
Verification
After applying the fix, monitor the write path load:
Check that WAL replay flushing has stopped:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum(loki_ingester_wal_replay_flushing) by (job)'
Monitor ingester memory usage to ensure it stabilizes:
$ oc top pods -n _<namespace>_ -l app.kubernetes.io/component=ingester -w
- Verify that the alert clears in the Red Hat OpenShift Logging web console after backpressure resolves.
1.24. Troubleshooting the LokiReadPathHighLoad alert
The LokiReadPathHighLoad alert fires when the Loki read path is experiencing high query volume, causing longer query response times. The 99th percentile query latency exceeds 30 seconds over a 15-minute period. This indicates that the query infrastructure is under heavy load, which can result in slow log viewing and query timeouts.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
In the Red Hat OpenShift Logging web console, navigate to the alert and examine the following labels:
-
namespace: The namespace containing the LokiStack -
job: The Loki component experiencing high query load
-
Check the current query latency:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'histogram_quantile(0.99, sum(rate(loki_logql_querystats_latency_seconds_bucket[5m])) by (job, le))'
Review the number of concurrent queries:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum(loki_querier_queries_running) by (job)'
Check querier component resource usage:
$ oc get pods -n _<namespace>_ -l app.kubernetes.io/component=querier $ oc top pods -n _<namespace>_ -l app.kubernetes.io/component=querier
Review querier logs for slow queries:
$ oc logs -n _<namespace>_ -l app.kubernetes.io/component=querier | grep -E 'slow|timeout'
For comprehensive query performance optimization and analysis, see This content is not included.Loki query performance troubleshooting.
High read path load is typically caused by one or more of the following:
Increased query volume from users. Check query rate:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'sum(rate(loki_request_duration_seconds_count{route=~".*query.*"}[5m]))'If query volume has increased significantly, consider:
- Scaling up querier replicas
- Increasing querier resource limits
- Educating users on query optimization to reduce load
Expensive queries scanning large time ranges or high-cardinality data. Identify and optimize problematic queries:
- Review query logs for queries with very large time ranges
- Look for regex queries on high-cardinality labels
- Educate users on LogQL best practices: use specific time ranges, add label filters, avoid unbounded queries
Insufficient querier resources:
$ oc edit lokistack _<lokistack_name>_ -n _<namespace>_
Increase querier CPU and memory limits, or use a larger LokiStack size.
- Slow object storage reads affecting query performance. See the LokiStorageSlowRead troubleshooting procedure for storage diagnostics.
Query cache not effectively reducing repeated queries. Review and tune cache configuration:
- Verify that query caching is enabled
- Check cache hit rate metrics
- Consider increasing cache size if hit rate is low
Verification
After applying the fix, monitor the read path load:
Check that query latency decreases:
$ oc exec -n openshift-monitoring prometheus-k8s-0 -- promtool query instant http://localhost:9090 'histogram_quantile(0.99, sum(rate(loki_logql_querystats_latency_seconds_bucket[5m])) by (job, le))'
Monitor querier resource usage to ensure it stabilizes:
$ oc top pods -n _<namespace>_ -l app.kubernetes.io/component=querier -w
- Verify that the alert clears in the Red Hat OpenShift Logging web console after query latency drops below 30 seconds.
1.25. Additional resources
Chapter 2. Custom logging alerts
You can configure the LokiStack deployment to produce customized alerts and recorded metrics. If you want to use customized alerting and recording rules, you must enable the LokiStack ruler component.
2.1. About configuring log-based alerts and recording rules for Loki
Learn how to configure log-based alerts and recorded metrics for Loki by using LogQL expressions and custom resources (CRs).
LokiStack log-based alerts and recorded metrics are triggered by providing LogQL(Grafana documentation) expressions to the ruler component.
To give these expressions, you must create an AlertingRule CR containing alerting rules, or a RecordingRule CR containing Prometheus-compatible recording rules (Prometheus documentation).
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.
Application, audit, and infrastructure alerts are sent by default to the OpenShift Container Platform 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.
2.2. Configuring the ruler
When the LokiStack ruler component is enabled, users can define a group of 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 Red Hat OpenShift Logging Operator and the Loki Operator.
-
You have created a
LokiStackCR. - You have administrator permissions.
Procedure
Enable the ruler by ensuring that the
LokiStackCR has the following spec configuration:apiVersion: loki.grafana.com/v1 kind: LokiStack metadata: name: <name> namespace: <namespace> spec: # ... rules: enabled: true selector: matchLabels: <label_name>: "true" namespaceSelector: matchLabels: <label_name>: "true"rules.enabled-
Enables Loki alerting and recording rules in the cluster when set to
true. rules.selector- Specifies the selector for alerting and recording resources.
rules.selector.matchLabels.<label_name>- Defines a custom label that you can apply to namespaces to enable logging alerts and metrics.
rules.namespaceSelector-
Specifies the namespaces where alerting and recording rules are defined. If undefined, the system uses only the rules in the same namespace as the
LokiStack. rules.namespaceSelector.matchLabels.<label_name>- Defines a custom label for selecting namespaces where logging alerts and metrics are enabled.
2.3. Authorizing LokiStack rules RBAC permissions
Administrators bind cluster roles to users to enable them to create and manage alerting and recording rules. A cluster role is defined as a ClusterRole object that has the required role-based access control (RBAC) permissions.
The following cluster roles for alerting and recording rules are available for LokiStack:
| Rule name | Description |
|---|---|
|
|
Users with this role have administrative-level access to manage alerting rules. This cluster role grants permissions to create, read, update, delete, list, and watch |
|
|
Users with this role can view the definitions of Custom Resource Definitions (CRDs) related to |
|
|
Users with this role have permission to create, update, and delete |
|
|
Users with this role can read |
|
|
Users with this role have administrative-level access to manage recording rules. This cluster role grants permissions to create, read, update, delete, list, and watch |
|
|
Users with this role can view the definitions of Custom Resource Definitions (CRDs) related to |
|
|
Users with this role have permission to create, update, and delete |
|
|
Users with this role can read |
2.3.1. Examples
To apply cluster roles for a user, you must bind an existing cluster role to a specific username.
Cluster roles can be cluster or namespace scoped, depending on which type of role binding you use. When a RoleBinding object is used, as when using the oc adm policy add-role-to-user command, the cluster role only applies to the specified namespace. When a ClusterRoleBinding object is used, as when using the oc adm policy add-cluster-role-to-user command, the cluster role applies to all namespaces in the cluster.
The following example command gives the specified user create, read, update and delete (CRUD) permissions for alerting rules in a specific namespace in the cluster:
The following example displays cluster role binding command for alerting rule CRUD permissions in a specific namespace:
$ oc adm policy add-role-to-user alertingrules.loki.grafana.com-v1-admin -n <namespace> <username>
The following command gives the specified user administrator permissions for alerting rules in all namespaces:
$ oc adm policy add-cluster-role-to-user alertingrules.loki.grafana.com-v1-admin <username>
2.4. Creating a log-based alerting rule with Loki
The AlertingRule custom resource (CR) has a set of specifications and webhook validation definitions to declare groups of alerting rules for a single LokiStack instance. In addition, the webhook validation definition provides support for rule validation conditions:
-
If an
AlertingRuleCR includes an invalidintervalperiod, it is an invalid alerting rule. -
If an
AlertingRuleCR includes an invalidforperiod, it is an invalid alerting rule. -
If an
AlertingRuleCR includes an invalid LogQLexpr, it is an invalid alerting rule. -
If an
AlertingRuleCR includes two groups with the same name, it is an invalid alerting rule. - If none of the above applies, an alerting rule is considered valid.
| Tenant type | Valid namespaces for AlertingRule CRs |
|---|---|
| audit |
|
| infrastructure |
|
| application | All other namespaces. |
Prerequisites
- Red Hat OpenShift Logging Operator 5.7 and later
- OpenShift Container Platform 4.13 and later
Procedure
Create an
AlertingRulecustom resource (CR):The following example displays infrastructure
AlertingRuleCR:apiVersion: loki.grafana.com/v1 kind: AlertingRule metadata: name: loki-operator-alerts namespace: openshift-operators-redhat labels: openshift.io/cluster-monitoring: "true" spec: tenantID: infrastructure groups: - name: LokiOperatorHighReconciliationError rules: - alert: HighPercentageError expr: | sum(rate({kubernetes_namespace_name="openshift-operators-redhat", kubernetes_pod_name=~"loki-operator-controller-manager.*"} |= "error" [1m])) by (job) / sum(rate({kubernetes_namespace_name="openshift-operators-redhat", kubernetes_pod_name=~"loki-operator-controller-manager.*"}[1m])) by (job) > 0.01 for: 10s labels: severity: critical annotations: summary: High Loki Operator Reconciliation Errors description: High Loki Operator Reconciliation Errorsmetadata.namespace-
The namespace must have a label that matches the LokiStack
spec.rules.namespaceSelectorconfiguration. metadata.labels-
The labels must match the LokiStack
spec.rules.selectorconfiguration. spec.tenantID-
For
infrastructuretenants, create theAlertingRuleonly inopenshift-*,kube-*, ordefaultnamespaces. expr-
The value of
kubernetes_namespace_namemust match themetadata.namespacevalue. labels.severity-
Set this mandatory field to
critical,warning, orinfo. annotations.summary- This field is mandatory.
annotations.descriptionThis field is mandatory.
The following example displays application
AlertingRuleCR:apiVersion: loki.grafana.com/v1 kind: AlertingRule metadata: name: app-user-workload namespace: app-ns labels: openshift.io/cluster-monitoring: "true" spec: tenantID: application groups: - name: AppUserWorkloadHighError rules: - alert: expr: | sum(rate({kubernetes_namespace_name="app-ns", kubernetes_pod_name=~"podName.*"} |= "error" [1m])) by (job) for: 10s labels: severity: critical annotations: summary: This is an example summary. description: This is an example description.metadata.namespace-
The namespace must have a label that matches the LokiStack
spec.rules.namespaceSelectorconfiguration. metadata.labels-
The labels must match the LokiStack
spec.rules.selectorconfiguration. expr-
The value of
kubernetes_namespace_namemust match themetadata.namespacevalue. labels.severity-
Set this mandatory field to
critical,warning, orinfo. annotations.summary- Provide a summary of the rule. This field is mandatory.
annotations.description- Provide a detailed description of the rule. This field is mandatory.
Apply the
AlertingRuleCR:$ oc apply -f <filename>.yaml
2.5. Additional resources
- Content from grafana.com is not included.Alerting and recording rules
- Content from grafana.com is not included.LogQL
- Content from prometheus.io is not included.Alerting rules
- Content from prometheus.io is not included.Recording rules
- Using RBAC to define and apply permissions
- About OpenShift Container Platform monitoring
- Configuring alert notifications