PandaProbe supports fully disabling the SDK, making it safe to leave instrumentation in production code that you only want active in certain environments.
Disable via environment variable
When PANDAPROBE_ENABLED=false:
- The SDK does not initialize a client
pandaprobe.get_client() returns None
pandaprobe.flush() and pandaprobe.shutdown() silently do nothing
@pandaprobe.trace and @pandaprobe.span decorators pass through transparently (zero overhead)
- Wrappers return the original client unchanged
- Integration adapters’
instrument() calls are no-ops
This makes it safe to leave PandaProbe instrumentation in all environments. The SDK adds zero overhead when disabled.
Disable via init()
Environment-based configuration
Common pattern using different configurations per environment:
Conditional tracing without disabling
If you want the SDK enabled but want to conditionally trace specific operations: