prom

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 NewClient

func NewClient(url string) *Client

NewClient return an cli with url

func (*Client) ConfigReload

func (c *Client) ConfigReload() error

ConfigReload do Config reloading

func (*Client) RuntimeInfo

func (c *Client) RuntimeInfo() (*RuntimeInfo, error)

RuntimeInfo return the current status of this shard, only return tManager targets if scrapingOnly is true, otherwise ,all target this cli discovered will be returned

func (*Client) Targets

func (c *Client) Targets(state string) (*v1.TargetDiscovery, error)

Targets is compatible with prometheusURL /api/v1/targets the origin prometheusURL's Config is injected, so the targets it report must be adjusted by cli sidecar

type ConfigInfo added in v0.0.5

type ConfigInfo struct {
	// RawContent is the content of config file
	RawContent []byte
	// Md5 is a md5 of config file content
	Md5 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(file string, log logrus.FieldLogger) *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) Reload added in v0.0.5

func (c *ConfigManager) Reload() error

Reload reload config from file and do all callbacks

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL