Railway's official agent skill: create projects, provision databases and buckets, deploy, manage variables and domains, and read build failures back — from the CLI, API or MCP server.
Grafana Loki & LogQLSkill
Summary
Grafana's official Loki skill: write LogQL that returns rows instead of timeouts, ship logs through Alloy, and reason about a store that indexes labels rather than log text.
Features
- Full LogQL reference: stream selectors, line filters, parsers, label filters and formatting stages
- Metric queries including rate, count_over_time, topk and unwrapped quantile_over_time
- Grafana Alloy pipelines for file tailing, Kubernetes pod discovery and JSON parse stages
- Raw /loki/api/v1/push payload for shipping logs without a collector
- Loki read/write path architecture: distributor, ingester, querier, query frontend, compactor
- Worked examples for error-rate alerts, slow requests, 5xx breakdowns and credential-leak detection
Install This Skill
Add this skill to your favorite AI agent in a few steps.
Skill Content
Description
Loki is Grafana's log database, and its whole cost argument rests on one design decision: it indexes labels, not the contents of your log lines. That decision is also why a LogQL query written like an Elasticsearch query gets slow — the label selector does the narrowing, and everything after the pipe is a scan.
This is the skill Grafana Labs maintains for that gap. It gives a coding agent a working LogQL reference organised in the order a query is actually built: the stream selector that every query requires, line filters (|=, !=, |~, !~) placed first because they cut the scan, the five parsers (json, logfmt, pattern, regexp, unpack), label filters that compare typed values such as status >= 500 or duration > 1s, and the line_format / label_format / drop / keep stages that reshape what comes back.
The metric half is covered to the same depth: rate, count_over_time, bytes_rate and absent_over_time for log-range aggregations, topk and sum ... by for grouping, and the unwrapped aggregations (quantile_over_time, avg_over_time, sum_over_time) that pull numbers out of log payloads — including the duration_seconds conversion that trips people up. Worked examples cover an error-rate alert expression, slow-request extraction, HTTP 5xx breakdown via pattern, and a regex that finds credentials leaked into URLs.
Ingestion is the other half. The skill carries ready Grafana Alloy configurations for file tailing with a JSON parse stage, label promotion and a healthcheck stage.drop, a Kubernetes DaemonSet variant using discovery.kubernetes, and the raw /loki/api/v1/push HTTP payload for anything that has to speak to Loki directly. A short architecture section names the distributor, ingester, querier, query frontend and compactor and what each one is responsible for on the read and write paths.
Apache-2.0, part of the grafana/skills repository, and installable with npx skills add grafana/skills or as a Claude Code plugin marketplace. Useful for anyone writing LogQL by hand, debugging a log pipeline that shows nothing in Explore, or trying to work out which label blew up their stream count.
Related Skills
Diagnoses wrong gradients in differentiable NVIDIA Warp programs by measuring first — comparing autodiff against finite differences on a shrunk reproduction before proposing any fix.
Google's official skill for the gws CLI — drive Gmail, Drive, Calendar, Sheets, Docs, Chat and Admin APIs from an agent, with Model Armor screening.
Netlify's official skill for zero-config managed Postgres — querying from Functions, Drizzle setup, migrations and per-preview database branches.