Documentation
¶
Overview ¶
Package selector implements backend endpoint selection for multi-prometheus deployments
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Result ¶
type Result struct {
Selection []*url.URL
Candidates []*locator.PrometheusEndpoint
}
Result encapsulates a selection result, including the candidate endpoints considered
type Selector ¶
type Selector struct {
Strategy Strategy
// contains filtered or unexported fields
}
Selector is a puggable interface for viable prometheus endpoints
func NewSelector ¶
NewSelector returns a new Selector instance of the specified type
type Strategy ¶
type Strategy interface {
// Select chooses elligible prometheus endpoints out of the provided set, marking
// the 'Selected' flag on the chosen items, and optionally, setting the 'Error' flag
// on items that cannot be evaluated
Select(endpoints []*locator.PrometheusEndpoint) (err error)
// Name provides the (unique) name of this strategy
Name() string
// Description provides a human-readable description for this strategy
Description() string
// ComparisonMetricName gets the name of the comparison metric/calculation used to make a selection
ComparisonMetricName() string
// NextIndex returns the index of the target that should be used to field the next request
NextIndex(targets []*url.URL) int
}
Strategy is a puggable interface for strategies to select viable prometheus endpoints
Directories
¶
| Path | Synopsis |
|---|---|
|
strategy
|
|
|
minimumhistory
Package minimumhistory implements target selection for multi-prometheus deployments by selecting an instance at random with a minimum amount of history available, and with sticky-session support
|
Package minimumhistory implements target selection for multi-prometheus deployments by selecting an instance at random with a minimum amount of history available, and with sticky-session support |
|
random
Package random implements target selection for multi-prometheus deployments by selecting an instance at random with sticky-session support
|
Package random implements target selection for multi-prometheus deployments by selecting an instance at random with sticky-session support |
|
singlemostdata
Package singlemostdata implements target selection for multi-prometheus deployments by selecting a single instance with the most available data
|
Package singlemostdata implements target selection for multi-prometheus deployments by selecting a single instance with the most available data |
Click to show internal directories.
Click to hide internal directories.