Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MaxUpdateFrequency = 5 * time.Second
MaxUpdateFrequency is the minimum time to wait between updating targets. Prometheus uses a static threshold. Do not recommend changing this, except for tests.
Functions ¶
func NewFromConvertibleConfig ¶ added in v1.2.0
func NewFromConvertibleConfig[T ConvertibleConfig](opts component.Options, conf T) (component.Component, error)
NewFromConvertibleConfig creates a discovery component given a ConvertibleConfig. Convenience function for New.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component is a reusable component for any discovery implementation. it will handle dynamic updates and exporting targets appropriately for a scrape implementation.
func New ¶
New creates a discovery component given arguments and a concrete Discovery implementation function.
type ConvertibleConfig ¶ added in v1.2.0
type ConvertibleConfig interface { // Convert converts the struct into a DiscovererConfig. Convert() DiscovererConfig }
ConvertibleConfig is used to more conveniently convert a configuration struct into a DiscovererConfig.
type Creator ¶
type Creator func(component.Arguments) (DiscovererConfig, error)
Creator is a function provided by an implementation to create a concrete DiscovererConfig instance.
type DiscovererConfig ¶ added in v1.2.0
DiscovererConfig is an alias for Prometheus' DiscovererConfig interface, so users of this package don't need to import github.com/prometheus/prometheus/discover as well.
type DiscovererWithMetrics ¶ added in v1.2.0
type DiscovererWithMetrics interface { promdiscovery.Discoverer promdiscovery.DiscovererMetrics }
func NewDiscovererWithMetrics ¶ added in v1.2.0
func NewDiscovererWithMetrics(cfg promdiscovery.Config, reg prometheus.Registerer, logger log.Logger) (DiscovererWithMetrics, error)
type DistributedTargets ¶
type DistributedTargets struct {
// contains filtered or unexported fields
}
DistributedTargets uses the node's Lookup method to distribute discovery targets when a component runs in a cluster.
func NewDistributedTargets ¶
func NewDistributedTargets(clusteringEnabled bool, cluster cluster.Cluster, allTargets []Target) *DistributedTargets
NewDistributedTargets creates the abstraction that allows components to dynamically shard targets between components.
func NewDistributedTargetsWithCustomLabels ¶ added in v1.4.2
func NewDistributedTargetsWithCustomLabels(clusteringEnabled bool, cluster cluster.Cluster, allTargets []Target, labels []string) *DistributedTargets
NewDistributedTargetsWithCustomLabels creates the abstraction that allows components to dynamically shard targets between components. Passing in labels will limit the sharding to only use those labels for computing the hash key. Passing in nil or empty array means look at all labels.
func (*DistributedTargets) LocalTargets ¶ added in v1.2.0
func (dt *DistributedTargets) LocalTargets() []Target
LocalTargets returns the targets that belong to the local cluster node.
func (*DistributedTargets) MovedToRemoteInstance ¶ added in v1.2.0
func (dt *DistributedTargets) MovedToRemoteInstance(prev *DistributedTargets) []Target
MovedToRemoteInstance returns the set of local targets from prev that are no longer local in dt, indicating an active target has moved. Only targets which exist in both prev and dt are returned. If prev contains an empty list of targets, no targets are returned.
func (*DistributedTargets) TargetCount ¶ added in v1.4.2
func (dt *DistributedTargets) TargetCount() int
type Exports ¶
type Exports struct {
Targets []Target `alloy:"targets,attr"`
}
Exports holds values which are exported by all discovery components.
Directories ¶
Path | Synopsis |
---|---|
Package docker implements the discovery.docker component.
|
Package docker implements the discovery.docker component. |
Package gce implements the discovery.gce component.
|
Package gce implements the discovery.gce component. |
Package kubelet implements a discovery.kubelet component.
|
Package kubelet implements a discovery.kubelet component. |
Package kubernetes implements a discovery.kubernetes component.
|
Package kubernetes implements a discovery.kubernetes component. |