client

package
v0.0.0-...-2371dfd Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlertmanagerConfigFromConfig

func AlertmanagerConfigFromConfig(c configs.Config) (*config.Config, error)

AlertmanagerConfigFromConfig returns the Alertmanager config from the Cortex configuration.

func RulesFromConfig

func RulesFromConfig(c configs.Config) ([]rules.Rule, error)

RulesFromConfig gets the rules from the Cortex configuration.

Strongly inspired by `loadGroups` in Prometheus.

Types

type AlertManagerConfigsAPI

type AlertManagerConfigsAPI struct {
	URL     *url.URL
	Timeout time.Duration
}

AlertManagerConfigsAPI allows retrieving alert configs.

func (*AlertManagerConfigsAPI) GetConfigs

func (c *AlertManagerConfigsAPI) GetConfigs(since configs.ID) (*ConfigsResponse, error)

GetConfigs returns all Cortex configurations from a configs API server that have been updated after the given configs.ID was last updated.

type ConfigsResponse

type ConfigsResponse struct {
	// Configs maps user ID to their latest configs.View.
	Configs map[string]configs.View `json:"configs"`
}

ConfigsResponse is a response from server for GetConfigs.

func (ConfigsResponse) GetLatestConfigID

func (c ConfigsResponse) GetLatestConfigID() configs.ID

GetLatestConfigID returns the last config ID from a set of configs.

type RulesAPI

type RulesAPI struct {
	URL     *url.URL
	Timeout time.Duration
}

RulesAPI allows retrieving recording and alerting rules.

func (*RulesAPI) GetConfigs

func (c *RulesAPI) GetConfigs(since configs.ID) (*ConfigsResponse, error)

GetConfigs returns all Cortex configurations from a configs API server that have been updated after the given configs.ID was last updated.

Jump to

Keyboard shortcuts

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