Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InjectConfigOptions ¶
type InjectConfigOptions struct { // ProxyURL will be injected to all job if it is not empty ProxyURL string // PrometheusURL will be injected PrometheusURL string }
InjectConfigOptions indicate what to inject to config file
type Injector ¶
Injector gen injected config file
func NewInjector ¶
func NewInjector(outFile string, option InjectConfigOptions, log logrus.FieldLogger) *Injector
NewInjector create new injector with InjectConfigOptions
func (*Injector) ApplyConfig ¶ added in v0.0.5
func (i *Injector) ApplyConfig(cfg *prom.ConfigInfo) error
ApplyConfig gen new config
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is a Proxy server for prometheus tManager Proxy will return an empty metrics if this target if not allowed to scrape for this prometheus client otherwise, Proxy do real tManager, statistic metrics samples and return metrics to prometheus
type Service ¶ added in v0.0.3
type Service struct {
// contains filtered or unexported fields
}
Service is the api server of shard
func NewService ¶ added in v0.0.3
func NewService( promURL string, getPromRuntimeInfo func() (*prom.RuntimeInfo, error), cfgManager *prom.ConfigManager, targetManager *TargetsManager, lg logrus.FieldLogger) *Service
NewService create new api server of shard
type TargetsInfo ¶ added in v0.0.5
type TargetsInfo struct { // Targets is all targets this shard scraping Targets map[string][]*target.Target // IdleAt is the time this shard has no scraping targets // IdleAt is nil if at lease one target is scraping IdleAt *time.Time // Status is the runtime status of all targets Status map[uint64]*target.ScrapeStatus `json:"-"` }
TargetsInfo contains all current targets
type TargetsManager ¶ added in v0.0.5
type TargetsManager struct {
// contains filtered or unexported fields
}
TargetsManager manager local targets of this shard
func NewTargetsManager ¶ added in v0.0.5
func NewTargetsManager(storeDir string, log logrus.FieldLogger) *TargetsManager
NewTargetsManager return a new target manager
func (*TargetsManager) AddUpdateCallbacks ¶ added in v0.0.5
func (t *TargetsManager) AddUpdateCallbacks(f ...func(targets map[string][]*target.Target) error)
AddUpdateCallbacks add a call back for targets updating event
func (*TargetsManager) Load ¶ added in v0.0.5
func (t *TargetsManager) Load() error
Load load local targets information from storeDir
func (*TargetsManager) TargetsInfo ¶ added in v0.0.5
func (t *TargetsManager) TargetsInfo() TargetsInfo
TargetsInfo return current targets of this shard
func (*TargetsManager) UpdateTargets ¶ added in v0.0.5
func (t *TargetsManager) UpdateTargets(req *shard.UpdateTargetsRequest) error
UpdateTargets update local targets