mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
default back to original summary behavior due to prom version bump
This commit is contained in:
parent
660b17d0ae
commit
454a339f3a
@ -205,16 +205,28 @@ func (o *SummaryOpts) annotateStabilityLevel() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated: DefObjectives will not be used as the default objectives in
|
||||||
|
// v1.0.0 of the library. The default Summary will have no quantiles then.
|
||||||
|
var (
|
||||||
|
defObjectives = map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}
|
||||||
|
)
|
||||||
|
|
||||||
// convenience function to allow easy transformation to the prometheus
|
// convenience function to allow easy transformation to the prometheus
|
||||||
// counterpart. This will do more once we have a proper label abstraction
|
// counterpart. This will do more once we have a proper label abstraction
|
||||||
func (o SummaryOpts) toPromSummaryOpts() prometheus.SummaryOpts {
|
func (o SummaryOpts) toPromSummaryOpts() prometheus.SummaryOpts {
|
||||||
|
// we need to retain existing quantile behavior for backwards compatibility,
|
||||||
|
// so let's do what prometheus used to do prior to v1.
|
||||||
|
objectives := o.Objectives
|
||||||
|
if objectives == nil {
|
||||||
|
objectives = defObjectives
|
||||||
|
}
|
||||||
return prometheus.SummaryOpts{
|
return prometheus.SummaryOpts{
|
||||||
Namespace: o.Namespace,
|
Namespace: o.Namespace,
|
||||||
Subsystem: o.Subsystem,
|
Subsystem: o.Subsystem,
|
||||||
Name: o.Name,
|
Name: o.Name,
|
||||||
Help: o.Help,
|
Help: o.Help,
|
||||||
ConstLabels: o.ConstLabels,
|
ConstLabels: o.ConstLabels,
|
||||||
Objectives: o.Objectives,
|
Objectives: objectives,
|
||||||
MaxAge: o.MaxAge,
|
MaxAge: o.MaxAge,
|
||||||
AgeBuckets: o.AgeBuckets,
|
AgeBuckets: o.AgeBuckets,
|
||||||
BufCap: o.BufCap,
|
BufCap: o.BufCap,
|
||||||
|
Loading…
Reference in New Issue
Block a user