What problem does it solve?
Investigating production incidents requires digging through large volumes of logs, and writing correct LogQL queries against Grafana Loki by hand is slow and error-prone. This Skill gives an AI agent a structured workflow and ready-made scripts to explore labels, measure error rates, sample logs, and run arbitrary LogQL queries during incident response.
Core Features & Use Cases
- Label Discovery: List all available Loki labels and their values to understand what is queryable before writing selectors.
- Log Statistics: Compute total log volume, error and warning counts, logs-per-minute, and error rate percentages for any stream selector.
- Log Sampling & Raw LogQL: Fetch representative log entries with optional regex filters, or execute arbitrary log and metric LogQL queries with custom time ranges.
- Use Case: During a production outage, ask the agent to check the error rate for
{app="api"} over the last two hours, sample error logs, and compare error rates across pods to localize the failing instance.
Quick Start
Ask the agent to show error statistics and recent error logs for the api application in Loki over the past hour.