Documentation ¶
Index ¶
- Variables
- type Client
- type ConfigInfo
- type ConfigManager
- func (c *ConfigManager) AddReloadCallbacks(f ...func(c *ConfigInfo) error)
- func (c *ConfigManager) ConfigInfo() *ConfigInfo
- func (c *ConfigManager) ReloadFromFile(file string) error
- func (c *ConfigManager) ReloadFromRaw(data []byte) (err error)
- func (c *ConfigManager) UpdateExtraConfig(cfg ExtraConfig) error
- type ExtraConfig
- type RuntimeInfo
- type TSDBInfo
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = &ConfigInfo{ RawContent: []byte(defaultConfig), ConfigHash: "", Config: &config.DefaultConfig, ExtraConfig: &ExtraConfig{}, }
DefaultConfig init a ConfigInfo with default prometheus config
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client to do prometheus API request
func (*Client) ConfigReload ¶
ConfigReload do Config reloading
type ConfigInfo ¶ added in v0.0.5
type ConfigInfo struct { // RawContent is the content of config file RawContent []byte // ConfigHash is a md5 of config file content ConfigHash string // Config is the marshaled prometheus config Config *config.Config // ExtraConfig contains Config not in origin Prometheus define ExtraConfig *ExtraConfig }
ConfigInfo include all information of current config
type ConfigManager ¶ added in v0.0.5
type ConfigManager struct {
// contains filtered or unexported fields
}
ConfigManager do config manager
func NewConfigManager ¶ added in v0.0.5
func NewConfigManager() *ConfigManager
NewConfigManager return an config manager
func (*ConfigManager) AddReloadCallbacks ¶ added in v0.0.5
func (c *ConfigManager) AddReloadCallbacks(f ...func(c *ConfigInfo) error)
AddReloadCallbacks add callbacks of config reload event
func (*ConfigManager) ConfigInfo ¶ added in v0.0.5
func (c *ConfigManager) ConfigInfo() *ConfigInfo
ConfigInfo return current config info
func (*ConfigManager) ReloadFromFile ¶ added in v0.1.5
func (c *ConfigManager) ReloadFromFile(file string) error
ReloadFromFile reload config from file and do all callbacks
func (*ConfigManager) ReloadFromRaw ¶ added in v0.1.5
func (c *ConfigManager) ReloadFromRaw(data []byte) (err error)
ReloadFromRaw reload config from raw data
func (*ConfigManager) UpdateExtraConfig ¶ added in v0.3.0
func (c *ConfigManager) UpdateExtraConfig(cfg ExtraConfig) error
UpdateExtraConfig set new extra config
type ExtraConfig ¶ added in v0.3.0
type ExtraConfig struct { // StopScrapeReason ,if not empty, all scrape will failed StopScrapeReason string `json:"stopScrapeReason"` }
ExtraConfig is config about kvass it self , not Prometheus config
func (*ExtraConfig) EQ ¶ added in v0.3.0
func (c *ExtraConfig) EQ(e *ExtraConfig) bool
EQ return true if all ExtraConfig fields is eq
type RuntimeInfo ¶
type RuntimeInfo struct { // TimeSeriesCount is the series the prometheus head check handled TimeSeriesCount int64 `json:"timeSeriesCount"` }
RuntimeInfo include some filed the prometheus API /api/v1/runtimeinfo returned
type TSDBInfo ¶ added in v0.1.4
type TSDBInfo struct { // HeadStats include information of current head block HeadStats struct { // NumSeries is current series in head block (in memory) NumSeries int64 `json:"numSeries"` } `json:"headStats"` }
TSDBInfo include some filed the prometheus API /api/v1/status/tsdb returned