Token usage, step timing, and log output are tracked in src/smolagents/monitoring.py. The Monitor class attaches to every MultiStepAgent instance and records input/output token counts per step via the TokenUsage dataclass. AgentLogger wraps rich.console.Console for coloured terminal output at configurable LogLevel (DEBUG, INFO, WARNING, ERROR).
OpenTelemetry-based observability is available via the telemetry optional extra (pyproject.toml), which installs arize-phoenix, opentelemetry-sdk, opentelemetry-exporter-otlp, and openinference-instrumentation-smolagents>=0.1.15. When this extra is installed and a Phoenix server is running, agent traces are exported automatically using OpenInference conventions.
The RunResult object (returned by agent.run(return_full_result=True)) carries aggregated TokenUsage and a Timing record with wall-clock start/end times for the full run.
src/smolagents/monitoring.pysrc/smolagents/agents.pypyproject.toml