Skip to content

Commit

Permalink
Disable telemetry explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
bhancockio committed Oct 30, 2024
1 parent 5f46ff8 commit ad6ffe9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/crewai/telemetry/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ 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 +50,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

0 comments on commit ad6ffe9

Please sign in to comment.