Skip to content
Navigation

OpenTelemetry-based observability for Exo agents and tools.

Installation

Part of the exo-ai monorepo:

bash
git clone https://github.com/Midsphere-AI/exo-ai.git && cd exo-ai
uv sync

Module path

python
import exo.trace

Package exports

ExportModuleDescription
TraceConfigexo.trace.configImmutable configuration for the trace layer
TraceBackendexo.trace.configSupported trace export backends enum
tracedexo.trace.decoratorDecorator wrapping a function in an OpenTelemetry span
span_syncexo.trace.decoratorSynchronous span context manager
Timerexo.trace.instrumentationSimple timer for measuring durations
build_agent_attributesexo.trace.instrumentationBuild attribute dict for agent metrics
build_tool_attributesexo.trace.instrumentationBuild attribute dict for tool metrics
record_agent_runexo.trace.instrumentationRecord agent run metrics
record_tool_stepexo.trace.instrumentationRecord tool step metrics
PromptLoggerexo.trace.prompt_loggerStructured LLM execution logger
ExecutionLogEntryexo.trace.prompt_loggerStructured record of a single LLM execution
TokenBreakdownexo.trace.prompt_loggerPer-role token counts and context window analysis
compute_token_breakdownexo.trace.prompt_loggerCompute a TokenBreakdown from message dicts
estimate_tokensexo.trace.prompt_loggerEstimate token count from character length
BaggagePropagatorexo.trace.propagationExtract and inject W3C Baggage headers
Carrierexo.trace.propagationProtocol for reading/writing propagation headers
DictCarrierexo.trace.propagationCarrier backed by a plain dict
SpanConsumerexo.trace.propagationABC for span consumers
get_baggageexo.trace.propagationReturn the current baggage as a dict
get_baggage_valueexo.trace.propagationReturn a single baggage value
set_baggageexo.trace.propagationSet a single baggage key-value pair
clear_baggageexo.trace.propagationRemove all baggage entries
register_span_consumerexo.trace.propagationRegister a span consumer
get_span_consumerexo.trace.propagationLook up a span consumer by name
list_span_consumersexo.trace.propagationList all registered span consumer names
dispatch_spansexo.trace.propagationSend spans to all registered consumers
clear_span_consumersexo.trace.propagationRemove all registered span consumers

Submodules