prometheus

package
v0.0.0-...-a1d7b1b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPMetricsDownloader

type HTTPMetricsDownloader struct {
}

func (HTTPMetricsDownloader) GetEndpoint

func (downloader HTTPMetricsDownloader) GetEndpoint(config snap.Config) (string, error)

func (HTTPMetricsDownloader) GetMetricsReader

func (downloader HTTPMetricsDownloader) GetMetricsReader(url string) (io.Reader, error)

type MetricsDownloader

type MetricsDownloader interface {
	GetMetricsReader(url string) (io.Reader, error)
	GetEndpoint(config snap.Config) (string, error)
}

type PrometheusCollector

type PrometheusCollector struct {
	Downloader MetricsDownloader
}

PrometheusCollector struct

func New

func New() (*PrometheusCollector, error)

New return an instance of PrometheusCollector

func (PrometheusCollector) Collect

func (c PrometheusCollector) Collect(endpoint string) (map[string]*dto.MetricFamily, error)

func (*PrometheusCollector) CollectMetrics

func (c *PrometheusCollector) CollectMetrics(mts []snap.Metric) ([]snap.Metric, error)

CollectMetrics will be called by Snap when a task that collects one of the metrics returned from this plugins

func (*PrometheusCollector) GetMetricTypes

func (c *PrometheusCollector) GetMetricTypes(cfg snap.Config) ([]snap.Metric, error)

Jump to

Keyboard shortcuts

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