agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/loki/SKILL.md

loki

Skill13 starsChanged 27 days agoMITView on GitHub

Like Prometheus, but for logs. Works Well With: prometheus

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not expect to do complex full-text fuzzy searching natively.

    line 23
  2. Distinctive:

    Do not inject dynamic, unbounded user data (like session IDs or IPs) as Loki Labels.

    line 33
  3. Distinctive:

    Use this when your agent works with loki — structured patterns beat pasted docs and prevent common hallucinations.

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Loki Skill

Like Prometheus, but for logs.

Ecosystem Graph

graph LR
  loki["Loki"]
  loki -- "depends on" --> grafana
  loki -- "works well with" --> prometheus

Quick Start

Loki aggregates logs but, unlike Elasticsearch, it only indexes metadata labels rather than the full text of the log. This makes it insanely cheap and fast to operate.

docker run -d -p 3100:3100 grafana/loki

Production Patterns

LogQL vs Full Text

Do not expect to do complex full-text fuzzy searching natively. Loki forces you to filter by labels first (e.g., {app="backend", env="prod"}), and then it aggressively scans the chunks of text that match those labels.

Architecture & Scaling

Promtail

Loki requires an agent to ship logs. Promtail is the official agent. Deploy Promtail as a DaemonSet in Kubernetes to automatically scrape all pod stdout logs and forward them to the centralized Loki instance.

Error Recovery

Loki will actively reject logs if they are sent out of chronological order (a common issue in highly distributed systems). Ensure you configure unordered_writes: true in your Loki configuration to mitigate this.

Security Notes

Do not inject dynamic, unbounded user data (like session IDs or IPs) as Loki Labels. This causes Cardinality explosions, crashing the system. Log the dynamic data in the text payload, and only label static data (app name, region, environment).

Relationships

Prerequisites: grafana

Works Well With: prometheus

References

Why use this skill

Use this when your agent works with loki — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Using outdated SDK or API versions from training data
  • Inventing environment variable names
  • Omitting error handling and retry logic

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Related skills

  • grafana — depends on
  • prometheus — works well with

Last Verified: 2026-07-02

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.