agentleFS
jnMetaCodejnMetaCode/skillet/skills/tracelet-instrument/SKILL.md

tracelet-instrument

Skill1 starsChanged 6 months agoMITView on GitHub

Instrument an AI agent or LLM app with OpenTelemetry and watch its runs live in tracelet (local DevTools). Use when asked to add tracing/observability to an agent, or to debug what an agent actually did.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. jnMetaCode/local-agent-toolkit★ 14100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository9 other files it gives its agents.

The file

Files
SKILL.md

tracelet-instrument

Goal: make an agent's execution visible — every LLM call, tool call, prompt, token count and latency — without sending anything to a cloud service. tracelet is a local OTLP collector + UI; any OpenTelemetry exporter pointed at http://127.0.0.1:4318 shows up live.

Procedure

  1. Start the collector (keep it running in a terminal):

    npx @jnmetacode/tracelet        # ingests OTLP on :4318, UI on :4321
  2. Point the app's exporter at it. For most OpenTelemetry SDKs the zero-code route is environment variables:

    export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318
    export OTEL_SERVICE_NAME=my-agent
  3. Framework-specific wiring (pick the one that matches the codebase):

    Vercel AI SDK — pass telemetry on each call and register a Node tracer:

    const result = await generateText({
      model, prompt,
      experimental_telemetry: { isEnabled: true },
    });

    OpenTelemetry JS (manual spans):

    import { NodeSDK } from '@opentelemetry/sdk-node';
    import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
    new NodeSDK({ traceExporter: new OTLPTraceExporter({ url: 'http://127.0.0.1:4318/v1/traces' }) }).start();

    Python: pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http, then the same OTEL_EXPORTER_OTLP_ENDPOINT env var works.

  4. Name spans so the waterfall reads like the agent's plan: one root span per run (agent.run), one child per tool call (tool.<name>) and per model call. Attach gen_ai.request.model, input.value, output.value attributes — tracelet recognizes the GenAI/OpenInference conventions and renders prompts, tokens and tool I/O.
  5. Verify: trigger one agent run, open http://127.0.0.1:4321, and confirm the trace shows the expected span tree with prompts/tokens. If nothing arrives, the exporter is usually pointed at the wrong port (4318) or batching hasn't flushed — force a flush/shutdown on process exit.

Both OTLP/HTTP protobuf (SDK default) and JSON are accepted — no exporter config gymnastics needed.

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.