client

package
v0.0.0-...-90d47c1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: Apache-2.0 Imports: 12 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"`
	// contains filtered or unexported fields
}

ConfigsResponse is a response from server for GetConfigs.

func GetConfigs

func GetConfigs(endpoint string, timeout time.Duration, since configs.ID) (*ConfigsResponse, error)

GetConfigs gets configurations from the configs server.

func (ConfigsResponse) GetLatestConfigID

func (c ConfigsResponse) GetLatestConfigID() configs.ID

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

Jump to

Keyboard shortcuts

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