scrape

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProfilePath      = "__profile_path__"
	ProfileName      = "__name__"
	ProfileTraceType = "trace"
)

Variables

This section is empty.

Functions

func LabelsByProfiles

func LabelsByProfiles(lset labels.Labels, c *config.ProfilingConfig) []labels.Labels

LabelsByProfiles returns the labels for a given ProfilingConfig.

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, discoveredLabels labels.Labels, params url.Values) *Target

NewTarget creates a reasonably configured target for querying.

func (*Target) Clone

func (t *Target) Clone() *Target

Clone returns a clone of the target.

func (*Target) DiscoveredLabels

func (t *Target) DiscoveredLabels() labels.Labels

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

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() labels.Labels

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) LastScrapeDuration

func (t *Target) LastScrapeDuration() time.Duration

LastScrapeDuration returns how long the last scrape of the target took.

func (*Target) Params

func (t *Target) Params() url.Values

Params returns a copy of the set of all public params of the target.

func (*Target) SetDiscoveredLabels

func (t *Target) SetDiscoveredLabels(l labels.Labels)

SetDiscoveredLabels sets new DiscoveredLabels.

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 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