diff options
author | Valery Piashchynski <[email protected]> | 2020-12-15 14:28:30 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-15 14:28:30 +0300 |
commit | 21b51367e27f5a1b166459a115e4655d07a5d832 (patch) | |
tree | c3257a2ac38f0688e78ca2c9eeb160fb7a84c55d /plugins/metrics | |
parent | 08f073f3bdc1288db68235c098c3a2109c6e7667 (diff) | |
parent | d39a0735fe21d21c5aae20c4780458433a42250a (diff) |
Merge branch '2.0' into plugin/reloader
# Conflicts:
# go.mod
# sync_worker.go
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" |