Documentation ¶
Index ¶
- Constants
- func HealthProto(s TargetHealth) pb.Target_Health
- func LabelsByProfiles(lb *labels.Builder, c *config.ProfilingConfig) ([]labels.Labels, []map[config.SampleType]struct{})
- func ProtoLabelsFromLabels(l labels.Labels) *profilepb.LabelSet
- type Manager
- func (m *Manager) ApplyConfig(cfgs []*config.ScrapeConfig) error
- func (m *Manager) Run(tsets <-chan map[string][]*targetgroup.Group) error
- func (m *Manager) Stop()
- func (m *Manager) Targets(ctx context.Context, req *pb.TargetsRequest) (*pb.TargetsResponse, error)
- func (m *Manager) TargetsActive() map[string][]*Target
- func (m *Manager) TargetsAll() map[string][]*Target
- func (m *Manager) TargetsDropped() map[string][]*Target
- type Target
- func (t *Target) Clone() *Target
- func (t *Target) DiscoveredLabels() labels.Labels
- func (t *Target) Health() TargetHealth
- func (t *Target) KeepSet() map[config.SampleType]struct{}
- func (t *Target) Labels() labels.Labels
- func (t *Target) LabelsRange(f func(l labels.Label))
- func (t *Target) LastError() error
- func (t *Target) LastScrape() time.Time
- func (t *Target) LastScrapeDuration() time.Duration
- func (t *Target) Params() url.Values
- func (t *Target) SetDiscoveredLabels(l labels.Labels)
- func (t *Target) String() string
- func (t *Target) URL() *url.URL
- type TargetHealth
- type Targets
Constants ¶
const ( ProfilePath = "__profile_path__" ProfileName = "__name__" ProfileTraceType = "trace" )
Variables ¶
This section is empty.
Functions ¶
func HealthProto ¶
func HealthProto(s TargetHealth) pb.Target_Health
HealthProto converts a target health string into a Target_Health proto.
func LabelsByProfiles ¶
func LabelsByProfiles(lb *labels.Builder, c *config.ProfilingConfig) ([]labels.Labels, []map[config.SampleType]struct{})
LabelsByProfiles returns the labels for a given ProfilingConfig.
Types ¶
type Manager ¶
type Manager struct { scrapepb.UnimplementedScrapeServiceServer // contains filtered or unexported fields }
Manager maintains a set of scrape pools and manages start/stop cycles when receiving new target groups form the discovery manager.
func NewManager ¶
func NewManager( logger log.Logger, reg prometheus.Registerer, store profilepb.ProfileStoreServiceServer, scrapeConfigs []*config.ScrapeConfig, externalLabels labels.Labels, ) *Manager
NewManager is the Manager constructor.
func (*Manager) ApplyConfig ¶
func (m *Manager) ApplyConfig(cfgs []*config.ScrapeConfig) error
ApplyConfig resets the manager's target providers and job configurations as defined by the new cfg.
func (*Manager) Run ¶
func (m *Manager) Run(tsets <-chan map[string][]*targetgroup.Group) error
Run starts the manager with a set of scrape configs.
func (*Manager) Stop ¶
func (m *Manager) Stop()
Stop cancels all running scrape pools and blocks until all have exited.
func (*Manager) Targets ¶
func (m *Manager) Targets(ctx context.Context, req *pb.TargetsRequest) (*pb.TargetsResponse, error)
Targets implements the Targets RCP.
func (*Manager) TargetsActive ¶
TargetsActive returns the active targets currently being scraped.
func (*Manager) TargetsAll ¶
TargetsAll returns active and dropped targets grouped by job_name.
func (*Manager) TargetsDropped ¶
TargetsDropped returns the dropped targets during relabelling.
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, keepSet map[config.SampleType]struct{}) *Target
NewTarget creates a reasonably configured target for querying.
func (*Target) DiscoveredLabels ¶
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) KeepSet ¶ added in v0.19.0
func (t *Target) KeepSet() map[config.SampleType]struct{}
KeepSet returns a copy of the set of all keep labels of the target.
func (*Target) LabelsRange ¶ added in v0.18.0
LabelsRange calls f on each public label of the target.
func (*Target) LastScrape ¶
LastScrape returns the time of the last scrape.
func (*Target) LastScrapeDuration ¶
LastScrapeDuration returns how long the last scrape of the target took.
func (*Target) SetDiscoveredLabels ¶
SetDiscoveredLabels sets new DiscoveredLabels.
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.