feat: add typed metric family descriptors#2114
Open
zeitlinger wants to merge 4 commits into
Open
Conversation
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>
This was referenced May 13, 2026
Closed
Member
Author
Member
Author
Member
Author
ecf59ff to
1dffd50
Compare
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1dffd50 to
702abc2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(), andgetMetadata()plus theMultiCollectorvariants) in favor ofgetMetricFamilyDescriptor()/getMetricFamilyDescriptors(). The deprecated methods remain bridged by default implementations for compatibility.Related validation:
main+ fix: restore reserved suffix stripping inPrometheusNaming.sanitizeMetricName()#2124.MetricFamilyDescriptorto implement the existing registration metadata hooks without invoking scrape/sample callbacks during registration.