Skip to content

Conversation

@Bharath-designer
Copy link

@Bharath-designer Bharath-designer commented Jan 28, 2026

Improve telemetry behavior when initialized from non-main threads.

  • Skip signal handler registration when Telemetry is created outside the main thread to avoid noisy ValueError tracebacks.
  • Expand the debug log message to explain how to disable telemetry via CREWAI_DISABLE_TELEMETRY and link to the telemetry docs.
  • Update telemetry tests to cover the new log message contents and non-main-thread behavior.

Fixes: #4289


Note

Improve telemetry robustness in threaded contexts

  • Update telemetry._register_shutdown_handlers to detect non‑main threads and skip calling '_register_signal_handler'; logs a debug message mentioning CREWAI_DISABLE_TELEMETRY=true and linking to https://docs.crewai.com/telemetry to avoid noisy ValueError tracebacks.
  • Add tests in tests/telemetry/test_telemetry.py covering: skip on non‑main thread (no ValueError), presence of the debug log message, and that main thread still registers handlers; minor test import adjustment.

Written by Cursor Bugbot for commit b43b989. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Noisy ValueError tracebacks when CrewAI initialized from non-main thread

1 participant