Configure Netra SDK using environment variables
Variable Name | Description | Default | Example Value |
---|---|---|---|
NETRA_APP_NAME | Logical name for your service | Falls back to OTEL_SERVICE_NAME or llm_tracing_service | my-ai-service |
NETRA_OTLP_ENDPOINT | URL for OTLP collector | Falls back to OTEL_EXPORTER_OTLP_ENDPOINT | https://collector.example.com:4318 |
NETRA_API_KEY | API key for authentication | None | your-api-key-here |
NETRA_HEADERS | Additional headers in W3C Correlation-Context format | None | x-api-key=your-api-key |
NETRA_DISABLE_BATCH | Disable batch span processor (true /false ) | false | true |
NETRA_TRACE_CONTENT | Whether to capture prompt/completion content (true /false ) | true | false |
NETRA_ENV | Deployment environment (e.g., prod , staging , dev ) | local | production |
NETRA_RESOURCE_ATTRS | JSON string of custom resource attributes | {} | {'team': 'ai', 'version': '1.0.0'} |
Variable Name | Description | Used When | Example Value |
---|---|---|---|
OTEL_SERVICE_NAME | Logical name for your service | When NETRA_APP_NAME is not set | my-service |
OTEL_EXPORTER_OTLP_ENDPOINT | URL for OTLP collector | When NETRA_OTLP_ENDPOINT is not set | https://otel-collector.example.com:4318 |
OTEL_EXPORTER_OTLP_HEADERS | Additional headers for OTLP exporter | When NETRA_HEADERS is not set | api-key=your-key |
OTEL_RESOURCE_ATTRIBUTES | Additional resource attributes | When NETRA_RESOURCE_ATTRS is not set | team=ai,version=1.0.0 |
Netra.init()
NETRA_*
variablesOTEL_*
variables