summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-02-10 19:11:55 +0300
committerValery Piashchynski <[email protected]>2020-02-10 19:11:55 +0300
commitf78cc049eec4e264a28edcb1bb95589d4e561cb2 (patch)
treee422d601a3fdd00a33bacd71404f638e8bd91955
parentdfa2686e0a343b5f238d78741b3bb9d060a1ce31 (diff)
Add json tags to Collector and NamedCollector
-rw-r--r--service/metrics/config.go21
1 files changed, 8 insertions, 13 deletions
diff --git a/service/metrics/config.go b/service/metrics/config.go
index bee4f3d1..c95fd940 100644
--- a/service/metrics/config.go
+++ b/service/metrics/config.go
@@ -17,10 +17,10 @@ type Config struct {
type NamedCollector struct {
// Name of the collector
- Name string
+ Name string `json:"name"`
// Collector structure
- Collector
+ Collector `json:"collector"`
}
// CollectorType represents prometheus collector types
@@ -43,22 +43,17 @@ const (
// Collector describes single application specific metric.
type Collector struct {
// Namespace of the metric.
- Namespace string
-
+ Namespace string `json:"namespace"`
// Subsystem of the metric.
- Subsystem string
-
+ Subsystem string `json:"subsystem"`
// Collector type (histogram, gauge, counter, summary).
- Type CollectorType
-
+ Type CollectorType `json:"type"`
// Help of collector.
- Help string
-
+ Help string `json:"help"`
// Labels for vectorized metrics.
- Labels []string
-
+ Labels []string `json:"labels"`
// Buckets for histogram metric.
- Buckets []float64
+ Buckets []float64 `json:"buckets"`
}
// Hydrate configuration.