diff options
Diffstat (limited to 'service/metrics/config.go')
-rw-r--r-- | service/metrics/config.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/service/metrics/config.go b/service/metrics/config.go index c95fd940..023eff27 100644 --- a/service/metrics/config.go +++ b/service/metrics/config.go @@ -2,6 +2,7 @@ package metrics import ( "fmt" + "github.com/prometheus/client_golang/prometheus" "github.com/spiral/roadrunner/service" ) @@ -54,6 +55,8 @@ type Collector struct { Labels []string `json:"labels"` // Buckets for histogram metric. Buckets []float64 `json:"buckets"` + // Objectives for the summary opts + Objectives map[float64]float64 `json:"objectives"` } // Hydrate configuration. @@ -114,10 +117,11 @@ func (c *Config) getCollectors() (map[string]prometheus.Collector, error) { } case Summary: opts := prometheus.SummaryOpts{ - Name: name, - Namespace: m.Namespace, - Subsystem: m.Subsystem, - Help: m.Help, + Name: name, + Namespace: m.Namespace, + Subsystem: m.Subsystem, + Help: m.Help, + Objectives: m.Objectives, } if len(m.Labels) != 0 { |