mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 00:02:36 +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_system", platform.system())
|
||||||
self._add_attribute(span, "platform_version", platform.version())
|
self._add_attribute(span, "platform_version", platform.version())
|
||||||
self._add_attribute(span, "cpus", os.cpu_count())
|
self._add_attribute(span, "cpus", os.cpu_count())
|
||||||
self._add_attribute(
|
self._add_attribute(span, "crew_inputs", json.dumps(inputs or {}))
|
||||||
span, "crew_inputs", json.dumps(inputs) if inputs else None
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
self._add_attribute(
|
self._add_attribute(
|
||||||
span,
|
span,
|
||||||
@@ -707,9 +705,7 @@ class Telemetry:
|
|||||||
self._add_attribute(span, "model_name", model_name)
|
self._add_attribute(span, "model_name", model_name)
|
||||||
|
|
||||||
if crew.share_crew:
|
if crew.share_crew:
|
||||||
self._add_attribute(
|
self._add_attribute(span, "inputs", json.dumps(inputs or {}))
|
||||||
span, "inputs", json.dumps(inputs) if inputs else None
|
|
||||||
)
|
|
||||||
|
|
||||||
close_span(span)
|
close_span(span)
|
||||||
|
|
||||||
@@ -814,9 +810,7 @@ class Telemetry:
|
|||||||
add_crew_attributes(
|
add_crew_attributes(
|
||||||
span, crew, self._add_attribute, include_fingerprint=False
|
span, crew, self._add_attribute, include_fingerprint=False
|
||||||
)
|
)
|
||||||
self._add_attribute(
|
self._add_attribute(span, "crew_inputs", json.dumps(inputs or {}))
|
||||||
span, "crew_inputs", json.dumps(inputs) if inputs else None
|
|
||||||
)
|
|
||||||
self._add_attribute(
|
self._add_attribute(
|
||||||
span,
|
span,
|
||||||
"crew_agents",
|
"crew_agents",
|
||||||
|
|||||||
Reference in New Issue
Block a user