The analytics layer (Documentation Index
Fetch the complete documentation index at: https://docs.bentolabs.ai/llms.txt
Use this file to discover all available pages before exploring further.
bentolabs_sdk.analytics) sits on top of an OpenTelemetry SpanProcessor. If you already have an OTel pipeline configured for your app, you can wire the BentoLabs exporter into it directly and skip the analytics layer entirely.
When to use this
Use the OTel transport directly when:- You already have a
TracerProviderconfigured and don’t want a second one. - You want to control batching, sampling, or resource attributes yourself.
- You’re using a framework (LangChain, LlamaIndex, OpenAI Agents SDK) that emits OTel spans and you just want to ship them.
track_ai / begin / decorator surface without managing OTel objects.
Install
Usage
${base_url}/v1/traces with Authorization: Bearer bl_pk_....
What ends up in the dashboard
To get the same dashboard columns the analytics layer fills in, set these OTel attributes on your spans:| OTel attribute | Lands in | Set via |
|---|---|---|
span.name | spans.name | tracer.start_span(name) |
gen_ai.user.id | traces.user_id | span.set_attribute(...) |
gen_ai.conversation.id | traces.session_id | span.set_attribute(...) |
gen_ai.request.model | spans.model | span.set_attribute(...) |
gen_ai.system | spans.provider | span.set_attribute(...) |
input.value | spans.input | span.set_attribute(...) |
output.value | spans.output | span.set_attribute(...) |
openinference.span.kind="tool" | spans.kind = "tool" | span.set_attribute(...) |
Just the exporter
If you want to wire a customSpanProcessor (e.g. 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: