Grafana Loki (alternative)
Loki stores logs without full indexing — query with LogQL:
# Count of error logs per 5 minutes
sum(count_over_time({service="task-svc", level="error"}[5m]))
# Extract latency field and compute P95
quantile_over_time(0.95,
{service="task-svc"} | json | duration_ms > 0 | unwrap duration_ms [5m]
) by (route)
Loki alert rule:
- alert: PanicDetected
expr: count_over_time({service="task-svc"} |= "panicked" [1m]) > 0
for: 0m
annotations:
summary: "Panic detected in task-svc"