loki

Write and troubleshoot Grafana Loki LogQL queries for log analysis.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill loki-1k-off
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: loki
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/loki
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill loki-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Grafana Loki skill helps you find the real signals inside large volumes of application logs by writing correct LogQL queries and understanding how Loki processes and serves those logs.

Core Features & Use Cases

  • LogQL stream selection & filtering: Use label matchers and efficient line filters to narrow results to the exact services, environments, and events you care about.
  • Structured parsing & extraction: Parse JSON, logfmt, pattern, regexp, and unpacked labels to turn messy log lines into fields you can analyze.
  • Metrics-from-logs queries: Build rate, count, bytes, and percentile/aggregation queries from log content using unwrap and range functions.
  • Operational troubleshooting: Use architecture knowledge (distributor, ingester, querier, query frontend, compactor) to reason about ingestion and query behavior.
  • Practical integration examples: Configure ingestion with Grafana Alloy and understand the Loki push API.

Quick Start

Ask the AI to write a LogQL query that returns the 95th percentile of request latency for API logs where the status is 5xx and groups the result by service label.

Frequently Asked Questions about loki

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a LogQL query to extract metrics from application logs?

To parse unstructured log lines in Loki with LogQL, apply pipeline stages like json, logfmt, pattern, or regexp parsers to extract labeled fields from raw log streams. These parsed fields become available for subsequent filtering and metric aggregation queries.

What is the best way to filter Kubernetes logs by service and environment in Loki?

Filtering Kubernetes logs in Loki requires using label matchers in your LogQL stream selector to target specific service and environment labels, followed by efficient line filters to narrow down the exact log events within those streams.

How do I calculate the 95th percentile of request latency from Loki logs?

Calculate request latency percentiles in Loki by parsing the duration field from your logs with a LogQL pipeline stage, unwrapping that numeric value, and applying the quantile_over_time function across a specified range vector interval.

Why is my Grafana Loki query returning no log streams?

When Loki queries return no log streams, verify that your LogQL label selectors match the labels actively pushed by the distributor and check if the queried time range falls within the ingester retention window. Query frontend behavior also impacts stream visibility.

Does Grafana Loki work with Alloy for ingesting Kubernetes logs?

Yes, Loki integrates with Grafana Alloy to ingest Kubernetes logs via the push API. Alloy collects log streams from your cluster and pushes them to the Loki distributor, making them immediately available for LogQL querying.