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

Scores bypass sample_rate since v4

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

@hassiebp 已经在做这个了。

开始于 2026年9月18日。

评估

这个 Issue 还没有评估数据。

描述

feat-scores sdk-python unconfirmed-bug

Since 4.0.0, sample_rate is applied to traces but not to scores. A run sampled at 0.001 still uploads a score for every sample, all pointing at traces that were never exported.

The reason is that create_score builds the ScoreBody with camelCase kwargs (traceId, observationId, ...). The v4 Fern models expect the snake_case field names and, because extra is allowed, quietly store the camelCase ones as extras. So body.trace_id is None, and add_score_task treats every score as a session score and skips the sampler. The request still looks right on the wire only because model_dump passes the extras through.

Check: sample_rate 0.001, 2000 generations, one create_score per generation. On 3.10.3 that enqueues 2 scores. On 4.0.0 and 4.15.4 it enqueues about 1770.

主要语言
Python
星标
468
派生
349
平均合并
15 小时 51 分钟
30 天内合并 PR
24

贡献指南

打开贡献指南

从这里开始

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

langfuse/langfuse-python 的其他 Issue

查看 langfuse/langfuse-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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