OpenLIT SDK offers two ways to add opentelemetry-native observability to your AI applications:

Zero-code instrumentation

Runtime wrapper, no code changes needed
terminal
openlit-instrument \
  python app.py
Use when:
  • Working with existing/production apps
  • Code changes are restricted or risky

Manual instrumentation

Add 2 lines to your code for auto instrumentation
example.py
import openlit
openlit.init()
Use when:
  • Building new applications
  • Need custom spans or metadata
  • Want advanced configuration options

Comparison

Zero-code instrumentationManual instrumentation
Code changesNone2 lines
Advanced featuresBasic configurationFull access to custom spans, metadata
Setup timeInstant1 minute
Best forProduction apps, Existing AppsNew apps, custom needs

Kubernetes

Running in Kubernetes? Try the OpenLIT Operator

Automatically inject instrumentation into existing workloads without modifying pod specs, container images, or application code.