> ## Documentation Index
> Fetch the complete documentation index at: https://laminar.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Python Instrumentation

## Laminar.initialize(...)

Initialize Laminar tracing and auto-instrumentation.

**Parameters:**

| Name                         | Type                        | Default               | Description                                          |
| ---------------------------- | --------------------------- | --------------------- | ---------------------------------------------------- |
| `project_api_key`            | `str`                       | `None`                | Project API key (defaults to `LMNR_PROJECT_API_KEY`) |
| `base_url`                   | `str`                       | `https://api.lmnr.ai` | Base URL                                             |
| `base_http_url`              | `str`                       | `None`                | OTLP HTTP base URL                                   |
| `http_port`                  | `int`                       | `443`                 | OTLP HTTP port                                       |
| `grpc_port`                  | `int`                       | `8443`                | OTLP gRPC port                                       |
| `instruments`                | `set[Instruments]`          | `None`                | Enable only these instruments                        |
| `disabled_instruments`       | `set[Instruments]`          | `None`                | Disable these instruments                            |
| `disable_batch`              | `bool`                      | `False`               | Disable batching span processor                      |
| `max_export_batch_size`      | `int` \| `None`             | `None`                | Batch size (defaults to `64` when `None`)            |
| `export_timeout_seconds`     | `int` \| `None`             | `None`                | Export timeout (defaults to `30` when `None`)        |
| `set_global_tracer_provider` | `bool`                      | `True`                | Set global OTEL tracer provider                      |
| `otel_logger_level`          | `int`                       | `logging.ERROR`       | OTEL logger level                                    |
| `session_recording_options`  | `SessionRecordingOptions`   | `None`                | Browser session recording options                    |
| `force_http`                 | `bool`                      | `False`               | Force OTLP HTTP exporter                             |
| `metadata`                   | `dict[str, AttributeValue]` | `None`                | Global trace metadata                                |

**Returns:** `None`

## Instruments

Enum of available auto-instrumentations.

```python theme={null}
from lmnr import Laminar, Instruments

# Enable only specific instruments
Laminar.initialize(
    instruments={Instruments.OPENAI, Instruments.ANTHROPIC}
)

# Disable specific instruments
Laminar.initialize(
    disabled_instruments={Instruments.LANGCHAIN}
)
```

**Available instruments:**
`ALEPHALPHA`, `ANTHROPIC`, `BEDROCK`, `BROWSER_USE`, `BROWSER_USE_SESSION`, `BUBUS`, `CHROMA`, `CLAUDE_AGENT`, `COHERE`, `CREWAI`, `CUA_AGENT`, `CUA_COMPUTER`, `GOOGLE_GENAI`, `GROQ`, `HAYSTACK`, `KERNEL`, `LANCEDB`, `LANGCHAIN`, `LANGGRAPH`, `LITELLM`, `LLAMA_INDEX`, `MARQO`, `MCP`, `MILVUS`, `MISTRAL`, `OLLAMA`, `OPENAI`, `OPENHANDS`, `OPENTELEMETRY`, `PATCHRIGHT`, `PINECONE`, `PLAYWRIGHT`, `QDRANT`, `REPLICATE`, `SAGEMAKER`, `SKYVERN`, `TOGETHER`, `TRANSFORMERS`, `VERTEXAI`, `WATSONX`, `WEAVIATE`.

***

## SessionRecordingOptions

Browser session recording configuration.

```python theme={null}
from lmnr import SessionRecordingOptions, MaskInputOptions

options = SessionRecordingOptions(
    mask_input_options=MaskInputOptions(...)
)

Laminar.initialize(session_recording_options=options)
```
