Skip to main content
Environment variables provide a way to configure Netra without modifying code. This is useful for managing different configurations across environments (development, staging, production) and for keeping sensitive values like API keys out of your codebase.

Netra Environment Variables

These variables are specific to the Netra SDK:

Authentication and Endpoint

Use the endpoint that matches your selected data region:

Application Identity

Tracing Behavior

Attribute Limits

Context Propagation

Netra stores session_id, user_id, and tenant_id as W3C baggage. The Python SDK’s httpx and requests instrumentations remove the baggage header from outbound requests unless the destination host is on this list, so these identifiers are not sent to third-party APIs such as LLM providers. Trace context (traceparent and tracestate) is sent to every host.
  • An entry matches the host itself and its subdomains: mycorp.net matches api.mycorp.net but not notmycorp.net.
  • Matching is case-insensitive, and a leading dot is ignored (.mycorp.net is the same as mycorp.net).
  • The variable is read when Netra.init() runs. It has no Netra.init() parameter.
With this variable unset, the baggage header is sent to no host. If a downstream service reads session, user, or tenant IDs from incoming baggage, add its host to NETRA_PROPAGATE_BAGGAGE_HOSTS. The whole header is gated, so a baggage header your own code sets on a request is also removed for hosts that are not on the list.
See Propagating Session Context for how this affects distributed traces.

Resource Attributes

OpenTelemetry Environment Variables

Netra also respects standard OpenTelemetry environment variables. These serve as fallbacks when Netra-specific variables are not set.

Configuration Precedence

When the same setting is configured in multiple places, Netra uses this priority order:
  1. Code parameters (highest priority)
  2. Netra environment variables
  3. OpenTelemetry environment variables
  4. Default values (lowest priority)

Example

Environment-Specific Configuration

Development

Staging

Production

Loading Environment Variables

Python

TypeScript/Node.js

Docker and Kubernetes

Docker

Docker Compose

Kubernetes

Complete Reference

Next Steps

Last modified on September 30, 2026