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

# Configuration Options

> Configure the SGP Tracing SDK's behavior.

The SGP Tracing SDK allows you to customize its behavior through a combination of environment variables and parameters passed during SDK initialization.

## Environment Variables

These environment variables provide a quick way to configure common settings, especially for deployment environments.

| Environment Variable    | Description                                                                                                                                                                                                                                             |
| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `DISABLE_SCALE_TRACING` | If set to any value (e.g., `true`, `1`), tracing data will **not** be exported. In this mode, the SDK returns "No-Op" variants of Trace and Span objects, which allow your code to run without errors but perform no actual data collection or sending. |
| `SGP_API_KEY`           | Your SGP API Key. If set, the SDK can automatically initialize without needing to pass an `SGPClient` explicitly to `tracing.init()`.                                                                                                                   |
| `SGP_ACCOUNT_ID`        | Your SGP Account ID. If set, the SDK can automatically initialize without needing to pass an `SGPClient` explicitly to `tracing.init()`.                                                                                                                |
| `SGP_CLIENT_BASE_URL`   | Custom base URL for API requests. If set, this overrides the default environment URL. Mutually exclusive with the `environment` parameter.                                                                                                              |

## Programmatic Configuration

The `tracing.init()` function, typically called at your application's entry point, accepts various parameters to configure the tracing behavior. Programmatic settings take precedence over environment variables.

```python theme={null}
import scale_gp_beta.lib.tracing as tracing
from scale_gp_beta import SGPClient

# Example of a comprehensive initialization
tracing.init(
    client=SGPClient(
        api_key="YOUR_API_KEY",
        account_id="YOUR_ACCOUNT_ID",
        base_url="SGP_CLIENT_BASE_URL",
        timeout=30.0
    ),
    disabled=False, # Explicitly enable or disable tracing (overrides ENV var if False)
)
```

### `client`

An initialized `SGPClient` instance. If provided, the SDK will use this client for all tracing data export requests. This allows you to configure HTTP settings (like `base_url`, `timeout`, `max_retries` for the client itself) that will also apply to your tracing data.

### `disabled`

* Set to `True` to explicitly disable tracing. When disabled, `create_trace()` and `create_span()` will return "No-Op" objects that perform no data collection or export.
* Set to `False` to explicitly enable tracing.
* Defaults to `False` if not specified, unless `DISABLE_SCALE_TRACING` environment variable is set.
