Documentation ¶
Index ¶
- Constants
- Variables
- func FormatTime(t time.Time) string
- func GetDefaultImage() string
- type AlertGroup
- type Client
- func (c *Client) CreateSilence(ctx context.Context, silence types.Silence) (string, error)
- func (c *Client) DeleteAlertmanagerConfig(ctx context.Context) error
- func (c *Client) DeleteRuleGroup(namespace string, groupName string) error
- func (c *Client) DeleteRuleNamespace(namespace string) error
- func (c *Client) DeleteSilence(ctx context.Context, id string) error
- func (c *Client) GetAlertGroups(ctx context.Context) ([]AlertGroup, error)
- func (c *Client) GetAlertmanagerConfig(ctx context.Context) (*alertConfig.Config, error)
- func (c *Client) GetAlertmanagerStatusPage(ctx context.Context) ([]byte, error)
- func (c *Client) GetAlertsV1(ctx context.Context) ([]model.Alert, error)
- func (c *Client) GetAlertsV2(ctx context.Context) ([]model.Alert, error)
- func (c *Client) GetPrometheusRules() ([]*ruler.RuleGroup, error)
- func (c *Client) GetReceivers(ctx context.Context) ([]string, error)
- func (c *Client) GetRuleGroup(namespace string, groupName string) (*http.Response, error)
- func (c *Client) GetRuleGroups() (map[string][]rulefmt.RuleGroup, error)
- func (c *Client) GetSilenceV1(ctx context.Context, id string) (types.Silence, error)
- func (c *Client) GetSilenceV2(ctx context.Context, id string) (types.Silence, error)
- func (c *Client) GetSilencesV1(ctx context.Context) ([]types.Silence, error)
- func (c *Client) GetSilencesV2(ctx context.Context) ([]types.Silence, error)
- func (c *Client) LabelNames(start, end time.Time) ([]string, error)
- func (c *Client) LabelValues(label string, start, end time.Time, matches []string) (model.LabelValues, error)
- func (c *Client) PostRequest(url string, body io.Reader) (*http.Response, error)
- func (c *Client) Push(timeseries []prompb.TimeSeries) (*http.Response, error)
- func (c *Client) Query(query string, ts time.Time) (model.Value, error)
- func (c *Client) QueryRange(query string, start, end time.Time, step time.Duration) (model.Value, error)
- func (c *Client) QueryRangeRaw(query string, start, end time.Time, step time.Duration) (*http.Response, []byte, error)
- func (c *Client) QueryRaw(query string) (*http.Response, []byte, error)
- func (c *Client) SendAlertToAlermanager(ctx context.Context, alert *model.Alert) error
- func (c *Client) Series(matches []string, start, end time.Time) ([]model.LabelSet, error)
- func (c *Client) SetAlertmanagerConfig(ctx context.Context, amConfig string, templates map[string]string) error
- func (c *Client) SetRuleGroup(rulegroup rulefmt.RuleGroup, namespace string) error
- type CompositeCortexService
- type CortexService
- func NewAlertmanager(name string, flags map[string]string, image string) *CortexService
- func NewAlertmanagerWithTLS(name string, flags map[string]string, image string) *CortexService
- func NewCompactor(name string, consulAddress string, flags map[string]string, image string) *CortexService
- func NewCompactorWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService
- func NewCortexService(name string, image string, command *e2e.Command, readiness e2e.ReadinessProbe, ...) *CortexService
- func NewDistributor(name string, consulAddress string, flags map[string]string, image string) *CortexService
- func NewDistributorWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService
- func NewIngester(name string, consulAddress string, flags map[string]string, image string) *CortexService
- func NewIngesterWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService
- func NewPurger(name string, flags map[string]string, image string) *CortexService
- func NewPurgerWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService
- func NewQuerier(name string, consulAddress string, flags map[string]string, image string) *CortexService
- func NewQuerierWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService
- func NewQueryFrontend(name string, flags map[string]string, image string) *CortexService
- func NewQueryFrontendWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService
- func NewQueryScheduler(name string, flags map[string]string, image string) *CortexService
- func NewQuerySchedulerWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService
- func NewRuler(name string, consulAddress string, flags map[string]string, image string) *CortexService
- func NewSingleBinary(name string, flags map[string]string, image string, otherPorts ...int) *CortexService
- func NewSingleBinaryWithConfigFile(name string, configFile string, flags map[string]string, image string, ...) *CortexService
- func NewStoreGateway(name string, consulAddress string, flags map[string]string, image string) *CortexService
- func NewStoreGatewayWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService
- func NewTableManager(name string, flags map[string]string, image string) *CortexService
- func NewTableManagerWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService
- type S3Client
- type ServerStatus
Constants ¶
const (
GossipPort = 9094
)
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
func FormatTime ¶ added in v1.4.0
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 AlertGroup ¶ added in v1.9.0
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) CreateSilence ¶ added in v1.9.0
CreateSilence creates a new silence and returns the unique identifier of the silence.
func (*Client) DeleteAlertmanagerConfig ¶ added in v1.3.0
DeleteAlertmanagerConfig gets the status of an alertmanager instance
func (*Client) DeleteRuleGroup ¶ added in v1.0.0
DeleteRuleGroup deletes a rule group.
func (*Client) DeleteRuleNamespace ¶ added in v1.4.0
DeleteRuleNamespace deletes all the rule groups (and the namespace itself).
func (*Client) DeleteSilence ¶ added in v1.9.0
func (*Client) GetAlertGroups ¶ added in v1.9.0
func (c *Client) GetAlertGroups(ctx context.Context) ([]AlertGroup, error)
func (*Client) GetAlertmanagerConfig ¶
GetAlertmanagerConfig gets the status of an alertmanager instance
func (*Client) GetAlertmanagerStatusPage ¶ added in v1.10.0
GetAlertmanagerStatusPage gets the status page of alertmanager.
func (*Client) GetAlertsV1 ¶ added in v1.10.0
func (*Client) GetAlertsV2 ¶ added in v1.10.0
func (*Client) GetPrometheusRules ¶ added in v1.9.0
GetPrometheusRules fetches the rules from the Prometheus endpoint /api/v1/rules.
func (*Client) GetReceivers ¶ added in v1.9.0
func (*Client) GetRuleGroup ¶ added in v1.9.0
GetRuleGroup gets a rule group.
func (*Client) GetRuleGroups ¶ added in v1.0.0
GetRuleGroups gets the configured rule groups from the ruler.
func (*Client) GetSilenceV1 ¶ added in v1.10.0
func (*Client) GetSilenceV2 ¶ added in v1.10.0
func (*Client) GetSilencesV1 ¶ added in v1.10.0
func (*Client) GetSilencesV2 ¶ added in v1.10.0
func (*Client) LabelNames ¶ added in v1.1.0
LabelNames gets label names
func (*Client) LabelValues ¶ added in v1.1.0
func (c *Client) LabelValues(label string, start, end time.Time, matches []string) (model.LabelValues, error)
LabelValues gets label values
func (*Client) PostRequest ¶ added in v1.4.0
func (*Client) QueryRange ¶ added in v1.4.0
func (c *Client) QueryRange(query string, start, end time.Time, step time.Duration) (model.Value, error)
Query runs a query range.
func (*Client) QueryRangeRaw ¶ added in v1.4.0
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) SendAlertToAlermanager ¶ added in v1.4.0
SendAlertToAlermanager sends alerts to the Alertmanager API
type CompositeCortexService ¶ added in v1.1.0
type CompositeCortexService struct {
*e2e.CompositeHTTPService
}
CompositeCortexService abstract an higher-level service composed, under the hood, by 2+ CortexService.
func NewCompositeCortexService ¶ added in v1.1.0
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 NewAlertmanagerWithTLS ¶ added in v1.8.0
func NewAlertmanagerWithTLS(name string, flags map[string]string, image string) *CortexService
func NewCompactor ¶ added in v1.7.0
func NewCompactorWithConfigFile ¶ added in v1.7.0
func NewCompactorWithConfigFile(name, consulAddress, configFile 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 NewDistributorWithConfigFile ¶
func NewDistributorWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService
func NewIngester ¶
func NewIngesterWithConfigFile ¶
func NewIngesterWithConfigFile(name, consulAddress, configFile string, flags map[string]string, image string) *CortexService
func NewPurger ¶ added in v1.4.0
func NewPurger(name string, flags map[string]string, image string) *CortexService
func NewPurgerWithConfigFile ¶ added in v1.4.0
func NewPurgerWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService
func NewQuerier ¶
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 NewQueryScheduler ¶ added in v1.6.0
func NewQueryScheduler(name string, flags map[string]string, image string) *CortexService
func NewQuerySchedulerWithConfigFile ¶ added in v1.6.0
func NewQuerySchedulerWithConfigFile(name, configFile string, flags map[string]string, image string) *CortexService
func NewSingleBinary ¶
func NewSingleBinaryWithConfigFile ¶ added in v1.1.0
func NewStoreGateway ¶ added in v1.1.0
func NewStoreGatewayWithConfigFile ¶ added in v1.1.0
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 NewS3ClientForMinio ¶
func NewS3ClientForMinio(minio *e2e.HTTPService, bucketName string) (*S3Client, error)
func (*S3Client) DeleteBlock ¶
DeleteBlock deletes a single block.
func (*S3Client) DeleteBlocks ¶
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