Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = &ConfigInfo{ RawContent: []byte(defaultConfig), ConfigHash: "", Config: &config.DefaultConfig, }
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 }
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
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
Click to show internal directories.
Click to hide internal directories.