feat: add typed metric family descriptors by zeitlinger · Pull Request #2114 · prometheus/client_java (original) (raw)

added 3 commits

May 13, 2026 12:14

@zeitlinger

Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com

@zeitlinger

Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com

@zeitlinger

Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com

This was referenced

May 13, 2026

@zeitlinger

Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com

@zeitlinger

jaydeluca

jaydeluca

zeitlinger added a commit that referenced this pull request

May 22, 2026

@zeitlinger @jaydeluca

Draft validation PR for the unmodified Micrometer compatibility story.

This intentionally does not depend on #2114. Vanilla Micrometer does not use the typed descriptor API and does not implement the #1800 registration metadata hooks, so this PR validates the patch-compatible path independently of typed descriptors.

This validates upstream micrometer-metrics/micrometer@main against:

Local validation:


Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com Co-authored-by: Jay DeLuca jaydeluca4@gmail.com

@zeitlinger

Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com

@zeitlinger

jaydeluca

@zeitlinger zeitlinger deleted the feat/typed-metric-family-descriptor branch

June 1, 2026 16:52

zeitlinger added a commit that referenced this pull request

Jun 2, 2026

@zeitlinger @dhoard

Draft validation PR for the unmodified JMX Exporter compatibility story.

This intentionally does not depend on #2114. Vanilla JMX Exporter does not use the typed descriptor API, so this PR validates the patch-compatible path independently of typed descriptors.

This validates upstream prometheus/jmx_exporter@main against current client_java by installing local io.prometheus artifacts and running the JMX Exporter collector/common/javaagent/standalone Maven tests against them.

Local validation:


Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com Co-authored-by: Doug Hoard dhoard@users.noreply.github.com

zeitlinger added a commit that referenced this pull request

Jun 3, 2026

@zeitlinger

Draft validation PR for the downstream opt-in path.

Depends on #2114 for the typed descriptor implementation. This branch is stacked on the #2114 head, so once #2114 lands this PR should shrink to only the Micrometer opt-in compatibility tooling.

This validates Micrometer using the new descriptor API, defaulting to:

That Micrometer branch provides MetricFamilyDescriptor metadata from the Prometheus registry without invoking scrape/sample callbacks during registration.

Local validation:


Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com

zeitlinger added a commit that referenced this pull request

Jun 3, 2026

@github-actions @zeitlinger

jaydeluca added a commit that referenced this pull request

Jun 4, 2026

@zeitlinger @jaydeluca

Draft validation PR for the unmodified Micrometer compatibility story.

This intentionally does not depend on #2114. Vanilla Micrometer does not use the typed descriptor API and does not implement the #1800 registration metadata hooks, so this PR validates the patch-compatible path independently of typed descriptors.

This validates upstream micrometer-metrics/micrometer@main against:

Local validation:


Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com Co-authored-by: Jay DeLuca jaydeluca4@gmail.com Signed-off-by: Jay DeLuca jaydeluca4@gmail.com

jaydeluca pushed a commit that referenced this pull request

Jun 4, 2026

@zeitlinger @jaydeluca

Adds typed metric family descriptors and typed metadata support for the model snapshots.

This is the typed-descriptor branch for downstreams that want to provide registration-time metadata explicitly. The #1800 Collector/MultiCollector registration metadata hooks are already optional via default methods, so unmodified downstreams should not need this PR just to keep working.

This PR now also deprecates the fragmented registration metadata API (getPrometheusName(), getMetricType(), getLabelNames(), and getMetadata() plus the MultiCollector variants) in favor of getMetricFamilyDescriptor() / getMetricFamilyDescriptors(). The deprecated methods remain bridged by default implementations for compatibility.

Related validation:


Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com Signed-off-by: Jay DeLuca jaydeluca4@gmail.com

jaydeluca pushed a commit that referenced this pull request

Jun 4, 2026

Draft validation PR for the unmodified JMX Exporter compatibility story.

This intentionally does not depend on #2114. Vanilla JMX Exporter does not use the typed descriptor API, so this PR validates the patch-compatible path independently of typed descriptors.

This validates upstream prometheus/jmx_exporter@main against current client_java by installing local io.prometheus artifacts and running the JMX Exporter collector/common/javaagent/standalone Maven tests against them.

Local validation:


Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com Co-authored-by: Doug Hoard dhoard@users.noreply.github.com Signed-off-by: Jay DeLuca jaydeluca4@gmail.com

jaydeluca pushed a commit that referenced this pull request

Jun 4, 2026

@zeitlinger @jaydeluca

Draft validation PR for the downstream opt-in path.

Depends on #2114 for the typed descriptor implementation. This branch is stacked on the #2114 head, so once #2114 lands this PR should shrink to only the Micrometer opt-in compatibility tooling.

This validates Micrometer using the new descriptor API, defaulting to:

That Micrometer branch provides MetricFamilyDescriptor metadata from the Prometheus registry without invoking scrape/sample callbacks during registration.

Local validation:


Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com Signed-off-by: Jay DeLuca jaydeluca4@gmail.com

jaydeluca pushed a commit that referenced this pull request

Jun 4, 2026

🤖 I have created a release beep boop

1.7.0 (2026-06-03)

Features

Bug Fixes

Performance Improvements

Documentation


[!IMPORTANT] Close and reopen this PR to trigger CI checks.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com Signed-off-by: Jay DeLuca jaydeluca4@gmail.com

zeitlinger added a commit that referenced this pull request

Jun 4, 2026

@zeitlinger

Summary

Covers user-facing changes since v1.6.1:

Test plan

Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})