What is captured automatically
Every auto-instrumented span includes:Control content capture
By default, OpenLIT captures prompt and response content as span attributes. Disable this for privacy-sensitive workloads:Limit content length
To cap the size of captured content and reduce trace storage costs, setmax_content_length to a positive integer. Content exceeding the limit is truncated with ... appended. None (default), 0, or -1 disables truncation.
Disable batch processing
By default, the SDK uses the OpenTelemetry batch span processor. During local development you may want spans to appear immediately:Disable specific instrumentations
OpenLIT automatically detects and instruments all supported libraries it finds in your environment. To skip specific ones:Use an existing tracer
If your application already configures an OpenTelemetry tracer, pass it to OpenLIT so both use the same provider:Add custom resource attributes
OpenLIT sets the following resource attributes on every span by default:telemetry.sdk.name: openlitservice.name: <your service name>deployment.environment: <your environment>
Manual tracing
For code that is not auto-instrumented, you can create custom spans using the@openlit.trace decorator or the openlit.start_trace context manager.
Decorator
Apply@openlit.trace to a function. Any auto-instrumented LLM calls made inside the function are grouped under the parent span:
Context manager
For more control — including setting a result value and custom metadata — useopenlit.start_trace:
TracedSpan methods:
Configuration
All init() parameters including content capture options
Integrations
Full list of auto-instrumented libraries
Destinations
Send traces to Datadog, Grafana, New Relic, and more
