mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
add some documentation around the metrics stability migration changes for clarity
This commit is contained in:
parent
3a50917795
commit
6f70f781df
@ -30,6 +30,14 @@ const (
|
|||||||
statusFailUnknown = "fail-unknown"
|
statusFailUnknown = "fail-unknown"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* By default, all the following metrics are defined as falling under
|
||||||
|
* ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes)
|
||||||
|
*
|
||||||
|
* Promoting the stability level of the metric is a responsibility of the component owner, since it
|
||||||
|
* involves explicitly acknowledging support for the metric across multiple releases, in accordance with
|
||||||
|
* the metric stability policy.
|
||||||
|
*/
|
||||||
var storageOperationMetric = metrics.NewHistogramVec(
|
var storageOperationMetric = metrics.NewHistogramVec(
|
||||||
&metrics.HistogramOpts{
|
&metrics.HistogramOpts{
|
||||||
Name: "storage_operation_duration_seconds",
|
Name: "storage_operation_duration_seconds",
|
||||||
@ -73,6 +81,8 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func registerMetrics() {
|
func registerMetrics() {
|
||||||
|
// legacyregistry is the internal k8s wrapper around the prometheus
|
||||||
|
// global registry, used specifically for metric stability enforcement
|
||||||
legacyregistry.MustRegister(storageOperationMetric)
|
legacyregistry.MustRegister(storageOperationMetric)
|
||||||
legacyregistry.MustRegister(storageOperationErrorMetric)
|
legacyregistry.MustRegister(storageOperationErrorMetric)
|
||||||
legacyregistry.MustRegister(storageOperationStatusMetric)
|
legacyregistry.MustRegister(storageOperationStatusMetric)
|
||||||
|
@ -32,6 +32,6 @@ var (
|
|||||||
// RegisterBuildInfo registers the build and version info in a metadata metric in prometheus
|
// RegisterBuildInfo registers the build and version info in a metadata metric in prometheus
|
||||||
func RegisterBuildInfo(r KubeRegistry) {
|
func RegisterBuildInfo(r KubeRegistry) {
|
||||||
info := version.Get()
|
info := version.Get()
|
||||||
buildInfo.WithLabelValues(info.Major, info.Minor, info.GitVersion, info.GitCommit, info.GitTreeState, info.BuildDate, info.GoVersion, info.Compiler, info.Platform).Set(1)
|
|
||||||
r.MustRegister(buildInfo)
|
r.MustRegister(buildInfo)
|
||||||
|
buildInfo.WithLabelValues(info.Major, info.Minor, info.GitVersion, info.GitCommit, info.GitTreeState, info.BuildDate, info.GoVersion, info.Compiler, info.Platform).Set(1)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user