agentleFS
XData-siXData-si/xdata-agenthub/skills/llm-observability/SKILL.md

llm-observability

Skill1 starsChanged 33 days agoMITView on GitHub

Instrument LLM applications and agents for production — traces of prompts, retrieval and tool calls, token usage and cost, latency, errors, user feedback and quality signals — with privacy controls and sampling (for example with OpenTelemetry GenAI conventions, Langfuse or similar). Use when running LLM features in production, debugging agent behaviour, or controlling AI costs.

6 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use context-engineering.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • mrgoonieSkill

    context-engineering

    Master context engineering for AI agent systems. Use when designing agent architectures, debugging context failures, optimizing token usage, implementing memory systems, building multi-agent coordination, evaluating agent performance, or developing LLM-powered pipelines. Covers context fundamentals, degradation patterns, optimization techniques (compaction, masking, caching), compression strategies, memory architectures, multi-agent patterns, LLM-as-Judge evaluation, tool design, and project development.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every model and tool call in a sample request appears in the trace with tokens, cost and latency.

    line 32

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “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

LLM Observability

Goal

Be able to answer for any request: what the model saw, which tools ran, how long and how much it cost, whether the answer was good — without leaking personal data into logs.

Inputs

  • Application architecture (models, gateway, retrieval, tools, agents), existing observability stack, privacy requirements, cost budgets.

Procedure

  1. Trace structure: one trace per user request or agent task; spans for model calls, retrieval, reranking, tool calls and sub-agents; propagate trace IDs from the application.
  2. Attributes per model span: provider, model and version, prompt template ID and version, input/output token counts, cost, latency (time to first token and total), finish reason, retries and fallbacks. Follow the OpenTelemetry GenAI semantic conventions where possible.
  3. Content capture policy: decide per environment whether prompts and completions are stored; when stored, apply masking of secrets and personal data, access control and short retention; metadata-only is the default for sensitive applications.
  4. Quality signals: user feedback (thumbs, edits), automatic evaluations on samples (groundedness, format validity), guardrail triggers, refusal rates.
  5. Dashboards and alerts: cost per day and per feature, token anomalies, latency percentiles, error and fallback rates, tool failure rates, loop detection in agents.
  6. Sampling: full traces for errors and flagged sessions, sampled traces for normal traffic.
  7. Close the loop: link traces to evaluation datasets — interesting production failures become test cases (see llm-output-evaluation).

Example fixture

Alert: cost per conversation +300 % since prompt v14.
Trace analysis: retrieval now returns 40 chunks instead of 8 (config change) → input tokens ×5.
Fix: restore top-k=8, add a guardrail alert on input tokens > 20 k per call.

Acceptance checks

  • Every model and tool call in a sample request appears in the trace with tokens, cost and latency.
  • Content capture follows the documented policy (negative case: a test prompt containing a fake API key appears masked in the stored trace).
  • Cost and anomaly alerts fired in a test.

Output

Instrumentation changes, content policy, dashboards, alerts.

Safety

Traces with prompts are sensitive data stores: restrict access, encrypt, and set retention. Do not send traces to third-party observability services without a data processing agreement and approval.

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.