diff options
Diffstat (limited to 'plugins/metrics')
-rw-r--r-- | plugins/metrics/config.go | 11 | ||||
-rw-r--r-- | plugins/metrics/tests/metrics_test.go | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/plugins/metrics/config.go b/plugins/metrics/config.go index 933b7eb8..9459bc9b 100644 --- a/plugins/metrics/config.go +++ b/plugins/metrics/config.go @@ -54,6 +54,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"` } // register application specific metrics. @@ -109,10 +111,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 { diff --git a/plugins/metrics/tests/metrics_test.go b/plugins/metrics/tests/metrics_test.go index f9014c95..57b10aa4 100644 --- a/plugins/metrics/tests/metrics_test.go +++ b/plugins/metrics/tests/metrics_test.go @@ -12,7 +12,7 @@ import ( "time" "github.com/spiral/endure" - "github.com/spiral/goridge/v2" + "github.com/spiral/goridge/v3" "github.com/spiral/roadrunner/v2/plugins/config" "github.com/spiral/roadrunner/v2/plugins/logger" "github.com/spiral/roadrunner/v2/plugins/metrics" |