Agent skill

Loki Logs

by letsrevel in letsrevel/revel-backend

A skill your agent uses when investigating production behaviour from logs — a 500/error in prod, a failing or stuck Celery task, tracing one request/traceid/user across services, or confirming a…

MITAuto-check: notesDevOps & Cloud

Install Loki Logs

skills CLI
$ npx skills add letsrevel/revel-backend --skill loki-logs -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install letsrevel/revel-backend loki-logs --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/letsrevel/revel-backend.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/loki-logs .claude/skills/loki-logs && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
loki-logs
GitHub stars
109
Token cost
~918 tokens
SKILL.md length
312 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when investigating production behaviour from logs — a 500/error in prod, a failing or stuck Celery task, tracing one request/traceid/user across services, or confirming a…

  • Works in 4 steps: Start broad: web --level error --since… → Grab the trace_id/request_id from the… → Re-query by that id with --forward to… → …
  • Investigating production behaviour from logs — a 500/error in prod
  • SKILL.md covers Tool, What you can filter on, Recipes and Workflow when debugging from a…, plus 1 more section
  • Calls python; needs GRAFANA_TOKEN

What it does

Loki Logs is an agent skill from letsrevel/revel-backend. Use when investigating production behaviour from logs — a 500/error in prod, a failing or stuck Celery task, tracing one request/traceid/user across services, or confirming a deploy's runtime effect. Pulls real Loki logs from the live stack (web, celerydefault, beat, telegram) via Grafana.

Its SKILL.md is about 920 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering Background jobs and Monitoring and alerting. It works with Grafana, Telegram, Python and Django. The repository describes itself as: Open-source event management, ticketing and membership platform for communities, clubs, independent venues and independent artists. The licence is MIT.

When your agent uses it

  • Investigating production behaviour from logs — a 500/error in prod
  • Stuck Celery task
  • Tracing one request/traceid/user across services
  • Confirming a deploys runtime effect

Example prompts

  • “/loki-logs”

Requirements

  • Python 3
  • A credential in GRAFANA_TOKEN
  • Pre-approved tools (allowed-tools): Bash(python:*), Bash(.venv/bin/python:*), Read, Grep

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Start broad: web --level error --since to find the failure.
  2. Grab the trace_id/request_id from the metadata line.
  3. Re-query by that id with --forward to read the full request in order,
  4. Use --print-query to inspect/borrow the LogQL; use --json when you need

What it can do on your machine

