Equivalent usage of Simpleclient in micrometer-registry-prometheus `1.13.x`
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- java, prometheus
调研方向
从 1.13 Migration Guide 以及 issue 中提到的 PrometheusMeterRegistry、Collector、MetricFamilySamples 和 TextFormat API 开始。跟踪当前 client_java 版本中的对应 API,并为全部三个场景记录迁移等价方案,包括任何必需的代码更改。当迁移指南清楚地解释这些替换项时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Hi Team! We are migrating our project from micrometer-registry-prometheus:1.12.8 to version 1.13.8 . I see that the io.prometheus:simpleclient:jar:0.16.0 has been deprecated.
We have few scenarios which I do not see in the migration guide.
Here are few scenarios,
- What is the equivalent of
io.prometheus.client.Collector.MetricFamilySamplesand theMetricFamilySamples.Sample
PrometheusMeterRegistry instance = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
MetricFamilySamples samples = instance.getPrometheusRegistry().metricFamilySamples()
if (sample == null || sample.name == null || sample.labelNames == null || sample.labelValues == null) {
LOGGER.error("The provided Sample object is either null or one of its fields is null: {}", sample);
throw new IllegalArgumentException("The provided Sample object is either null or one of its fields is null: " + sample);
}
- Is the import
io.prometheus.metrics.model.registry.Collectora replacement ofio.prometheus.client.Collector, however, I couldn't find the below in the new Collector.
Enumeration<Collector.MetricFamilySamples> metricFamilySamples;
- Similarly how we can replace the
io.prometheus.client.exporter.common.TextFormat?
Could you please help me with the code changes. Also, can you share any additional docs available that we can follow for migrating from the usage of simpleclient.
- 主要语言
- Java
- 星标
- 2.3k
- 派生
- 833
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 86
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
prometheus/client_java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
prometheus/client_java#2416 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 86/100
prometheus/client_java#2182 ·
-
难度 5/5 一周以上 新手友好度 35/100
prometheus/client_java#2306 · 9 条评论 · 4 个 reaction ·
-
难度 5/5 一周以上 新手友好度 32/100
prometheus/client_java#2084 · 3 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
prometheus/client_java#2075 · 10 条评论 · 1 个 reaction ·
查看 prometheus/client_java 的全部 Issue
相似的 Issue
-
Bug Java Platform: Java
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-java#6138 · 1 条评论 ·
-
bug needs triage p2
难度 2/5 1-3 小时 新手友好度 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 76/100