Skip to content
Skillv1.0.0

traceloop

You are an expert in Traceloop and its OpenLLMetry SDK, the open-source observability framework that extends OpenTelemetry for LLM applications. You help developers instrument AI pipelines with automa

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/traceloop/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill traceloop. Copyright stays with the author (Apache-2.0).

Traceloop (OpenLLMetry) — LLM Observability via OpenTelemetry

You are an expert in Traceloop and its OpenLLMetry SDK, the open-source observability framework that extends OpenTelemetry for LLM applications. You help developers instrument AI pipelines with automatic tracing for OpenAI, Anthropic, Cohere, LangChain, LlamaIndex, vector databases, and frameworks — exporting to any OpenTelemetry-compatible backend (Grafana Tempo, Jaeger, Datadog, Honeycomb, Traceloop Cloud).

Core Capabilities

Auto-Instrumentation

# One line — instruments everything
from traceloop.sdk import Traceloop

Traceloop.init(
    app_name="my-ai-app",
    api_endpoint="https://api.traceloop.com",   # Or any OTLP endpoint
    api_key="your-key",
    disable_batch=False,                         # Batch for performance
)

# All OpenAI/Anthropic/LangChain calls now traced automatically
import openai
client = openai.OpenAI()

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)
# Trace captured: model, tokens, latency, cost, prompt, completion

Workflow and Task Decorators

from traceloop.sdk.decorators import workflow, task, agent, tool

@workflow(name="customer-support-pipeline")
async def handle_support_ticket(ticket: dict):
    """Top-level workflow — groups all child spans."""
    intent = await classify_intent(ticket["message"])
    if intent == "technical":
        return await technical_support(ticket)
    return await general_support(ticket)

@task(name="classify-intent")
async def classify_intent(message: str) -> str:
    """Task span — individual step in workflow."""
    response = await client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": f"Classify intent: {message}"}],
    )
    return response.choices[0].message.content

@agent(name="tech-support-agent")
async def technical_support(ticket: dict):
    """Agent span — autonomous agent with tool use."""
    docs = await search_knowledge_base(ticket["message"])
    response = await generate_response(ticket, docs)
    return response

@tool(name="knowledge-base-search")
async def search_knowledge_base(query: str):
    """Tool span — external tool invocation."""
    embedding = await client.embeddings.create(model="text-embedding-3-small", input=query)
    results = await pinecone_index.query(vector=embedding.data[0].embedding, top_k=5)
    return [r.metadata["text"] for r in results.matches]

TypeScript

import * as traceloop from "@traceloop/node-server-sdk";

traceloop.initialize({
  appName: "my-ai-app",
  apiKey: process.env.TRACELOOP_API_KEY,
  disableBatch: false,
});

import { withWorkflow, withTask } from "@traceloop/node-server-sdk";

const handleQuery = withWorkflow({ name: "rag-query" }, async (query: string) => {
  const docs = await withTask({ name: "retrieve" }, () => retrieveDocs(query));
  const answer = await withTask({ name: "generate" }, () => generateAnswer(query, docs));
  return answer;
});

Export to Any Backend

# Send to Grafana Tempo
Traceloop.init(
    app_name="my-app",
    api_endpoint="http://tempo:4318",     # OTLP HTTP endpoint
    headers={},                           # No auth for self-hosted
)

# Send to Datadog
Traceloop.init(
    app_name="my-app",
    api_endpoint="https://trace.agent.datadoghq.com",
    headers={"DD-API-KEY": "your-dd-key"},
)

# Send to Honeycomb
Traceloop.init(
    app_name="my-app",
    api_endpoint="https://api.honeycomb.io",
    headers={"x-honeycomb-team": "your-key"},
)

Installation

# Python
pip install traceloop-sdk

# TypeScript
npm install @traceloop/node-server-sdk

Best Practices

  1. Semantic conventions — Use @workflow, @task, @agent, @tool decorators; creates meaningful trace hierarchy
  2. OpenTelemetry native — Standard OTLP export; works with existing observability stack (Grafana, Datadog, etc.)
  3. Auto-instrumentationTraceloop.init() patches all supported libraries; no per-call code changes
  4. Association properties — Set user ID, session ID, conversation ID for filtering and grouping traces
  5. Prompt management — Track prompt versions; correlate prompt changes with quality metrics
  6. Cost tracking — Automatic cost calculation per model; aggregate by workflow, user, or feature
  7. Vendor-agnostic — Switch from Traceloop Cloud to self-hosted Jaeger/Tempo without code changes
  8. OpenLLMetry standard — Extends OpenTelemetry semantic conventions for AI; community-driven spec

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-traceloop/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-traceloop.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-traceloop",
  "kind": "skill",
  "name": "traceloop",
  "description": "You are an expert in Traceloop and its OpenLLMetry SDK, the open-source observability framework that extends OpenTelemetry for LLM applications. You help developers instrument AI pipelines with automatic tracing for OpenAI, Anthropic, Cohere, LangChain, LlamaIndex, vector databases, and frameworks — exporting to any OpenTelemetry-compatible backend (Grafana Tempo, Jaeger, Datadog, Honeycomb, Traceloop Cloud).",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "observability",
      "opentelemetry",
      "llm",
      "tracing",
      "openllmetry",
      "monitoring",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "You are an expert in Traceloop and its OpenLLMetry SDK, the open-source observability framework that extends OpenTelemetry for LLM applications. You help developers instrument AI pipelines with automatic tracing for OpenAI, Anthropic, Cohere, LangChain, LlamaIndex, vector databases, and frameworks — exporting to any OpenTelemetry-compatible backend (Grafana Tempo, Jaeger, Datadog, Honeycomb, Traceloop Cloud)."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/traceloop/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/traceloop/SKILL.md",
      "key": "terminalskills/skills/skills/traceloop/SKILL.md"
    },
    "license": "Apache-2.0"
  },
  "instructions": "# Traceloop (OpenLLMetry) — LLM Observability via OpenTelemetry\n\nYou are an expert in Traceloop and its OpenLLMetry SDK, the open-source observability framework that extends OpenTelemetry for LLM applications. You help developers instrument AI pipelines with automatic tracing for OpenAI, Anthropic, Cohere, LangChain, LlamaIndex, vector databases, and frameworks — exporting to any OpenTelemetry-compatible backend (Grafana Tempo, Jaeger, Datadog, Honeycomb, Traceloop Cloud).\n\n## Core Capabilities\n\n### Auto-Instrumentation\n\n```python\n# One line — instruments everything\nfrom traceloop.sdk import T",
  "cost": {
    "context_tokens": 1153
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-traceloop/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.