exporter

package
v5.2.0-beta1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: LGPL-3.0, Apache-2.0 Imports: 19 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigLoads = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "statsd_exporter_config_reloads_total",
			Help: "The number of configuration reloads.",
		},
		[]string{"outcome"},
	)
)

Functions

func MetryInit

func MetryInit(registry *prometheus.Registry)

MetryInit init

Types

type CounterContainer

type CounterContainer struct {
	Elements map[uint64]prometheus.Counter
	Register prometheus.Registerer
}

func NewCounterContainer

func NewCounterContainer(Register prometheus.Registerer) *CounterContainer

func (*CounterContainer) Get

func (c *CounterContainer) Get(metricName string, labels prometheus.Labels, help string) (prometheus.Counter, error)

type CounterEvent

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

func (*CounterEvent) Labels

func (c *CounterEvent) Labels() map[string]string

func (*CounterEvent) MetricName

func (c *CounterEvent) MetricName() string

func (*CounterEvent) Value

func (c *CounterEvent) Value() float64

type Event

type Event interface {
	MetricName() string
	Value() float64
	Labels() map[string]string
}

type Events

type Events []Event

type Exporter

type Exporter struct {
	Counters   *CounterContainer
	Gauges     *GaugeContainer
	Summaries  *SummaryContainer
	Histograms *HistogramContainer
	// contains filtered or unexported fields
}

func NewExporter

func NewExporter(mapper *MetricMapper, Register prometheus.Registerer) *Exporter

NewExporter new exporter

func (*Exporter) GCollector

func (b *Exporter) GCollector()

GCollector 循环检查Exporter对象中的性能指标数据是否有过期,有则清除

func (*Exporter) Listen

func (b *Exporter) Listen(e <-chan Events)

type GaugeContainer

type GaugeContainer struct {
	Elements map[uint64]prometheus.Gauge
	Register prometheus.Registerer
}

func NewGaugeContainer

func NewGaugeContainer(Register prometheus.Registerer) *GaugeContainer

func (*GaugeContainer) Get

func (c *GaugeContainer) Get(metricName string, labels prometheus.Labels, help string) (prometheus.Gauge, error)

type GaugeEvent

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

func (*GaugeEvent) Labels

func (c *GaugeEvent) Labels() map[string]string

func (*GaugeEvent) MetricName

func (g *GaugeEvent) MetricName() string

func (*GaugeEvent) Value

func (g *GaugeEvent) Value() float64

type HistogramContainer

type HistogramContainer struct {
	Elements map[uint64]prometheus.Histogram

	Register prometheus.Registerer
	// contains filtered or unexported fields
}

func NewHistogramContainer

func NewHistogramContainer(mapper *MetricMapper, Register prometheus.Registerer) *HistogramContainer

func (*HistogramContainer) Get

func (c *HistogramContainer) Get(metricName string, labels prometheus.Labels, help string, mapping *metricMapping) (prometheus.Histogram, error)

type MetricMapper

type MetricMapper struct {
	Defaults mapperConfigDefaults `yaml:"defaults"`
	Mappings []metricMapping      `yaml:"mappings"`
	// contains filtered or unexported fields
}

MetricMapper MetricMapper

func InitMapping

func InitMapping() (*MetricMapper, error)

InitMapping init mapping config

func (*MetricMapper) InitFromFile

func (m *MetricMapper) InitFromFile(fileName string) error

InitFromFile InitFromFile

func (*MetricMapper) InitFromYAMLString

func (m *MetricMapper) InitFromYAMLString(fileContents string) error

InitFromYAMLString InitFromYAMLString

type StatsDTCPListener

type StatsDTCPListener struct {
	Conn *net.TCPListener
}

func (*StatsDTCPListener) Listen

func (l *StatsDTCPListener) Listen(e chan<- Events)

type StatsDUDPListener

type StatsDUDPListener struct {
	Conn *net.UDPConn
}

func (*StatsDUDPListener) Listen

func (l *StatsDUDPListener) Listen(e chan<- Events)

type SummaryContainer

type SummaryContainer struct {
	Elements map[uint64]prometheus.Summary
	Register prometheus.Registerer
}

func NewSummaryContainer

func NewSummaryContainer(Register prometheus.Registerer) *SummaryContainer

func (*SummaryContainer) Get

func (c *SummaryContainer) Get(metricName string, labels prometheus.Labels, help string) (prometheus.Summary, error)

type TimerEvent

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

func (*TimerEvent) Labels

func (c *TimerEvent) Labels() map[string]string

func (*TimerEvent) MetricName

func (t *TimerEvent) MetricName() string

func (*TimerEvent) Value

func (t *TimerEvent) Value() float64

Jump to

Keyboard shortcuts

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