Exemplar keeps stale span context when a reservoir cell is overwritten outside a span
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
调研方向
从 sdk/metrics/.../internal/exemplar/ReservoirCell.java 中的 offerMeasurement() 开始,重点查看第 73-76 行。通过在一个经过采样的 span 内记录,然后在同一 bucket 中离开该 span 后记录,再进行 collect,使用始终启用的 exemplars 复现。完成条件是:被覆盖 exemplar 的 span context 属于新的 measurement,并且对于 span 外的记录无效。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When an exemplar reservoir cell is overwritten within one collection cycle by a measurement recorded outside a span, the exported exemplar has the new value, time and attributes but keeps the trace/span id of the previous measurement.
Steps to reproduce
- Build an
SdkMeterProviderwithsetExemplarFilter(ExemplarFilter.alwaysOn())(orotel.metrics.exemplar.filter=always_on). - On a histogram with default buckets, call
record(1.0)inside a sampled span, thenrecord(2.0)with no active span (same bucket). - Collect.
What did you expect to see?
An exemplar with value=2.0 and an invalid span context. The spec defines an exemplar as one recorded measurement, with the trace/span id of the span active when it was recorded.
What did you see instead?
value=2.0 with the span id of the first measurement. ReservoirCell.offerMeasurement() (sdk/metrics/.../internal/exemplar/ReservoirCell.java lines 73-76) always overwrites value, time and attributes, but updates spanContext only when the new span context is valid.
What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-metrics
Version: main @ ce32c1205
How did you reference these artifacts? Local build
Environment
Compiler: Temurin 21
OS: N/A
Additional context
Not visible with the default trace_based filter, since every measurement it lets through has a sampled span.
- 主要语言
- Java
- 星标
- 2.5k
- 派生
- 1k
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 75
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
open-telemetry/opentelemetry-java 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 94/100
open-telemetry/opentelemetry-java#8898 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
open-telemetry/opentelemetry-java#8896 ·
维护者通常 2 天内回复
-
ComposableProbabilitySampler description still uses the old ComposableTraceIdRatioBasedSampler name未关闭
难度 1/5 1 小时以内 新手友好度 88/100
open-telemetry/opentelemetry-java#8885 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
open-telemetry/opentelemetry-java#8884 ·
维护者通常 2 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 88/100
open-telemetry/opentelemetry-java#8843 ·
维护者通常 2 天内回复
查看 open-telemetry/opentelemetry-java 的全部 Issue
相似的 Issue
-
area/frontend good first issue kind/cooldown
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
beehive-lab/TornadoVM#1151 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
FasterXML/jackson-dataformats-binary#823 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复