Chapter 4. Troubleshoot logging alerts
Diagnose and resolve logging alerts that fire on your cluster.
4.1. Troubleshoot LokiStack alerts Copy linkLink copied to clipboard!
When a LokiStack alert fires, you can use diagnostic commands to investigate the root cause and apply remediation steps.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
Set an environment variable for your
LokiStackcustom resource name:$ LOKISTACK_NAME="logging-loki"NoteThis example assumes the
LokiStackcustom resource is namedlogging-loki. If yourLokiStackhas a different name, adjust the variable value accordingly.View the
LokiStackstatus to identify issues:$ oc -n openshift-logging get lokistack ${LOKISTACK_NAME} -o yamlReview the
status.conditionssection for any warnings or errors.Check the detailed status of the
LokiStackresource:$ oc -n openshift-logging describe lokistack ${LOKISTACK_NAME}Look for conditions with
status: "False"or recent events indicating problems.List all
LokiStackpods and their status:$ oc -n openshift-logging get pods -l app.kubernetes.io/instance=${LOKISTACK_NAME}Verify that all component pods (distributor, ingester, querier, query-frontend, index-gateway, compactor, gateway) are in
Runningstate.Examine the logs of the affected component:
$ oc -n openshift-logging logs <pod_name>Replace
<pod_name>with the name of the pod from the alert labels or the pod that is experiencing issues.For storage-related alerts, verify backend storage connectivity:
Check if the storage secret exists and contains valid credentials:
$ oc -n openshift-logging get secret ${LOKISTACK_NAME}-<storage_type> -o yamlReplace
<storage_type>with your storage backend (for example,aws,azure,gcp, ors3).Review recent events for storage access errors:
$ oc -n openshift-logging get events --sort-by=.lastTimestamp | grep -i storage
For rate limit alerts (
LokiTenantRateLimit), check which limits are being exceeded:- Navigate to the OpenShift Container Platform web console.
- Go to Observe > Metrics.
Run the following PromQL query:
sum by (tenant, reason) (irate(loki_discarded_samples_total[2m]))This shows which tenant limits are causing samples to be discarded, including the specific reason for each tenant.
Common remediation actions based on alert type:
- Storage connectivity issues: Verify storage credentials, network policies, and firewall rules
-
Rate limit errors: Adjust tenant limits in the
LokiStackcustom resource - High load: Increase the number of queriers or ingesters
- Component failures: Check pod logs and restart failing components