Launch Week 3: Five days of launches

Dropping Traces

Conditionally dropping traces before they are sent to Confident AI

Included on the Enterprise plan. Book a demo, opens in a new tab. Included on the Team plan. Included on the Starter plan. Not included on the Free plan.

Overview

Dropping lets you skip tracing entirely for a request based on runtime conditions. Unlike sampling, which randomly drops a percentage of traces, this gives you full programmatic control over which requests are traced.

Drop a Trace

To drop a trace, wrap the request in a suppression scope before the work starts. Nothing inside the scope is recorded or exported — not your own spans, and not the auto-instrumented provider calls either.

main.py
from langchain_openai import ChatOpenAI
from confident_trace import init, suppress_tracing

init()
model = ChatOpenAI(model="gpt-4o")

def handle_request(query: str, is_internal: bool):
    if is_internal:
        with suppress_tracing():
            return model.invoke(query)  # this trace is dropped
    return model.invoke(query)          # this trace is sent

Suppression works for both sync and async code. Scopes are isolated across concurrent requests — suppressing one request never affects another running at the same time.

Next Steps

Dropping handles the traffic you never want to see. For everything else, control volume with sampling.

Ready to monitor AI in production?Connect traces, alerts, dashboards, and evals in one production workflowBook a demo

Last updated on

Built byConfident AI