Skip to content

Commit

Permalink
Increasing timeout for telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomdmoura committed Feb 20, 2024
1 parent 108a0d3 commit 94cb96b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/crewai/telemtry/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ def __init__(self):
self.ready = False
try:
telemetry_endpoint = "http://telemetry.crewai.com:4318"
self.resource = Resource(attributes={SERVICE_NAME: "crewAI-telemetry"})
self.resource = Resource(
attributes={SERVICE_NAME: "crewAI-telemetry"},
)
self.provider = TracerProvider(resource=self.resource)
processor = BatchSpanProcessor(
OTLPSpanExporter(endpoint=f"{telemetry_endpoint}/v1/traces")
OTLPSpanExporter(endpoint=f"{telemetry_endpoint}/v1/traces", timeout=60)
)
self.provider.add_span_processor(processor)
self.ready = True
Expand All @@ -53,7 +55,10 @@ def __init__(self):

def set_tracer(self):
if self.ready:
trace.set_tracer_provider(self.provider)
try:
trace.set_tracer_provider(self.provider)
except Exception:
self.ready = False

def crew_creation(self, crew):
"""Records the creation of a crew."""
Expand Down

0 comments on commit 94cb96b

Please sign in to comment.