agentops-telemetry
Skill2 starsChanged 42 days agoMITArchived repositoryView on GitHub
Instrument an LLM agent with OpenTelemetry traces, metrics, and logs so you can see why a turn behaved as it did, with user content kept out of spans by default. Use when an agent is a black box in production, when you need per-turn traces of model and tool calls, or when wiring an agent to MLflow, Prometheus, Grafana, or Loki.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-evaluationSkill
- agent-guardrailsSkill
- agent-incident-responseSkill
- agent-least-privilegeSkill
- agentops-courseSkill
- agent-resilienceSkill
- agent-token-budgetSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Redact and bound the log bridge: If you bridge application logs to OTLP, redact secrets/PII and cap size before export, and deduplicate …
- Distinctive: line 35
Run one turn, open its trace, and confirm the span tree shows the model and tool spans with token/latency attributes and no prompt or …
≈ “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.
Files
AgentOps Telemetry
Trace an agent the way you trace a distributed system: one correlated record of model, tool, and application work per request — not a log line with the final answer. Make privacy the default, not an afterthought.
When to use
- An agent misbehaves in production and you can only see the final output.
- You need to correlate a model call, its tool calls, tokens, and latency for one turn.
- You are exporting agent telemetry to MLflow (traces), Prometheus (metrics), or Loki (logs).
- You must instrument without leaking user prompts or model responses into span storage.
Steps
- Emit spans over OpenTelemetry, using the GenAI semantic conventions. Name attributes with the standard
gen_ai.*keys (gen_ai.operation.name,gen_ai.request.model,gen_ai.tool.name) anderror.typeso any OTel backend understands them. - Keep content capture off by default. Traces should carry timing, model, tool, token, and status metadata — not the prompt or response body. Make capturing content an explicit, auditable opt-in with a stated privacy and retention cost.
- Export through the OTel Collector, then fan out. Send OTLP to a collector that routes traces to your trace store, derives request-count/latency metrics from spans (a spanmetrics connector), and ships logs to a log store — one pipeline, many backends.
- Redact and bound the log bridge. If you bridge application logs to OTLP, redact secrets/PII and cap size before export, and deduplicate noisy lines.
- Derive RED metrics from spans. Rate, Errors, Duration over a bounded label set (operation, model, error type) — never label by prompt, user, session, or trace id, which explodes cardinality.
Reference implementation
From the AgentOps Open Course (agent modules live under agents/python/src/agent/):
telemetry.py— OTLP setup and a redacting, bounded, dedup log bridge; content capture off by default.infra/observability/— OTel Collector, Prometheus, Grafana, Loki, and a shipped dashboard.- Course chapters
7.1. Tracingand7.2. Monitoring.
Verify
Run one turn, open its trace, and confirm the span tree shows the model and tool spans with token/latency attributes and no prompt or response text; confirm a metric counter moved and a dashboard panel updated.
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
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.

