Skip to content

feat: add typed metric family descriptors#2114

Open
zeitlinger wants to merge 4 commits into
prometheus:mainfrom
zeitlinger:feat/typed-metric-family-descriptor
Open

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

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented May 13, 2026

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: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger
Copy link
Copy Markdown
Member Author

Opened draft validation PR #2121 to run the combined compatibility stack: opt-in typed descriptors, #2094 suffix sanitization, and the Micrometer compatibility workflow. This is intended as a proof/test PR so #2114 can stay focused.

@zeitlinger
Copy link
Copy Markdown
Member Author

Opened #2122 as the smaller alternative implementation for #2114: same typed descriptor API, but legacy snapshot builders remain on plain metadata so the new descriptor behavior is opt-in. #2121 remains the combined validation PR with #2094 + Micrometer compatibility.

@zeitlinger
Copy link
Copy Markdown
Member Author

Opened #2122 as the smaller alternative implementation for #2114: same typed descriptor API, but legacy snapshot builders remain on plain metadata so the new descriptor behavior is opt-in. #2121 remains the combined validation PR with #2094 + Micrometer compatibility.

closed that

@zeitlinger zeitlinger marked this pull request as ready for review May 18, 2026 14:52
@zeitlinger zeitlinger force-pushed the feat/typed-metric-family-descriptor branch from ecf59ff to 1dffd50 Compare May 18, 2026 15:22
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger force-pushed the feat/typed-metric-family-descriptor branch from 1dffd50 to 702abc2 Compare May 18, 2026 15:58
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