e2ecortex

package
v1.3.0-rc.1.0...-65594da Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func FormatTime

func FormatTime(t time.Time) string

FormatTime converts a time to a string acceptable by the Prometheus API.

func GetDefaultImage

func GetDefaultImage() string

GetDefaultImage returns the Docker image to use to run Cortex.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client used to interact with Cortex in integration tests

func NewClient

func NewClient(
	distributorAddress string,
	querierAddress string,
	alertmanagerAddress string,
	rulerAddress string,
	orgID string,
) (*Client, error)

NewClient makes a new Cortex client

func (*Client) DeleteAlertmanagerConfig

func (c *Client) DeleteAlertmanagerConfig(ctx context.Context) error

DeleteAlertmanagerConfig gets the status of an alertmanager instance

func (*Client) DeleteRuleGroup

func (c *Client) DeleteRuleGroup(namespace string, groupName string) error

DeleteRuleGroup gets the status of an alertmanager instance

func (*Client) DeleteRuleNamespace

func (c *Client) DeleteRuleNamespace(namespace string) error

DeleteRuleNamespace deletes all the rule groups (and the namespace itself).

func (*Client) GetAlertmanagerConfig

func (c *Client) GetAlertmanagerConfig(ctx context.Context) (*alertConfig.Config, error)

GetAlertmanagerConfig gets the status of an alertmanager instance

func (*Client) GetRuleGroups

func (c *Client) GetRuleGroups() (map[string][]rulefmt.RuleGroup, error)

GetRuleGroups gets the status of an alertmanager instance

func (*Client) LabelNames

func (c *Client) LabelNames() ([]string, error)

LabelNames gets label names

func (*Client) LabelValues

func (c *Client) LabelValues(label string) (model.LabelValues, error)

LabelValues gets label values

func (*Client) PostRequest

func (c *Client) PostRequest(url string, body io.Reader) (*http.Response, error)

func (*Client) Push

func (c *Client) Push(timeseries []prompb.TimeSeries) (*http.Response, error)

Push the input timeseries to the remote endpoint

func (*Client) Query

func (c *Client) Query(query string, ts time.Time) (model.Value, error)

Query runs an instant query.

func (*Client) QueryRange

func (c *Client) QueryRange(query string, start, end time.Time, step time.Duration) (model.Value, error)

Query runs a query range.

func (*Client) QueryRangeRaw

func (c *Client) QueryRangeRaw(query string, start, end time.Time, step time.Duration) (*http.Response, []byte, error)

QueryRangeRaw runs a ranged query directly against the querier API.

func (*Client) QueryRaw

func (c *Client) QueryRaw(query string) (*http.Response, []byte, error)

QueryRaw runs a query directly against the querier API.

func (*Client) SendAlertToAlermanager

func (c *Client) SendAlertToAlermanager(ctx context.Context, alert *model.Alert) error

SendAlertToAlermanager sends alerts to the Alertmanager API

func (*Client) Series

func (c *Client) Series(matches []string, start, end time.Time) ([]model.LabelSet, error)

Series finds series by label matchers.

func (*Client) SetAlertmanagerConfig

func (c *Client) SetAlertmanagerConfig(ctx context.Context, amConfig string, templates map[string]string) error

SetAlertmanagerConfig gets the status of an alertmanager instance

func (*Client) SetRuleGroup

func (c *Client) SetRuleGroup(rulegroup rulefmt.RuleGroup, namespace string) error

SetRuleGroup gets the status of an alertmanager instance

type CompositeCortexService

type CompositeCortexService struct {
	*e2e.CompositeHTTPService
}

CompositeCortexService abstract an higher-level service composed, under the hood, by 2+ CortexService.

func NewCompositeCortexService

func NewCompositeCortexService(services ...*CortexService) *CompositeCortexService

type CortexService

type CortexService struct {
	*e2e.HTTPService
	// contains filtered or unexported fields
}

CortexService represents a Cortex service with at least an HTTP and GRPC port exposed.

func NewAlertmanager

func NewAlertmanager(name string, flags map[string]string, image string) *CortexService

func NewCortexService

func NewCortexService(
	name string,
	image string,
	command *e2e.Command,
	readiness e2e.ReadinessProbe,
	httpPort int,
	grpcPort int,
	otherPorts ...int,
) *CortexService

func NewDistributor

func NewDistributor(name string, consulAddress string, flags map[string]string, image string) *CortexService

func NewDistributorWithConfigFile

func NewDistributorWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService

func NewIngester

func NewIngester(name string, consulAddress string, flags map[string]string, image string) *CortexService

func NewIngesterWithConfigFile

func NewIngesterWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService

func NewPurger

func NewPurger(name string, flags map[string]string, image string) *CortexService

func NewPurgerWithConfigFile

func NewPurgerWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService

func NewQuerier

func NewQuerier(name string, consulAddress string, flags map[string]string, image string) *CortexService

func NewQuerierWithConfigFile

func NewQuerierWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService

func NewQueryFrontend

func NewQueryFrontend(name string, flags map[string]string, image string) *CortexService

func NewQueryFrontendWithConfigFile

func NewQueryFrontendWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService

func NewRuler

func NewRuler(name string, flags map[string]string, image string) *CortexService

func NewSingleBinary

func NewSingleBinary(name string, flags map[string]string, image string, otherPorts ...int) *CortexService

func NewSingleBinaryWithConfigFile

func NewSingleBinaryWithConfigFile(name string, configFile string, flags map[string]string, image string, httpPort, grpcPort int, otherPorts ...int) *CortexService

func NewStoreGateway

func NewStoreGateway(name string, consulAddress string, flags map[string]string, image string) *CortexService

func NewStoreGatewayWithConfigFile

func NewStoreGatewayWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService

func NewTableManager

func NewTableManager(name string, flags map[string]string, image string) *CortexService

func NewTableManagerWithConfigFile

func NewTableManagerWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService

func (*CortexService) GRPCEndpoint

func (s *CortexService) GRPCEndpoint() string

func (*CortexService) NetworkGRPCEndpoint

func (s *CortexService) NetworkGRPCEndpoint() string

type S3Client

type S3Client struct {
	// contains filtered or unexported fields
}

func NewS3Client

func NewS3Client(cfg s3.Config) (*S3Client, error)

func NewS3ClientForMinio

func NewS3ClientForMinio(minio *e2e.HTTPService, bucketName string) (*S3Client, error)

func (*S3Client) Delete

func (c *S3Client) Delete(prefix string) error

Delete recursively deletes every object within the input prefix.

func (*S3Client) DeleteBlock

func (c *S3Client) DeleteBlock(userID, blockID string) error

DeleteBlock deletes a single block.

func (*S3Client) DeleteBlocks

func (c *S3Client) DeleteBlocks(userID string) error

DeleteBlocks deletes all blocks for a tenant.

type ServerStatus

type ServerStatus struct {
	Data struct {
		ConfigYaml string `json:"configYAML"`
	} `json:"data"`
}

ServerStatus represents a Alertmanager status response TODO: Upgrade to Alertmanager v0.20.0+ and utilize vendored structs

Jump to

Keyboard shortcuts

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