feat: add opt-in typed metric family descriptors by zeitlinger · Pull Request #2122 · prometheus/client_java · GitHub
Skip to content

feat: add opt-in typed metric family descriptors#2122

Closed
zeitlinger wants to merge 4 commits into
prometheus:mainfrom
zeitlinger:alt/typed-metric-family-descriptor-opt-in
Closed

feat: add opt-in typed metric family descriptors#2122
zeitlinger wants to merge 4 commits into
prometheus:mainfrom
zeitlinger:alt/typed-metric-family-descriptor-opt-in

Conversation

@zeitlinger

@zeitlinger zeitlinger commented May 18, 2026

Copy link
Copy Markdown
Member

Alternative to #2114 that keeps typed metric family descriptors opt-in.

Difference from #2114:

  • Keeps the legacy snapshot builders using plain MetricMetadata construction.
  • Does not derive counter/info metadata automatically in CounterSnapshot.Builder or InfoSnapshot.Builder.
  • Restores the builder fields to private and avoids forcing legacy/deprecated consumers into the typed descriptor path.

The new typed descriptor API remains available for collectors that explicitly opt in to the new behavior.

Related validation:

Local validation:

  • mise run build

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

Copy link
Copy Markdown
Member Author

@zeitlinger zeitlinger closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant