Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Non-scalar span attribute makes the server reject the whole event batch

未关闭
#61 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

Start with SpanContextManager.set_attributes() in wildedge/client.py:223 and the span constructor, then run the provided reproduction to confirm the 422 and dropped batch. Decide how non-scalar values should be handled, including whether to warn or coerce them, and update the relevant tests if present. Done means a non-scalar attribute no longer causes unrelated events in the batch to be rejected.

由索引模型根据 Issue 内容生成。

描述

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:

  1. Validate in set_attributes() / span constructor: drop (or str()) non-scalar values and log a warning once.
  2. Coerce lists of scalars to a joined string (plus a <key>_count?) — that's what we did app-side as a workaround.
  3. 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

主要语言
Python
星标
17
派生
1
平均合并
23 分钟
30 天内合并 PR
7

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

wild-edge/wildedge-python 的其他 Issue

查看 wild-edge/wildedge-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。