mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-15 11:58:31 +00:00
fix: ensure nonetypes are not passed to otel (#4052)
* fix: ensure nonetypes are not passed to otel * fix: ensure attribute is always set in span
This commit is contained in:
@@ -392,9 +392,7 @@ class Telemetry:
|
||||
self._add_attribute(span, "platform_system", platform.system())
|
||||
self._add_attribute(span, "platform_version", platform.version())
|
||||
self._add_attribute(span, "cpus", os.cpu_count())
|
||||
self._add_attribute(
|
||||
span, "crew_inputs", json.dumps(inputs) if inputs else None
|
||||
)
|
||||
self._add_attribute(span, "crew_inputs", json.dumps(inputs or {}))
|
||||
else:
|
||||
self._add_attribute(
|
||||
span,
|
||||
@@ -707,9 +705,7 @@ class Telemetry:
|
||||
self._add_attribute(span, "model_name", model_name)
|
||||
|
||||
if crew.share_crew:
|
||||
self._add_attribute(
|
||||
span, "inputs", json.dumps(inputs) if inputs else None
|
||||
)
|
||||
self._add_attribute(span, "inputs", json.dumps(inputs or {}))
|
||||
|
||||
close_span(span)
|
||||
|
||||
@@ -814,9 +810,7 @@ class Telemetry:
|
||||
add_crew_attributes(
|
||||
span, crew, self._add_attribute, include_fingerprint=False
|
||||
)
|
||||
self._add_attribute(
|
||||
span, "crew_inputs", json.dumps(inputs) if inputs else None
|
||||
)
|
||||
self._add_attribute(span, "crew_inputs", json.dumps(inputs or {}))
|
||||
self._add_attribute(
|
||||
span,
|
||||
"crew_agents",
|
||||
|
||||
Reference in New Issue
Block a user