2020-12-22 18:24:23 +01:00
|
|
|
package metric
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
)
|
|
|
|
|
2020-12-27 14:58:21 +01:00
|
|
|
// PrometheusResult struct
|
2020-12-22 18:24:23 +01:00
|
|
|
type PrometheusResult struct {
|
|
|
|
PromDesc *prometheus.Desc
|
|
|
|
PromValueType prometheus.ValueType
|
|
|
|
Value float64
|
|
|
|
LabelValues []string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Metric struct
|
|
|
|
type Metric struct {
|
2020-12-29 14:10:47 +01:00
|
|
|
HueType string `json:"type"`
|
|
|
|
ResultKey string `json:"resultKey"`
|
|
|
|
FqName string `json:"fqName"`
|
|
|
|
Help string `json:"help"`
|
|
|
|
Labels []string `json:"labels"`
|
|
|
|
|
2020-12-27 14:58:21 +01:00
|
|
|
MetricResult []map[string]interface{}
|
2020-12-22 18:24:23 +01:00
|
|
|
|
|
|
|
PromType prometheus.ValueType
|
|
|
|
PromDesc *prometheus.Desc
|
|
|
|
PromResult []*PrometheusResult
|
|
|
|
}
|
2020-12-29 14:10:47 +01:00
|
|
|
|
|
|
|
// MetricsFile struct
|
|
|
|
type MetricsFile struct {
|
|
|
|
Metrics []*Metric `json:"metrics"`
|
|
|
|
}
|