Read from SKILL.md and the folder at commit 8333099. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(python:*)
    • Bash(.venv/bin/python:*)
    • Read
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GRAFANA_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Loki Logs loads about 918 tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 312 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~918

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:23
    A_TOKEN` via decouple (from the project `.env` or the environment).

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from letsrevel/revel-backend at commit 8333099, republished under its MIT licence (© letsrevel). 312 words, ~918 tokens.

Download SKILL.mdSave it as .claude/skills/loki-logs/SKILL.md (or your agent's skills folder).
name
loki-logs
description
Use when investigating production behaviour from logs — a 500/error in prod, a failing or stuck Celery task, tracing one request/trace_id/user across services, or confirming a deploy's runtime effect. Pulls real Loki logs from the live stack (web, celery_default, beat, telegram) via Grafana.
allowed-tools
Bash(python:*), Bash(.venv/bin/python:*), Read, Grep

Loki Logs

Query the production logs from Loki, the live log store. Loki itself is not publicly reachable; the script asks Grafana (grafana.letsrevel.io) to proxy LogQL to its Loki datasource using a service-account token.

Tool

bash
.venv/bin/python scripts/loki_logs.py [SERVICE] [filters] [--since DUR] [-n LIMIT]

SERVICE is one of web, celery_default, beat, telegram (omit to search all). Default window is the last 1h, newest first, 100 lines. Run --help for the full flag list. Use the venv interpreter — the script imports python-decouple.

Auth: reads GRAFANA_TOKEN via decouple (from the project .env or the environment). If it errors with "GRAFANA_TOKEN is not set", it isn't configured yet — tell the user; do not guess.

What you can filter on

KindFlagsLogQL
Stream labelsSERVICE, --level error (repeatable), --env productionindexed, cheap
Line content--grep TEXT, --exclude TEXT, --regex RE (all repeatable)substring / regex
Request metadata--trace-id, --request-id, --user-id, --method, --path, --status-code, --ip, --user-agentstructlog fields
Raw escape hatch--query '{service_name="web"} | status_code="500"'any LogQL

Logs are structlog JSON; the displayed line is the event message, with a metadata line beneath it (suppress with --no-meta, get raw JSON with --json).

Recipes

bash
# Errors in the API in the last hour
.venv/bin/python scripts/loki_logs.py web --level error

# Follow one request end-to-end across every service
.venv/bin/python scripts/loki_logs.py --request-id <uuid> --since 6h --forward

# Celery failures mentioning a traceback, last day
.venv/bin/python scripts/loki_logs.py celery_default --since 1d --grep Traceback

# All 5xx responses, last 2h
.venv/bin/python scripts/loki_logs.py web --status-code 500 --since 2h

# Everything a user triggered
.venv/bin/python scripts/loki_logs.py --user-id <uuid> --since 12h

# Everything from one client IP (e.g. chasing a scraper/429 burst)
.venv/bin/python scripts/loki_logs.py web --ip <ip> --since 6h

# Discover what labels/values exist
.venv/bin/python scripts/loki_logs.py --labels
.venv/bin/python scripts/loki_logs.py --label-values service_name

Workflow when debugging from a symptom

  1. Start broad: web --level error --since <window> to find the failure.
  2. Grab the trace_id/request_id from the metadata line.
  3. Re-query by that id with --forward to read the full request in order, spanning web → celery_default if work was dispatched.
  4. Use --print-query to inspect/borrow the LogQL; use --json when you need exact timestamps or fields the pretty output omits.

Notes

  • Retention is 30 days; queries older than that return nothing.
  • A query needs at least one matcher — with no SERVICE/--level the script defaults to {service_name=~".+"} (all app streams).
  • Hitting --limit prints a stderr hint; narrow --since or raise -n.
  • --ip/--user-agent only match lines ingested after the Alloy config that promotes ip_address/user_agent; older lines won't match those filters.
  • Read-only. The token is Viewer-scoped; this cannot modify anything.

© letsrevel, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/loki-logs of letsrevel/revel-backend.

Open the folder on GitHubat commit 8333099

Compare with similar skills

Loki Logs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Loki Logs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Loki Logs this skillletsrevel/revel-backend109—~918Automated safety check: NotesMIT
Opentelemetrygrafana/skills279—~1.7kAutomated safety check: PassApache-2.0
Pyroscopegrafana/skills279—~1.2kAutomated safety check: PassApache-2.0
Agento11y Experimentsgrafana/agento11y127—~2kAutomated safety check: PassApache-2.0
Sentry Python SDKgetsentry/sentry-for-ai268—~4.1kAutomated safety check: PassApache-2.0
Admingrafana/skills279—~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Opentelemetry

    grafana/skills

    Official

    Instrument any app with OpenTelemetry and ship metrics / logs / traces to Grafana Cloud or self-hosted Mimir / Loki / Tempo / Pyroscope.

    279 GitHub stars~1.7k tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Pyroscope

    grafana/skills

    Official

    Continuously profile applications with Grafana Pyroscope and read the result as flame graphs.

    279 GitHub stars~1.2k tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Agento11y Experiments

    grafana/agento11y

    Official

    Run any Python LLM agent as an Agent Observability experiment using the public agento11y.experiments package: define a test suite, run an existing agent through typed trials, bind or record…

    127 GitHub stars~2k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Sentry Python SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Python. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~4.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Admin

    grafana/skills

    Official

    Manage Grafana Cloud accounts — organizations, stacks, RBAC roles and assignments, SSO/SAML/OAuth/GitHub auth, service accounts for CI/CD, user invites, team membership, and API-driven provisioning.

    279 GitHub stars~1.5k tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Cloud Infra Supply Chain

    zhaji2333/CkSKILLS

    当目标涉及云资产(对象存储/云元数据/Serverless)、容器/K8s、运维面板(宝塔/Grafana/Zabbix/Jenkins/GitLab/Nacos等)、消息队列/缓存中间件、CI/CD流水线、第三方回调集成、依赖组件CVE、信息泄露配置时调用。负责未授权访问、弱口令、云配置错误、供应链漏洞与敏感信息挖掘。

    113 GitHub stars~688 tokensUpdated 24 days ago
    DevOps & CloudAuto-check: warnings

More from letsrevel/revel-backend

  • Silk Debug

    letsrevel/revel-backend

    Analyze Django Silk profiling data to debug slow requests, detect N+1 queries, and optimize database performance.

    109 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Update Changelog

    letsrevel/revel-backend

    Update CHANGELOG.md comprehensively based on git tags, merged PRs, and actual code diffs.

    109 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check: notes
  • Whats New

    letsrevel/revel-backend

    Draft a "What's New" community update for the Revel Discord covering changes across backend, frontend, and infra over a time window.

    109 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Updating Deps

    letsrevel/revel-backend

    Update Python dependencies using UV. An agent skill from letsrevel/revel-backend.

    109 GitHub stars~746 tokensUpdated yesterday
    Auto-check passed

Questions about Loki Logs

What does Loki Logs do?

A skill your agent uses when investigating production behaviour from logs — a 500/error in prod, a failing or stuck Celery task, tracing one request/traceid/user across services, or confirming a…. Loki Logs is an agent skill from letsrevel/revel-backend. Use when investigating production behaviour from logs — a 500/error in prod, a failing or stuck Celery task, tracing one request/traceid/user across services, or confirming a deploy's runtime effect.

When should I use Loki Logs?

Loki Logs fits situations like: investigating production behaviour from logs — a 500/error in prod; stuck Celery task; tracing one request/traceid/user across services; confirming a deploys runtime effect.

How do I install Loki Logs in Claude Code?

Run `npx skills add letsrevel/revel-backend --skill loki-logs -a claude-code`. Or copy the skill folder (.claude/skills/loki-logs in letsrevel/revel-backend) into .claude/skills/loki-logs in your project. Claude Code loads it when a task matches its description.

How do I install Loki Logs in Codex?

Run `npx skills add letsrevel/revel-backend --skill loki-logs -a codex`. Or copy the skill folder (.claude/skills/loki-logs in letsrevel/revel-backend) into .agents/skills/loki-logs in your project. Codex loads it when a task matches its description.

Can I use Loki Logs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add letsrevel/revel-backend --skill loki-logs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/loki-logs, .gemini/skills/loki-logs, .github/skills/loki-logs and .opencode/skills/loki-logs in your project.

What does Loki Logs need to run?

Going by SKILL.md and its folder, Loki Logs needs the command-line tools its instructions call (python) and credentials named GRAFANA_TOKEN. Our summary lists: Python 3; A credential in GRAFANA_TOKEN. Its frontmatter pre-approves these tools: Bash(python:*), Bash(.venv/bin/python:*), Read, Grep.

Does Loki Logs access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Loki Logs safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Loki Logs use?

Loki Logs is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Loki Logs use?

About 918 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Loki Logs?

Skills that share tags, products or a category with Loki Logs: Opentelemetry (grafana/skills, 279 stars), Pyroscope (grafana/skills, 279 stars), Agento11y Experiments (grafana/agento11y, 127 stars) and Sentry Python SDK (getsentry/sentry-for-ai, 268 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Loki Logs?

letsrevel (a GitHub organization) maintains it in letsrevel/revel-backend, which has 109 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 7, 2026.

Source: letsrevel/revel-backend on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.