prometheus-metrics-core makes io.prometheus.metrics.tracer.initializer a mandatory OSGi import although the code supports its absence
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #2528 来自 @kalayciburak —— 已合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- build-system
调研方向
从 prometheus-metrics-core 的 maven-bundle-plugin 说明开始,检查生成的 OSGi manifest 中是否有 io.prometheus.metrics.tracer.initializer 的导入。将该导入设为可选,然后运行 OSGi 测试或 micrometer-osgi-test-tests,并验证 bundle 在没有 prometheus-metrics-tracer-initializer 的情况下也能解析。
由索引模型根据 Issue 内容生成。
描述
prometheus-metrics-core 1.9.0 ships Import-Package: io.prometheus.metrics.tracer.initializer;version="[1.9,2)" with no resolution:=optional, so an OSGi deployment that leaves out prometheus-metrics-tracer-initializer cannot resolve the bundle.
The code is written for that artifact to be absent. ExemplarSampler.sampleTraceContextLabels() calls SpanContextSupplier through its fully qualified name on purpose, and the comment says why:
// Using the qualified name so that Micrometer can exclude the dependency on
// prometheus-metrics-tracer-initializer
// as they provide their own implementation of SpanContextSupplier.
// If we had an import statement for SpanContextSupplier the dependency would be needed in any case.
The block that follows is guarded with catch (NoClassDefFoundError ignored).
Micrometer does exactly what that comment describes: micrometer-registry-prometheus excludes the artifact from prometheus-metrics-core. On the Maven side it works. In OSGi it does not resolve:
⇒ Bundle: micrometer-osgi-test-tests cannot be resolved
⇒ because Import-Package requirement for: io.micrometer.prometheusmetrics could not be provided
⇒ because Import-Package requirement for: io.prometheus.metrics.core.exemplars; version=[1.9.0,2.0.0)
⇒ because Import-Package requirement for: io.prometheus.metrics.tracer.initializer; version=[1.9.0,2.0.0)
Dropping prometheus-metrics-tracer-initializer onto the runtime makes it resolve and the tests pass, so that import is the only thing missing.
Marking it optional in the maven-bundle-plugin instructions for prometheus-metrics-core would line the manifest up with what the code already allows, the same way _exportcontents was added to prometheus-metrics-exposition-formats for #2395.
- 主要语言
- Java
- 星标
- 2.3k
- 派生
- 832
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 73
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
prometheus/client_java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
prometheus/client_java#2416 · 1 条评论 ·
维护者通常 1 天内回复
-
Switch Micrometer compatibility workflow to upstream once typed-descriptor path becomes default可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 1/5 1 小时以内 新手友好度 86/100
prometheus/client_java#2182 ·
维护者通常 1 天内回复
-
OpenMetrics 2.0: option to keep _total and unit suffixes, so switching from OM1 doesn't rename series可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 62/100
prometheus/client_java#2518 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
prometheus/client_java#2306 · 10 条评论 · 4 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 32/100
prometheus/client_java#2084 · 3 条评论 ·
维护者通常 1 天内回复
查看 prometheus/client_java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
jenkinsci/ec2-plugin#2041 ·
-
L: github:actions L: php:composer
难度 2/5 1-3 小时 新手友好度 88/100
dependabot/dependabot-core#16493 ·
维护者通常 1 天内回复
-
SHOW EDIT of a subclass for an object of its superclass: the form fails to open with AssertionError未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 1/5 1 小时以内 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 78/100
FlashyReese/sodium-extra#608 ·