Client class. This gives you full control over initialization, trace submission, scoring, and lifecycle management.
Programmatic initialization
pandaprobe.init() parameters:
Returns the configured
Client instance and sets it as the global singleton.
If
init() is called when a client already exists, the existing client is shut down and replaced.Creating traces via Client
client.trace() has the same signature as pandaprobe.start_trace().
- Module API
- Client instance
Submitting pre-built traces
When to use `log_trace`
When to use `log_trace`
Use pre-built
TraceData when traces are assembled offline, replayed from logs, or produced by frameworks that already materialize a full trace object.Scoring
Lifecycle management
Error handling
Register callbacks to be notified of transport errors:Properties
client.enabled—bool, whether the SDK is activeclient.config—SdkConfig, the resolved configuration (frozen dataclass)
Auto-initialization
The global client auto-initializes from environment variables on first use. You only need to callpandaprobe.init() if you want to configure the SDK programmatically or override environment variables.
pandaprobe.get_client() returns None if auto-init fails (e.g., missing API key). pandaprobe.start_trace() raises RuntimeError if no client is available.
