SpanProcessor the analytics layer (bentolabs_sdk.analytics) sits on top of. Wire it into an OpenTelemetry pipeline directly when you already have one configured, and skip the analytics layer entirely.
This is the path when a TracerProvider is already in place and a second one isn’t welcome, when batching, sampling, or resource attributes need to stay under your control, or when a framework like LangChain, LlamaIndex, or the OpenAI Agents SDK already emits OTel spans that need a destination. For the ergonomic track_ai / begin / decorator surface without managing OTel objects, use the analytics layer instead.
Install
Usage
BentoLabsSpanProcessor batches spans with OpenTelemetry defaults and POSTs them to ${base_url}/v1/traces with Authorization: Bearer bl_pk_....
What ends up in the dashboard
These OTel attributes map to the same dashboard columns the analytics layer fills in. Set them on your spans:
See Attributes for the full table.
Wire the exporter directly
To wire a customSpanProcessor (a SimpleSpanProcessor for tests, or a BatchSpanProcessor with custom limits), use BentoLabsTraceExporter directly:
Errors at boot
BentoLabsSpanProcessor and BentoLabsTraceExporter both resolve options at construction time, which can raise BentoAuthError: