summaryrefslogtreecommitdiff
path: root/service/metrics/config.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-10 10:30:38 +0300
committerValery Piashchynski <[email protected]>2020-12-10 10:30:38 +0300
commit72ef974e2f79c9ee8eb2584baa50ea9a8b98eac9 (patch)
treec19174a239253cf2c62c18398c2a69d400627416 /service/metrics/config.go
parent95bcb4c3f390bebb91041db710dbb4bde994d2fe (diff)
Add objectives to the metrics summary
Diffstat (limited to 'service/metrics/config.go')
-rw-r--r--service/metrics/config.go12
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 {