agentleFS
asmamestasmamest/Nexus-Skills/skills/ai-engineering/llm-observability/SKILL.md

llm-observability

Skill1 starsChanged 17 days agoMITView on GitHub

Instrument LLM and agent applications with traces, spans, metrics, redaction, cost/latency analysis, and actionable failure diagnosis.

We split this skill into the rules it gives an agent

7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 7

    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:

    Redact by default: Avoid storing secrets, access tokens, raw personal data, private documents, or full prompts unless there is a documented …

    line 15
  2. Distinctive:

    Set alerts on actionable conditions: Use thresholds, baselines, and sustained windows to avoid noisy alerts.

    line 18
  3. Distinctive:

    Test telemetry itself: Verify correlation IDs, missing spans, exporter failure behavior, cardinality, sampling, redaction, and retention.

    line 19
  4. Distinctive:

    Treat prompts and tool results as potentially sensitive.

    line 22
  5. Distinctive:

    Do not put user IDs, raw queries, or document contents into high-cardinality metric labels.

    line 23
  6. Distinctive:

    Use sampling carefully; retain enough traces for rare high-impact failures.

    line 25
  7. Distinctive:

    Verify telemetry shows the expected recovery and no new privacy leak.

    line 33

“Common” is measured: kept by at least 6 in 10 of the 3 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

Make AI application behavior inspectable while protecting user data. Observability should answer what happened, where it failed, how much it cost, and whether quality is changing.

Workflow

  1. Define operational questions. Identify the failures and service-level objectives the team needs to detect: timeouts, tool errors, retrieval misses, quality regressions, latency, or cost spikes.
  2. Trace one request end to end. Correlate request, model call, retrieval, reranking, tool invocation, subagent handoff, validation, and final response with trace/span identifiers.
  3. Capture useful metadata. Record model/provider/version, prompt or template version, tool name, retrieval count, token usage, latency, retry count, status, and error category where available.
  4. Redact by default. Avoid storing secrets, access tokens, raw personal data, private documents, or full prompts unless there is a documented need and lawful, access-controlled retention policy.
  5. Define metrics. Track request volume, error rate, p50/p95/p99 latency, token/cost per request, tool failure rate, timeout rate, queue depth, and evaluation-derived quality signals.
  6. Connect traces to evaluations. Sample traces for human review, run offline evaluations on representative cases, and create regression alerts from stable quality metrics.
  7. Set alerts on actionable conditions. Use thresholds, baselines, and sustained windows to avoid noisy alerts. Route alerts to an owner and include a diagnostic next step.
  8. Test telemetry itself. Verify correlation IDs, missing spans, exporter failure behavior, cardinality, sampling, redaction, and retention.

Safety and privacy

  • Treat prompts and tool results as potentially sensitive.
  • Do not put user IDs, raw queries, or document contents into high-cardinality metric labels.
  • Restrict trace access and define retention/deletion policies.
  • Use sampling carefully; retain enough traces for rare high-impact failures.
  • Separate application telemetry from model evaluation data and production secrets.

Debugging procedure

  1. Find the failing trace and identify the first incorrect span.
  2. Compare expected vs actual input/output at that boundary, using redacted evidence.
  3. Reproduce with a sanitized fixture.
  4. Fix the underlying layer and add a regression test.
  5. Verify telemetry shows the expected recovery and no new privacy leak.

Deliverable

Provide instrumentation points, trace schema, metric definitions, redaction/retention controls, dashboards/alerts, and a sample diagnostic path.

References

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.