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 小時 新手友好度 88/100
java-native-access/jna#1740 ·
-
難度 1/5 1 小時以內 新手友好度 82/100
-
難度 1/5 1 小時以內 新手友好度 88/100
portfolio-performance/portfolio#6119 ·
維護者通常 8 天內回覆
-
難度 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 天內回覆