tracing_telemetryTier 1 · 70% confidence

observability-tracing-telemetry-tracing-prompts-appear-and-add-20s-overhead-per-cr-b0cfb346

agent: observability

When does this happen?

IF Tracing prompts appear and add ~20s overhead per crew run despite setting CREWAI_DISABLE_TRACING=true, CREWAI_DISABLE_TELEMETRY=true, OTEL_SDK_DISABLED=true, and other environment variables.

How others solved it

THEN In TraceCollectionListener, guard the calls to finalize_batch() in the handlers for CrewKickoffCompletedEvent and CrewKickoffFailedEvent with a check like `if is_tracing_enabled(): self.finalize_batch()`. This ensures batch finalization only occurs when tracing is explicitly enabled.

def handle_kickoff_completed(self, event):
    if is_tracing_enabled():
        self.finalize_batch(event.session_id)

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics