Tracing API Reference¶
Optional OpenTelemetry tracing integration (istos[otel]).
OpenTelemetry tracing integration (optional dependency).
TracingMiddleware
¶
Creates an OpenTelemetry span per request, linked across hops.
Continues the caller's trace when the request carried a W3C traceparent
(see :class:~istos.context.RequestEnvelope), and writes this hop's active
traceparent back onto the request context so any outbound query/publish
propagates it to the next hop — end-to-end distributed tracing over Zenoh.
Source code in src/istos/observability/tracing.py
configure_tracing(service_name='istos', endpoint=None)
¶
Configure OpenTelemetry tracing. Returns True if configured, False if opentelemetry is not installed.
Source code in src/istos/observability/tracing.py
set_span_attributes(sp, attributes)
¶
Set attributes on sp, skipping None values. Safe when sp is
None (tracing off).
Source code in src/istos/observability/tracing.py
span(name, attributes=None)
¶
Start a child span when tracing is configured; a no-op otherwise.
Nests under the active request span (the handler's :class:TracingMiddleware
span), so agent model/tool work shows up inside the hop that drove it.