maple-agent-tracing-smolagents

Installation
SKILL.md

Maple agent tracing: 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.

Step 0: Detect versions and existing OpenTelemetry

  • Read pyproject.toml / requirements*.txt / uv.lock / poetry.lock. Need smolagents>=1.26 and Python >=3.10. If older, upgrade smolagents first.
  • Find which model class the app uses (OpenAIServerModel/OpenAIModel, LiteLLMModel, InferenceClientModel, AzureOpenAIModel, AmazonBedrockModel, TransformersModel...). Note any custom Model subclass that overrides generate: it will produce NO model spans.
  • Find every agent.run(...) call site and how conversations are identified (chat id, thread id, session row).
  • Search for an existing TracerProvider, trace.set_tracer_provider, opentelemetry-instrument, logfire.configure, phoenix.otel.register, langfuse, or SmolagentsInstrumentor already present. If a provider exists, REUSE it: add Maple's exporter and the processor below to it, pass it to instrument(). Never create a second provider. If SmolagentsInstrumentor().instrument() already runs, change that call instead of adding another (a second call is a silent no-op).
  • Search for openinference-instrumentation-openai, openinference-instrumentation-litellm, OpenAIInstrumentor, LiteLLMInstrumentor. If present only to trace smolagents' model calls, remove them (they double every model span).

Step 1: Ingest key and region

Installs
5
GitHub Stars
1.9K
First Seen
Oct 8, 2026