Dropping Traces
Conditionally dropping traces before they are sent to Confident AI
Overview
Dropping lets you silently discard a trace based on runtime conditions. Unlike sampling, which randomly drops a percentage of traces, this gives you full programmatic control over which traces are sent.
This is useful when you want to conditionally exclude traces — for example, skipping health checks, internal test requests, or traces that don’t meet certain criteria.
Drop a Trace
To drop the current trace, call update_current_trace (Python) or updateCurrentTrace (TypeScript) with drop set to True/true. The trace will be silently discarded and never sent to the observatory.
Python
TypeScript
main.py
Dropped traces are discarded entirely — they will not appear in the observatory or count towards usage.