PrometheusComponentProvider promotes all resource attributes when resource_constant_labels is empty ({})
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java, prometheus
- 领域
- backend, observability
调研方向
从 exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/internal/PrometheusComponentProvider.java 开始,重点查看第 63–76 行附近对 resource_constant_labels 的解析,并追踪空配置如何传递到 IncludeExcludePredicate.createPatternMatching。先检查相关的 predicate 测试和 Prometheus exporter 测试。完成标准是空 map 不会将 resource 属性添加为 metric 标签,并且该配置有回归测试覆盖。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
In PrometheusComponentProvider.java, configuring an empty resource_constant_labels: {} map in declarative configuration promotes all resource attributes onto every Prometheus metric series instead of none.
resource_constant_labels: {} is currently valid against the opentelemetry-configuration JSON Schema ($defs.IncludeExclude sets minItems: 1 on included and excluded, not minProperties: 1 on the object). When parsed:
meter_provider:
readers:
- pull:
exporter:
prometheus/development:
resource_constant_labels: {}
config.getStructured("resource_constant_labels") returns a non-null DeclarativeConfigProperties where both included and excluded are null, and passes (null, null) to IncludeExcludePredicate.createPatternMatching(null, null), which returns an include-all predicate (attributeKey -> true).
Expected behavior
Per the Prometheus exporter specification (By default, it MUST NOT add any resource attributes as metric labels) and ExperimentalPrometheusMetricExporter.resource_constant_labels (defaultBehavior: no resource attributes are added), when both included and excluded are null (matching Collector's pkg/resourcetotelemetry IsEmpty() check), no resource attributes should be added as metric labels (or empty {} should be rejected if disallowed by opentelemetry-configuration).
- 主要语言
- Java
- 星标
- 2.5k
- 派生
- 1k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 52
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
open-telemetry/opentelemetry-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
open-telemetry/opentelemetry-java#9011 ·
维护者通常 2 天内回复
-
Fix `otel.sdk.log.created` counting semantics可能已有人在做 @anuraaga 于 93 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
open-telemetry/opentelemetry-java#8688 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
open-telemetry/opentelemetry-java#9013 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
open-telemetry/opentelemetry-java#9012 ·
维护者通常 2 天内回复
-
SimpleLogRecordProcessor/SimpleSpanProcessor.forceFlush() result never completes when an export completes while ofAll() counts the pending set可能已有人在做 @nikhilred2619 于 4 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 62/100
open-telemetry/opentelemetry-java#8995 · 3 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 open-telemetry/opentelemetry-java 的全部 Issue
相似的 Issue
-
bug web-ui
难度 2/5 1-3 小时 新手友好度 67/100
jenkinsci/jenkins#27705 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
googleads/googleads-mobile-flutter#1541 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
Julow/Unexpected-Keyboard#1490 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
Vakore/ZappierGames#275 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
unitycatalog/unitycatalog#2148 ·
维护者通常 2 天内回复