Observability - openlit.init() | openlit-instrument

Below is a detailed overview of the configuration options available, allowing you to adjust OpenLIT’s behavior and functionality to align with your specific observability needs:
ParameterCLI ArgumentEnvironment VariableDescriptionDefaultRequired
environment--environmentOTEL_DEPLOYMENT_ENVIRONMENTDeployment environment"default"No
service_name--service_nameOTEL_SERVICE_NAMEService name for tracing"default"No
otlp_endpoint--otlp_endpointOTEL_EXPORTER_OTLP_ENDPOINTOTLP endpoint for exporterNoneNo
otlp_headers--otlp_headersOTEL_EXPORTER_OTLP_HEADERSOTLP headers as JSON stringNoneNo
disable_batch--disable_batchOPENLIT_DISABLE_BATCHDisable batch span processingFalseNo
capture_message_content--capture_message_contentOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTEnable capture of message contentTrueNo
disabled_instrumentors--disabled_instrumentorsOPENLIT_DISABLED_INSTRUMENTORSComma-separated list of instrumentors to disableNoneNo
disable_metrics--disable_metricsOPENLIT_DISABLE_METRICSDisable metrics collectionFalseNo
pricing_json--pricing_jsonOPENLIT_PRICING_JSONFile path or URL to pricing JSONNoneNo
detailed_tracing--detailed_tracingOPENLIT_DETAILED_TRACINGEnable detailed component-level tracingTrueNo
collect_system_metrics--collect_system_metricsOPENLIT_COLLECT_SYSTEM_METRICSEnable comprehensive system metrics (CPU, memory, disk, network, GPU if detected)FalseNo
tracerN/AN/AAn instance of OpenTelemetry Tracer for tracing operationsNoneNo
event_loggerN/AN/AEventLoggerProvider instanceNoneNo
meterN/AN/AOpenTelemetry Metrics instanceNoneNo

Deprecated Parameters

ParameterCLI ArgumentEnvironment VariableDescriptionDefaultRequired
application_name--application_nameOTEL_SERVICE_NAMEApplication name for tracing (deprecated, use service_name)"default"No
collect_gpu_stats--collect_gpu_statsOPENLIT_COLLECT_GPU_STATSEnable GPU statistics collection (deprecated, use collect_system_metrics)FalseNo
Note: Environment variables take precedence over CLI arguments, which take precedence over function parameters.

Prompt Hub - openlit.get_prompt()

Below are the parameters for use with the SDK for OpenLIT Prompt Hub for prompt management:
ParameterDescription
urlSets the OpenLIT URL. Defaults to the OPENLIT_URL environment variable.
api_keySets the OpenLIT API Key. Can also be provided via the OPENLIT_API_KEY environment variable.
nameSets the name to fetch a unique prompt. Use this or prompt_id.
prompt_idSets the ID to fetch a unique prompt. Use this or name. Optional
versionSet to True to get the prompt with variable substitution.. Optional
shouldCompileBoolean value that compiles the prompt using the provided variables. Optional
variablesSets the variables for prompt compilation. Optional
meta_propertiesSets the meta-properties for storing in the prompt’s access history metadata. Optional

Vault - openlit.get_secrets()

Below are the parameters for use with the SDK for OpenLIT Vault for secret management:
ParameterDescription
urlSets the Openlit URL. Defaults to the OPENLIT_URL environment variable.
api_keySets the OpenLIT API Key. Can also be provided via the OPENLIT_API_KEY environment variable.
keySets the key to fetch a specific secret. Optional
should_set_envBoolean value that sets all the secrets as environment variables for the application. Optional
tagsSets the tags for fetching only the secrets that have the mentioned tags assigned. Optional