OpenLIT (tracing)
OpenLIT (tracing)
OpenLIT is an open-source observability SDK for LLM applications. respan-instrumentation-openlit activates OpenLIT’s provider and framework instrumentation, normalizes its native OpenTelemetry spans to the Respan span contract, and exports them through the active Respan tracer provider.
The adapter does not wrap provider calls with a second Respan span. OpenLIT owns the library patches, while Respan owns normalization and export.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Example projects
Setup
Set environment variables
Set RESPAN_BASE_URL as well when exporting to a self-hosted or non-default Respan endpoint.
Initialize and call an instrumented library
Creating Respan activates OpenLIT automatically. Do not call openlit.init() separately for the same process.
View your trace
Open the Traces page to inspect the normalized OpenLIT span, messages, model, usage, status, and nested application context.
What is traced
The adapter normalizes OpenLIT operation types into Respan’s canonical span types.
Model, provider, messages, tool definitions and calls, real provider token usage, standard HTTP and OpenAI attributes, and response status are retained when OpenLIT supplies them. OpenLIT-only cost, metric, framework, and legacy aliases are removed after canonical mapping. Provider failures keep their OpenTelemetry error status and include backend-visible status_code and error.message fields.
For OpenAI sync and async embedding calls, every returned vector element is stored in traceloop.entity.output; vectors are never dimension-truncated by the adapter. Setting capture_content=False omits both embedding inputs and vectors.
Configuration
Disable content capture
Disable content capture when prompts, responses, or tool arguments may contain sensitive data:
The adapter configures OpenLIT not to collect message content and also removes prompts, responses, embedding vectors, and other content fields from OpenLIT spans before export. Model, provider, usage, timing, and error fields remain available.
Limit OpenLIT instrumentation
Use OpenLIT’s disabled_instrumentors option when the process loads libraries that should not be patched:
Add trace context
Use propagated attributes to group OpenLIT spans with the rest of an application workflow:
Avoid duplicate provider spans
Do not enable a provider-specific Respan instrumentor for the same client in the same process unless nested provider spans are intentional. For example, combining OpenLITInstrumentor() and a separate OpenAI instrumentor can produce two spans for one OpenAI request.
Activation is reference-counted. Shutdown removes only the OpenLIT hooks activated by this adapter and preserves instrumentation that was already active.