Configuring Options for OpenLIT SDK
openlit.init()
| openlit-instrument
Parameter | CLI Argument | Environment Variable | Description | Default | Required |
---|---|---|---|---|---|
environment | --environment | OTEL_DEPLOYMENT_ENVIRONMENT | Deployment environment | "default" | No |
service_name | --service_name | OTEL_SERVICE_NAME | Service name for tracing | "default" | No |
otlp_endpoint | --otlp_endpoint | OTEL_EXPORTER_OTLP_ENDPOINT | OTLP endpoint for exporter | None | No |
otlp_headers | --otlp_headers | OTEL_EXPORTER_OTLP_HEADERS | OTLP headers as JSON string | None | No |
disable_batch | --disable_batch | OPENLIT_DISABLE_BATCH | Disable batch span processing | False | No |
capture_message_content | --capture_message_content | OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT | Enable capture of message content | True | No |
disabled_instrumentors | --disabled_instrumentors | OPENLIT_DISABLED_INSTRUMENTORS | Comma-separated list of instrumentors to disable | None | No |
disable_metrics | --disable_metrics | OPENLIT_DISABLE_METRICS | Disable metrics collection | False | No |
pricing_json | --pricing_json | OPENLIT_PRICING_JSON | File path or URL to pricing JSON | None | No |
detailed_tracing | --detailed_tracing | OPENLIT_DETAILED_TRACING | Enable detailed component-level tracing | True | No |
collect_system_metrics | --collect_system_metrics | OPENLIT_COLLECT_SYSTEM_METRICS | Enable comprehensive system metrics (CPU, memory, disk, network, GPU if detected) | False | No |
tracer | N/A | N/A | An instance of OpenTelemetry Tracer for tracing operations | None | No |
event_logger | N/A | N/A | EventLoggerProvider instance | None | No |
meter | N/A | N/A | OpenTelemetry Metrics instance | None | No |
Parameter | CLI Argument | Environment Variable | Description | Default | Required |
---|---|---|---|---|---|
application_name | --application_name | OTEL_SERVICE_NAME | Application name for tracing (deprecated, use service_name ) | "default" | No |
collect_gpu_stats | --collect_gpu_stats | OPENLIT_COLLECT_GPU_STATS | Enable GPU statistics collection (deprecated, use collect_system_metrics ) | False | No |
openlit.get_prompt()
Parameter | Description |
---|---|
url | Sets the OpenLIT URL. Defaults to the OPENLIT_URL environment variable. |
api_key | Sets the OpenLIT API Key. Can also be provided via the OPENLIT_API_KEY environment variable. |
name | Sets the name to fetch a unique prompt. Use this or prompt_id . |
prompt_id | Sets the ID to fetch a unique prompt. Use this or name . Optional |
version | Set to True to get the prompt with variable substitution.. Optional |
shouldCompile | Boolean value that compiles the prompt using the provided variables. Optional |
variables | Sets the variables for prompt compilation. Optional |
meta_properties | Sets the meta-properties for storing in the prompt’s access history metadata. Optional |
openlit.get_secrets()
Parameter | Description |
---|---|
url | Sets the Openlit URL. Defaults to the OPENLIT_URL environment variable. |
api_key | Sets the OpenLIT API Key. Can also be provided via the OPENLIT_API_KEY environment variable. |
key | Sets the key to fetch a specific secret. Optional |
should_set_env | Boolean value that sets all the secrets as environment variables for the application. Optional |
tags | Sets the tags for fetching only the secrets that have the mentioned tags assigned. Optional |