prometheus

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const ScrapePrometheusKind = "scrapePrometheus"

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Field     string                 // Prometheus metric name
	Tags      map[string]string      // key is tag name; val is tag value
	TypeVal   map[string]interface{} // key is metric type; val is metric value
	Timestamp time.Time
	Type      string // Prometheus metric type
}

Metric stores the fields that we need to construct Table

type PrometheusIterator

type PrometheusIterator struct {
	NowFn func() time.Time // Convert times
	// contains filtered or unexported fields
}

func (*PrometheusIterator) Close

func (p *PrometheusIterator) Close() error

func (*PrometheusIterator) Connect

func (p *PrometheusIterator) Connect(ctx context.Context) error

This implementation of Connect takes in a user defined url, validates the url and gets an http response. It then calls parse to parse the body into a list Metrics or returns and error if not given a valid prometheus metric endpoint.

func (*PrometheusIterator) Decode

func (p *PrometheusIterator) Decode(ctx context.Context) (table flux.Table, err error)

This implementation of Decode will create flux Tables for a give Metric. It retrieves one Metric from p.metrics and places it into a flux.Table

func (*PrometheusIterator) Fetch

func (p *PrometheusIterator) Fetch(ctx context.Context) (bool, error)

This implementation of Fetch will iterate over p.metrics

type ScrapePrometheusOpSpec

type ScrapePrometheusOpSpec struct {
	URL string `json:"token,omitempty"`
}

func (*ScrapePrometheusOpSpec) Kind

type ScrapePrometheusProcedureSpec

type ScrapePrometheusProcedureSpec struct {
	plan.DefaultCost
	URL string
}

func (*ScrapePrometheusProcedureSpec) Copy

func (*ScrapePrometheusProcedureSpec) Kind

Jump to

Keyboard shortcuts

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