prometheus / prometheus/client_java
Equivalent usage of Simpleclient in micrometer-registry-prometheus `1.13.x`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 833
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 86
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the 1.13 Migration Guide and the PrometheusMeterRegistry, Collector, MetricFamilySamples, and TextFormat APIs mentioned in the issue. Trace the corresponding APIs in the current client_java version and document migration equivalents for all three scenarios, including any required code changes. Done means the migration guide explains these replacements clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, prometheus
- Domain
- observability
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100