Portal | Level: L2: Operations | Topics: Loki | Domain: Observability
Runbook: Loki Not Receiving Logs¶
Symptoms¶
- Grafana Loki shows no logs for application namespace
{namespace="grokdevops"}returns empty- Application is running and producing stdout
Fast Triage¶
# Check Promtail pods (log collector)
kubectl get pods -n monitoring -l app.kubernetes.io/name=promtail
# Check Promtail logs
kubectl logs -n monitoring -l app.kubernetes.io/name=promtail --tail=50
# Check Loki health
kubectl port-forward -n monitoring svc/loki 3100:3100
curl http://localhost:3100/ready
# Verify application is producing logs
kubectl logs -n grokdevops deploy/grokdevops --tail=5
Likely Causes (ranked)¶
- Promtail not running — DaemonSet crashed or misconfigured
- Promtail can't reach Loki — wrong endpoint URL or network issue
- Label mismatch — Promtail pipeline not selecting the right labels
- Loki not ready — Loki pod crashed or storage full
- Node selector / toleration — Promtail not scheduled on the node running grokdevops
Evidence Interpretation¶
What bad looks like:
$ kubectl get pods -n monitoring -l app.kubernetes.io/name=promtail
No resources found in monitoring namespace.
$ kubectl get daemonset -n monitoring promtail
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE
promtail 0 0 0 0 0
kubectl logs for connection refused or 429 (Loki rate limit) messages.
- Loki itself may be healthy (/ready returns 200) while the pipeline is broken at the Promtail stage.
Fix Steps¶
[!TIP] Historical logs already stored in Loki persist even if the pipeline breaks — only new logs stop appearing. Before assuming total data loss, widen the time range in Grafana. If you see old logs but not recent ones, the problem is in the collection pipeline (Promtail), not Loki itself.
- Restart Promtail if it's crashed:
- Verify Promtail config points to Loki:
- Check Loki is ready:
- Restore Promtail via Helm if needed:
Verification¶
# In Grafana: Explore → Loki → {namespace="grokdevops"}
kubectl port-forward -n monitoring svc/kube-prometheus-stack-grafana 3000:80
# Open http://localhost:3000 (admin/prom-operator)
Cleanup¶
None beyond restoring Promtail.
Unknown Unknowns¶
- The log pipeline is: container stdout -> Promtail (collects from node) -> Loki (stores) -> Grafana (queries). A break at any stage causes "no logs."
- Historical logs already stored in Loki persist even if the pipeline breaks — only new logs stop appearing. Check the time range in Grafana.
- DaemonSet
nodeSelectorortolerationsaffect which nodes get Promtail pods. If your app runs on a node that Promtail skips, those logs are lost. - Promtail tracks its read position in
/var/log; restarting it does not re-send old logs unless the position file is deleted.
Pitfalls¶
- Blaming Loki when Promtail is the problem — always check Promtail first. Loki only stores what it receives.
- Not checking the DaemonSet spec — a DaemonSet with DESIRED=0 means a nodeSelector or toleration is filtering out all nodes. Fix the scheduling constraint.
- Restarting Loki instead of Promtail — if Loki is healthy, restarting it achieves nothing and causes a brief query outage.
See Also¶
training/library/guides/troubleshooting.md(Loki section)training/library/guides/observability.mdtraining/interactive/runtime-labs/lab-runtime-04-loki-no-logs/training/interview-scenarios/04-loki-logs-disappeared.mdtraining/interactive/incidents/scenarios/loki-no-logs.sh
Wiki Navigation¶
Related Content¶
- Incident Simulator (18 scenarios) (CLI) (Exercise Set, L2) — Loki
- Interview: Loki Logs Disappeared (Scenario, L2) — Loki
- Lab: Loki No Logs (CLI) (Lab, L2) — Loki
- Log Pipelines (Topic Pack, L2) — Loki
- LogQL Drills (Drill, L2) — Loki
- Loki Flashcards (CLI) (flashcard_deck, L1) — Loki
- Observability Architecture (Reference, L2) — Loki
- Observability Deep Dive (Topic Pack, L2) — Loki
- Observability Drills (Drill, L2) — Loki
- Runbook: Log Pipeline Backpressure / Logs Not Appearing (Runbook, L2) — Loki
Pages that link here¶
- Decision Tree: Alert Fired — Is This Real?
- Level 4: Operations & Observability
- Log Pipelines
- LogQL Drills
- Observability
- Observability Domain
- Observability Drills
- Operational Runbooks
- Primer
- Runbook: Log Pipeline Backpressure / Logs Not Appearing
- Scenario: Logs Disappeared from Grafana Loki
- Solution: Lab Runtime 04 -- Loki No Logs