Documentation ¶
Index ¶
- func CollectGaugeMap(gaugeMap GaugeMap, ch chan<- prometheus.Metric)
- func CollectGaugeMapMap(gaugeMapMap GaugeMapMap, ch chan<- prometheus.Metric)
- func CollectGaugeVecMapMap(gaugeVecMapMap GaugeVecMapMap, ch chan<- prometheus.Metric)
- func CollectGaugeVecs(name string, value interface{}, vecMapMap GaugeVecMapMap, namespace string, ...)
- func ConvertToFloat(unk interface{}) (float64, error)
- func DescribeGaugeMap(gaugeMap GaugeMap, ch chan<- *prometheus.Desc)
- func DescribeGaugeMapMap(gaugeMapMap GaugeMapMap, ch chan<- *prometheus.Desc)
- func DescribeGaugeVecMapMap(gaugeVecMapMap GaugeVecMapMap, ch chan<- *prometheus.Desc)
- func MakeStructMeta(strct interface{}, meta *StructMeta)
- func NewGauge(namespace string, metricName string, help string, ...) prometheus.Gauge
- func NewGaugeVec(namespace string, metricName string, help string, ...) prometheus.GaugeVec
- func SetValuesOnGaugeVecs(meta StructMeta, namespace string, gaugeVecMap GaugeVecMap, ...)
- func SetValuesOnGauges(meta StructMeta, namespace string, gaugeMap GaugeMap)
- type GaugeMap
- type GaugeMapMap
- type GaugeVecMap
- type GaugeVecMapMap
- type StructFieldMap
- type StructMeta
- type TagValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectGaugeMap ¶
func CollectGaugeMap(gaugeMap GaugeMap, ch chan<- prometheus.Metric)
func CollectGaugeMapMap ¶
func CollectGaugeMapMap(gaugeMapMap GaugeMapMap, ch chan<- prometheus.Metric)
func CollectGaugeVecMapMap ¶
func CollectGaugeVecMapMap(gaugeVecMapMap GaugeVecMapMap, ch chan<- prometheus.Metric)
func CollectGaugeVecs ¶
func CollectGaugeVecs(name string, value interface{}, vecMapMap GaugeVecMapMap, namespace string, constLabels prometheus.Labels, labelNames []string, labelValues prometheus.Labels)
func ConvertToFloat ¶
A smarter version of the function for conversion of interface to float than Type.ConvertibleTo()
func DescribeGaugeMap ¶
func DescribeGaugeMap(gaugeMap GaugeMap, ch chan<- *prometheus.Desc)
func DescribeGaugeMapMap ¶
func DescribeGaugeMapMap(gaugeMapMap GaugeMapMap, ch chan<- *prometheus.Desc)
func DescribeGaugeVecMapMap ¶
func DescribeGaugeVecMapMap(gaugeVecMapMap GaugeVecMapMap, ch chan<- *prometheus.Desc)
func MakeStructMeta ¶
func MakeStructMeta(strct interface{}, meta *StructMeta)
Recursively follow a nested tree of struct and add the names of the fields to the names map. If the field value is a map, use the keys from that as the names. If there is a name conflict then we use the last one found and throw a warning message.
Check the test for an example.
func NewGauge ¶
func NewGauge(namespace string, metricName string, help string, constLabels prometheus.Labels) prometheus.Gauge
func NewGaugeVec ¶
func NewGaugeVec(namespace string, metricName string, help string, constLabels prometheus.Labels, labels []string) prometheus.GaugeVec
func SetValuesOnGaugeVecs ¶
func SetValuesOnGaugeVecs(meta StructMeta, namespace string, gaugeVecMap GaugeVecMap, labels prometheus.Labels)
func SetValuesOnGauges ¶
func SetValuesOnGauges(meta StructMeta, namespace string, gaugeMap GaugeMap)
Types ¶
type GaugeMap ¶
type GaugeMap map[string]prometheus.Gauge
func NewGaugeMap ¶
func NewGaugeMap(meta StructMeta, namespace string, constLabels prometheus.Labels) GaugeMap
Builds a map of Gauges, the names are built out of the struct property names. Looking first to see if there is a json tag name and if not, grab an actual name.
type GaugeMapMap ¶
I must be insane.
func NewGaugeMapMap ¶
func NewGaugeMapMap(faces map[string]interface{}, namespace string, constLabels prometheus.Labels) GaugeMapMap
Prometheus won't start up if there are no Gauges defined, so provide a helper to build the MapMap.
type GaugeVecMap ¶
type GaugeVecMap map[string]prometheus.GaugeVec
func NewGaugeVecMap ¶
func NewGaugeVecMap(meta StructMeta, namespace string, labels []string, constLabels prometheus.Labels) GaugeVecMap
Builds a map of Gauges, the names are built out of the struct property names. Looking first to see if there is a json tag name and if not, grab an actual name.
type GaugeVecMapMap ¶
type GaugeVecMapMap map[string]GaugeVecMap
type StructFieldMap ¶
type StructFieldMap map[string]interface{}
Key: FieldName Value: FieldValue
type PoolData struct { User User `json:"user"` Workers Workers `json:"workers"` Pool Pool `json:"pool"` Network Network `json:"network"` Market Market `json:"market"` }
map["User"] = User map["Workers"] = Workers ...
func NewStructFieldMap ¶
func NewStructFieldMap(strct interface{}) StructFieldMap
See documentation for StructFieldMap