prometheus

package
v0.0.0-...-5871578 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() plugin.Collector

New return an instance of PrometheusCollector

Types

type HTTPMetricsDownloader

type HTTPMetricsDownloader struct {
}

func (HTTPMetricsDownloader) GetEndpoint

func (downloader HTTPMetricsDownloader) GetEndpoint(config plugin.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 plugin.Config) (string, error)
}

type PrometheusCollector

type PrometheusCollector struct {
	Downloader MetricsDownloader
}

PrometheusCollector struct

func (PrometheusCollector) Collect

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

func (*PrometheusCollector) CollectMetrics

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

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

func (*PrometheusCollector) GetConfigPolicy

func (c *PrometheusCollector) GetConfigPolicy() (plugin.ConfigPolicy, error)

GetConfigPolicy returns a ConfigPolicyTree for testing

func (*PrometheusCollector) GetMetricTypes

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

Jump to

Keyboard shortcuts

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