maple-agent-tracing-ag…
Trace Agno agents with Maple: installs the OpenInference Agno instrumentor with an OTLP exporter and GenAI attributes, and sets…
Trace Hugging Face smolagents agents with Maple: OpenInference instrumentor with GenAI dual-write, one Maple Agent Session per conversation with transcript, model and tool calls, tokens, failed tools and managed-agent lanes. Triggers on 'trace my smolagents agent', 'add Maple to
Claude Code
$ npx -y skills add mapletechlabs/maple --skill maple-agent-tracing-smolagents --agent claude-code
Codex
$ npx skills add mapletechlabs/maple --skill maple-agent-tracing-smolagents -a codex -y
Cursor
$ npx skills add mapletechlabs/maple --skill maple-agent-tracing-smolagents -a cursor -y
Gemini CLI
$ npx skills add mapletechlabs/maple --skill maple-agent-tracing-smolagents -a gemini-cli -y
GitHub Copilot
$ npx skills add mapletechlabs/maple --skill maple-agent-tracing-smolagents -a github-copilot -y
OpenCode
$ npx skills add mapletechlabs/maple --skill maple-agent-tracing-smolagents -a opencode -y
Windsurf
$ npx skills add mapletechlabs/maple --skill maple-agent-tracing-smolagents -a windsurf -y
name: maple-agent-tracing-smolagents description: "Trace Hugging Face smolagents agents with Maple: OpenInference instrumentor with GenAI dual-write, one Maple Agent Session per conversation with transcript, model and tool calls, tokens, failed tools and managed-agent lanes. Triggers on 'trace my smolagents agent', 'add Maple to smolagents', 'agent sessions for smolagents', 'OpenTelemetry for smolagents'."
Goal: every conversation the app runs through a smolagents agent shows up in Maple **Agent Sessions** as ONE session, with the transcript, each model call (model, tokens), each tool call (name, arguments, result, failure) and one lane per managed agent.
All spans come from `openinference-instrumentation-smolagents`.
pip install "smolagents[openai]>=1.26" "openinference-instrumentation-smolagents>=0.1.40" \ "opentelemetry-sdk>=1.45" "opentelemetry-exporter-otlp-proto-http>=1.45"
Use the repo's package manager (`uv add`, `poetry add`...). Use `[litellm]` instead of `[openai]` for `LiteLLMModel`. Do NOT use the `smolagents[telemetry]` extra: it installs the Arize Phoenix server.
Environment (in the repo's env mechanism):
OTEL_SERVICE_NAME=<service name, e.g. the app/package name> OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=<env> OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.maple.dev OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <key>"
Base URL only. `OTLPSpanExporter()` with no args appends `/v1/traces`. If you pass `endpoint=` in code, it must end in `/v1/traces`.
Create `tracing.py` (adapt the module path to the repo layout):
# tracing.py
import json
from openinference.instrumentation import TraceConfig
from openinference.instrumentation.smolagents import SmolagentsInstrumentor
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import SpanProcessor, TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
class SmolagentsForMaple(SpanProcessor):
def on_start(self, span, parent_context=None):
if span.instrumentation_scope.name != "openinference.instrumentation.smolagents":
return
attrs = span.attributes
if span.name.endswith(".run"):
# "weather_worker.run" -> gen_ai.agent.name "weather_worker", so sub-agents get lanes
span.set_attribute("gen_ai.agent.name", span.name.removesuffix(".run"))
elif "tool.name" in attrs:
# Every @tool span is named "SimpleTool"; name it after the tool instead
span.update_name(f"execute_tool {attrs['tool.name']}")
# The GenAI dual-write copies the tool's input schema here; record the call's arguments
if attrs.get("input.value", "").startswith("{"):
call = json.loads(attrs["input.value"])
span.set_attribute("gen_ai.tool.call.arguments", json.dumps(call["kwargs"] or call["args"]))
provider = TracerProvider() # reads OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES
provider.add_span_processor(SmolagentsForMaple())
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
trace.set_tracer_provider(provider)
SmolagentsInstrumentor().instrument(
tracer_provider=provider,
config=TraceConfig(enable_genai_semconv=True),
)Trace Agno agents with Maple: installs the OpenInference Agno instrumentor with an OTLP exporter and GenAI attributes, and sets…
Trace Claude Agent SDK agents (TypeScript and Python) and Claude Code CLI sessions with Maple: configure Claude Code's built-in…
Trace Cloudflare Agents SDK agents (AIChatAgent, Agent on Durable Objects, npm `agents` / `@cloudflare/ai-chat`) with Maple:…
Trace CrewAI crews and flows with Maple: OpenInference CrewAI instrumentor plus the model-SDK instrumentor, GenAI dual-write, one…
Trace DSPy programs and ReAct agents with Maple: OpenInference DSPy instrumentor with GenAI dual-write, a DSPy callback for…
Trace eve agents (Vercel's eve framework, npm `eve`) with Maple: add one OpenTelemetry destination file under…
Kubeshark installation and deployment skill. Use this skill whenever the user wants to install Kubeshark, deploy Kubeshark to a…
Call the user on the phone for real-time voice conversations. Use this when you need input, want to report on completed work, or…