feat: add typed metric family descriptors (#2114)
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:
2121 validates unmodified Micrometer independently of #2114, against
main+ #2124.2123 validates a Micrometer branch that explicitly uses
MetricFamilyDescriptorto implement the existing registration metadata hooks without invoking scrape/sample callbacks during registration.
Signed-off-by: Gregor Zeitlinger gregor.zeitlinger@grafana.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Prometheus Java Metrics Library
Documentation
https://prometheus.github.io/client_java
Contributing and community
See CONTRIBUTING.md and the community section of the Prometheus homepage.
The Prometheus Java community is present on the CNCF Slack on
#prometheus-java, and we have a fortnightly community call in the Prometheus public calendar.Previous Releases
The source code for 0.16.0 and older is on the simpleclient branch.
License
Apache License 2.0, see LICENSE.