Documentation ¶
Index ¶
- type SDTargets
- type TargetsDiscovery
- func (m *TargetsDiscovery) ActiveTargets() map[string][]*SDTargets
- func (m *TargetsDiscovery) ActiveTargetsChan() <-chan map[string][]*SDTargets
- func (m *TargetsDiscovery) ApplyConfig(cfg *config.Config) error
- func (m *TargetsDiscovery) DropTargets() map[string][]*SDTargets
- func (m *TargetsDiscovery) Run(ctx context.Context, sdChan <-chan map[string][]*targetgroup.Group) error
- func (m *TargetsDiscovery) WaitInit(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SDTargets ¶
type SDTargets struct { // ShardTarget is the target for shard sidecar to generate prometheus config ShardTarget *target.Target // PromTarget is the target of prometheus lib PromTarget *scrape.Target }
SDTargets represent a target has be processed with job relabel_configs every SDTargets contains a target use for shard sidecar to generate prometheus config and a prometheus scrape target for api /api/v1/targets
type TargetsDiscovery ¶
type TargetsDiscovery struct {
// contains filtered or unexported fields
}
TargetsDiscovery manager the active targets and dropped targets use SD manager from prometheus lib it will maintains shard.Target and scrape.Target together
func (*TargetsDiscovery) ActiveTargets ¶
func (m *TargetsDiscovery) ActiveTargets() map[string][]*SDTargets
ActiveTargets return a copy map of global active targets the
func (*TargetsDiscovery) ActiveTargetsChan ¶
func (m *TargetsDiscovery) ActiveTargetsChan() <-chan map[string][]*SDTargets
ActiveTargetsChan return an channel for notify active SDTargets updated
func (*TargetsDiscovery) ApplyConfig ¶
func (m *TargetsDiscovery) ApplyConfig(cfg *config.Config) error
ApplyConfig save new scrape config
func (*TargetsDiscovery) DropTargets ¶
func (m *TargetsDiscovery) DropTargets() map[string][]*SDTargets
DropTargets return a copy map of global dropped targets the
func (*TargetsDiscovery) Run ¶
func (m *TargetsDiscovery) Run(ctx context.Context, sdChan <-chan map[string][]*targetgroup.Group) error
Run receive prometheus service discovery result and update global active SDTargets and dropped SDTargets the active SDTargets of one process will be send to activeTargetsChan