collection

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2020 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const RadiusMetricPrefix = "radius_"

Variables

This section is empty.

Functions

func GetRadiusdConfig

func GetRadiusdConfig() *mconfig.RadiusdConfig

GetRadiusdConfig attempts to retrieve a RadiusdConfig from mconfig If this retrieval fails, or retrieves an invalid config, the config is set to use default values

func ParsePrometheusText

func ParsePrometheusText(prometheusText string) (map[string]*dto.MetricFamily, error)

ParsePrometheusText parses the HTTP response body from common exporters that expose prometheus metrics in a common text format. Returns metric families keyed by the metric name.

Types

type CounterMetricAggregate

type CounterMetricAggregate struct {
	// contains filtered or unexported fields
}

CounterMetricAggregate uses a Gauge underneath to avoid dealing with counter values which may occasionally decrement.

func (CounterMetricAggregate) GetCollector

func (ma CounterMetricAggregate) GetCollector() prometheus.Collector

func (*CounterMetricAggregate) Update

func (ma *CounterMetricAggregate) Update(metricFamily *dto.MetricFamily)

type CounterVecMetricAggregate

type CounterVecMetricAggregate struct {
	// contains filtered or unexported fields
}

CounterVecMetricAggregate uses a GaugeVec underneath to avoid dealing with counter values which may occasionally decrement.

func (CounterVecMetricAggregate) GetCollector

func (*CounterVecMetricAggregate) Update

func (ma *CounterVecMetricAggregate) Update(metricFamily *dto.MetricFamily)

type GaugeMetricAggregate

type GaugeMetricAggregate struct {
	// contains filtered or unexported fields
}

func (GaugeMetricAggregate) GetCollector

func (ma GaugeMetricAggregate) GetCollector() prometheus.Collector

func (*GaugeMetricAggregate) Update

func (ma *GaugeMetricAggregate) Update(metricFamily *dto.MetricFamily)

type GaugeVecMetricAggregate

type GaugeVecMetricAggregate struct {
	// contains filtered or unexported fields
}

func (GaugeVecMetricAggregate) GetCollector

func (ma GaugeVecMetricAggregate) GetCollector() prometheus.Collector

func (*GaugeVecMetricAggregate) Update

func (ma *GaugeVecMetricAggregate) Update(metricFamily *dto.MetricFamily)

type MetricAggregate

type MetricAggregate interface {
	Update(metricFamily *dto.MetricFamily)
	GetCollector() prometheus.Collector
}

func CreateMetricAggregate

func CreateMetricAggregate(metricName string, metricFamily *dto.MetricFamily) (MetricAggregate, error)

CreateMetricAggregate builds a new MetricAggregate if the metric is a prometheus Gauge, GaugeVec, Counter, or CounterVec.

type MetricAggregateRegistry

type MetricAggregateRegistry struct {
	// contains filtered or unexported fields
}

func NewMetricAggregateRegistry

func NewMetricAggregateRegistry() MetricAggregateRegistry

func (*MetricAggregateRegistry) Update

func (r *MetricAggregateRegistry) Update(metricFamilies map[string]*dto.MetricFamily)

Update reads in exported metric families from the radius server's metrics. The metrics will be mirrored in the prometheus default registry. Gauge and counter metrics are registered in the default registry, and metric values are collected and updated via this function.

NOTE: This prepends the metric names before processing them to specify that they are coming from the radius server

type MetricsRequester

type MetricsRequester struct {
	// contains filtered or unexported fields
}

func NewMetricsRequester

func NewMetricsRequester() (*MetricsRequester, error)

func (*MetricsRequester) FetchMetrics

func (r *MetricsRequester) FetchMetrics() (string, error)

FetchMetrics makes a request to the radius metrics server. The GET response body is returned, and this does not process the prometheus metrics info in any way.

func (*MetricsRequester) RefreshConfig

func (r *MetricsRequester) RefreshConfig()

RefreshConfig tries to refresh configs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL