Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable telemetry explicitly #1536

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/crewai/telemetry/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def suppress_warnings():


from opentelemetry import trace # noqa: E402
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # noqa: E402
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # noqa: E402
from opentelemetry.sdk.resources import SERVICE_NAME, Resource # noqa: E402
from opentelemetry.sdk.trace import TracerProvider # noqa: E402
from opentelemetry.sdk.trace.export import BatchSpanProcessor # noqa: E402
Expand All @@ -48,6 +48,10 @@ class Telemetry:
def __init__(self):
self.ready = False
self.trace_set = False

if os.getenv("OTEL_SDK_DISABLED", "false").lower() == "true":
return

try:
telemetry_endpoint = "https://telemetry.crewai.com:4319"
self.resource = Resource(
Expand Down
Loading