wildedge-python
wildedge-python copied to clipboard
Non-scalar span attribute makes the server reject the whole event batch
What happens
SpanContextManager.set_attributes() (wildedge/client.py:223) accepts any value. If one value is a list, e.g. span.set_attributes(rejections=["English", "too long"]), ingest answers 422 (span attributes['rejections'] must be a scalar) and every event in that batch is dropped: model loads, inferences and spans that had nothing to do with the bad attribute.
Found while integrating a llama.cpp + Whisper app; a whole run's telemetry disappeared because of one attribute.
Expected
One bad value should never cost unrelated events. Options, roughly in order of preference:
- Validate in
set_attributes()/ span constructor: drop (orstr()) non-scalar values and log a warning once. - Coerce lists of scalars to a joined string (plus a
<key>_count?) — that's what we did app-side as a workaround. - On a 422 that names a field, retry the batch without the offending event instead of dropping all of it.
Repro
client = wildedge.init()
with client.trace(run_id="r"):
with client.span(kind="custom", name="s") as span:
span.set_attributes(tags=["a", "b"])
client.close(timeout=5) # batch rejected with 422, nothing ingested
SDK 0.2.2.
🤖 Generated with Claude Code