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:
Greyson LaLonde
2025-12-08 19:27:42 -05:00
committed by GitHub
parent beef712646
commit 177294f588

View File

@@ -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",