Disable tracing in tests
SetsampleRate to 0 to drop all events before they reach the queue. No network calls are made.
zespan.init() entirely in tests — the SDK is a no-op if not initialized. Calls to wrapOpenAI() and other wrappers return the original client unchanged.
Disable via environment variable
IfZESPAN_API_KEY is not set, the SDK does not initialize. In CI, simply omit the variable:
Mock the SDK in unit tests
For unit tests that assert on span creation, mock the SDK module:Use a test API key
If you want the SDK initialized in integration tests but do not want real traces sent to Zespan, set a dummy API key and point to a local mock server:Flush in tests
If your test runner exits before the SDK flushes its event queue, traces may be silently dropped. Callzespan.flush() at the end of each test:
CI environment configuration
In CI (GitHub Actions, CircleCI, etc.), setenvironment to "ci" and sampleRate to 0:
LUMIQTRACE_SAMPLE_RATE as a number between 0.0 and 1.0. Set it to 0 to drop all events in CI without changing application code.
Next steps
- Environments — separate production, staging, and development traces
- SDK configuration — full init options reference

