openlit.init(), by setting environment variables before your process starts, or by using CLI arguments with openlit-instrument. Environment variables take precedence over CLI arguments, which take precedence over SDK parameters.
Environment variables take precedence over CLI arguments, which take precedence over SDK parameters passed directly to
openlit.init().Python
Manual instrumentation
Zero-code instrumentation (CLI)
Core parameters
string
default:"default"
The name of your service as it appears in traces and metrics. Maps to
OTEL_SERVICE_NAME.Replaces the deprecated application_name parameter.string
default:"default"
The deployment environment (for example,
production, staging, development). Maps to OTEL_DEPLOYMENT_ENVIRONMENT.string
default:"None"
The OpenTelemetry OTLP endpoint to export traces and metrics to (for example,
http://127.0.0.1:4318). Maps to OTEL_EXPORTER_OTLP_ENDPOINT.When not set, OpenLIT initialises successfully but does not export any telemetry.dict
default:"None"
Authentication headers for your OTLP endpoint, for example
{"Authorization": "Bearer <token>"}. Maps to OTEL_EXPORTER_OTLP_HEADERS.opentelemetry.trace.Tracer
default:"None"
An existing OpenTelemetry
Tracer instance. Pass this if you have already configured a tracer in your application and want OpenLIT to use the same provider. No environment variable equivalent.opentelemetry.logs.Logger
default:"None"
An existing OpenTelemetry
EventLoggerProvider instance for emitting events. No environment variable equivalent.opentelemetry.metrics.Meter
default:"None"
An existing OpenTelemetry
Meter instance. No environment variable equivalent.boolean
default:"False"
Disables the OpenTelemetry batch span processor and sends spans immediately. Useful in development to see traces without delay. Maps to
OPENLIT_DISABLE_BATCH.Content and tracing parameters
boolean
default:"True"
Captures LLM prompt and response content as span attributes. Disable this for privacy-sensitive workloads or to reduce span size. Maps to
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT.int
default:"None"
Maximum character length for captured prompt and completion content. Content exceeding the limit is truncated with
... appended.None (default), 0, or -1 disables truncation entirely. Maps to OPENLIT_MAX_CONTENT_LENGTH.boolean
default:"True"
Enables detailed component-level tracing for AI frameworks (for example, individual LangChain chain steps). When
False, only workflow-level spans are created, reducing storage overhead. Maps to OPENLIT_DETAILED_TRACING.list[str]
default:"None"
A list of instrumentor names to skip. Use this to disable instrumentation for specific libraries (for example,
["anthropic", "langchain"]). Maps to OPENLIT_DISABLED_INSTRUMENTORS (comma-separated).Metrics parameters
boolean
default:"False"
Disables all OpenTelemetry metrics collection, including cost tracking and performance metrics. Maps to
OPENLIT_DISABLE_METRICS.string
default:"None"
A file path or URL pointing to a custom pricing JSON file. Use this for fine-tuned or private models not in the built-in pricing database. Maps to
OPENLIT_PRICING_JSON.System metrics
boolean
default:"False"
Enables comprehensive system monitoring including CPU, memory, disk, network, and GPU metrics. Requires
opentelemetry-instrumentation-system-metrics. GPU monitoring is automatically enabled if a supported GPU is detected. Maps to OPENLIT_COLLECT_SYSTEM_METRICS.Evaluation export
boolean
default:"True"
When
True, evaluation results are emitted as OTel Log Records. When False, they are emitted as OTel Events. Use True (the default) for backends like Grafana Loki that handle logs better than events. Maps to OPENLIT_EVALS_LOGS_EXPORT.Database instrumentation parameters
These parameters apply to database instrumentations such as PostgreSQL (psycopg3).boolean
default:"False"
Captures database query parameters (the values bound to
$1, $2, and so on) in spans.Maps to OPENLIT_CAPTURE_PARAMETERS.boolean
default:"False"
Injects OpenTelemetry trace context as SQL comments in queries, enabling correlation between application traces and database logs.Maps to
OPENLIT_ENABLE_SQLCOMMENTER.Deprecated parameters
TypeScript
Manual instrumentation
Configuration parameters
Resource attributes
Use standard OpenTelemetry environment variables to attach additional metadata to all telemetry:Quickstart
Get your first trace running in minutes
Tracing
Custom spans, content capture, and manual tracing options
Integrations
60+ supported integrations
