From 66a63a8c1f5e7dd48d31abac194e9c6f9710e597 Mon Sep 17 00:00:00 2001 From: glightfoot Date: Thu, 28 Jan 2021 14:16:40 -0500 Subject: [PATCH] use summary options defaults in registry Signed-off-by: glightfoot --- pkg/registry/registry.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/registry/registry.go b/pkg/registry/registry.go index 4a746ec..93133aa 100644 --- a/pkg/registry/registry.go +++ b/pkg/registry/registry.go @@ -300,10 +300,17 @@ func (r *Registry) GetSummary(metricName string, labels prometheus.Labels, help if mapping != nil && mapping.SummaryOptions != nil && len(mapping.SummaryOptions.Quantiles) > 0 { quantiles = mapping.SummaryOptions.Quantiles } - summaryOptions := mapper.SummaryOptions{} + + summaryOptions := mapper.SummaryOptions{ + MaxAge: r.Mapper.Defaults.SummaryOptions.MaxAge, + AgeBuckets: r.Mapper.Defaults.SummaryOptions.AgeBuckets, + BufCap: r.Mapper.Defaults.SummaryOptions.BufCap, + } + if mapping != nil && mapping.SummaryOptions != nil { summaryOptions = *mapping.SummaryOptions } + objectives := make(map[float64]float64) for _, q := range quantiles { objectives[q.Quantile] = q.Error