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

# Observability Enhancements

> New optional OpenTelemetry support and configurable log levels for self-hosted deployments

# New: Observability Enhancements

This release adds optional OpenTelemetry support for improved monitoring and configurable log levels for self-hosted Databrain deployments.

## Upgrade Notes

**No action required for upgrade** - all defaults maintain current behavior. Your existing deployment will work exactly as before without any configuration changes.

## New Features

### Configurable Log Levels

You can now control the verbosity of application logs via the `LOG_LEVEL` environment variable:

```bash theme={"dark"}
LOG_LEVEL=info    # Default - same as current behavior
LOG_LEVEL=debug   # Enable detailed debug logs for troubleshooting
LOG_LEVEL=warn    # Only warnings and errors
LOG_LEVEL=error   # Only errors
```

### OpenTelemetry Integration (Optional)

Enable comprehensive observability with OpenTelemetry to get:

* **API Latency Tracking**: Automatic timing for all endpoints
* **Error Rate Metrics**: Monitor application health
* **Distributed Tracing**: See exactly where time is spent in each request
* **Log Correlation**: Link logs to specific request traces

To enable, add these to your `.env`:

```bash theme={"dark"}
OTEL_ENABLED=true
OTEL_EXPORTER_OTLP_ENDPOINT=http://your-collector:4318
```

OpenTelemetry data can be exported to any OTLP-compatible backend including:

* Grafana (Tempo + Loki + Prometheus)
* SigNoz
* Jaeger
* Datadog
* New Relic

## New Environment Variables

| Variable                      | Default         | Description                           |
| ----------------------------- | --------------- | ------------------------------------- |
| `LOG_LEVEL`                   | `info`          | Log verbosity (debug/info/warn/error) |
| `OTEL_ENABLED`                | `false`         | Enable OpenTelemetry                  |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | -               | OTLP collector URL                    |
| `OTEL_SERVICE_NAME`           | `databrain-api` | Service name in traces                |

## Documentation

See the [Observability Setup Guide](/guides/observability-setup) for detailed configuration instructions.
