retrieval

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2016 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient added in v1.1.1

func NewHTTPClient(cfg config.HTTPClientConfig) (*http.Client, error)

NewHTTPClient returns a new HTTP client configured for the given scrape configuration.

Types

type Target

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

Target refers to a singular HTTP or HTTPS endpoint.

func NewTarget

func NewTarget(labels, metaLabels model.LabelSet, params url.Values) *Target

NewTarget creates a reasonably configured target for querying.

func (*Target) Health

func (t *Target) Health() TargetHealth

Health returns the last known health state of the target.

func (*Target) Labels

func (t *Target) Labels() model.LabelSet

Labels returns a copy of the set of all public labels of the target.

func (*Target) LastError

func (t *Target) LastError() error

LastError returns the error encountered during the last scrape.

func (*Target) LastScrape

func (t *Target) LastScrape() time.Time

LastScrape returns the time of the last scrape.

func (*Target) MetaLabels

func (t *Target) MetaLabels() model.LabelSet

MetaLabels returns a copy of the target's labels before any processing.

func (*Target) String

func (t *Target) String() string

func (*Target) URL

func (t *Target) URL() *url.URL

URL returns a copy of the target's URL.

type TargetHealth

type TargetHealth string

TargetHealth describes the health state of a target.

const (
	HealthUnknown TargetHealth = "unknown"
	HealthGood    TargetHealth = "up"
	HealthBad     TargetHealth = "down"
)

The possible health states of a target based on the last performed scrape.

type TargetManager

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

TargetManager maintains a set of targets, starts and stops their scraping and creates the new targets based on the target groups it receives from various target providers.

func NewTargetManager

func NewTargetManager(app storage.SampleAppender) *TargetManager

NewTargetManager creates a new TargetManager.

func (*TargetManager) ApplyConfig

func (tm *TargetManager) ApplyConfig(cfg *config.Config) error

ApplyConfig resets the manager's target providers and job configurations as defined by the new cfg. The state of targets that are valid in the new configuration remains unchanged.

func (*TargetManager) Pools

func (tm *TargetManager) Pools() map[string]Targets

Pools returns the targets currently being scraped bucketed by their job name.

func (*TargetManager) Run

func (tm *TargetManager) Run()

Run starts background processing to handle target updates.

func (*TargetManager) Stop

func (tm *TargetManager) Stop()

Stop all background processing.

type Targets

type Targets []*Target

Targets is a sortable list of targets.

func (Targets) Len

func (ts Targets) Len() int

func (Targets) Less

func (ts Targets) Less(i, j int) bool

func (Targets) Swap

func (ts Targets) Swap(i, j int)

Jump to

Keyboard shortcuts

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