cortex

package
v0.8.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collectors

func Collectors() []prometheus.Collector

Types

type ClientSet

type ClientSet interface {
	Distributor() DistributorClient
	Ingester() IngesterClient
	Ruler() RulerClient
	Purger() PurgerClient
	Compactor() CompactorClient
	StoreGateway() StoreGatewayClient
	QueryFrontend() QueryFrontendClient
	Querier() QuerierClient
	HTTP(options ...HTTPClientOption) *http.Client
}

func NewClientSet

func NewClientSet(ctx context.Context, cortexSpec *v1beta1.CortexSpec, tlsConfig *tls.Config) (ClientSet, error)

type CompactorClient

type CompactorClient interface {
	Status(ctx context.Context) (*cortexadmin.CompactorStatus, error)
}

type ConfigClient

type ConfigClient interface {
	Config(ctx context.Context, mode ...ConfigMode) (string, error)
}

type ConfigMode

type ConfigMode string
const (
	Diff     ConfigMode = "diff"
	Defaults ConfigMode = "defaults"
)

type CortexAdminServer

func (*CortexAdminServer) AllUserStats

func (*CortexAdminServer) DeleteRule

func (p *CortexAdminServer) DeleteRule(
	ctx context.Context,
	in *cortexadmin.RuleRequest,
) (*emptypb.Empty, error)

func (*CortexAdminServer) ExtractRawSeries

func (*CortexAdminServer) FlushBlocks

func (p *CortexAdminServer) FlushBlocks(
	ctx context.Context,
	in *emptypb.Empty,
) (*emptypb.Empty, error)

func (*CortexAdminServer) GetCortexConfig

func (*CortexAdminServer) GetCortexStatus

func (p *CortexAdminServer) GetCortexStatus(ctx context.Context, _ *emptypb.Empty) (*cortexadmin.CortexStatus, error)

func (*CortexAdminServer) GetMetricLabelSets

func (p *CortexAdminServer) GetMetricLabelSets(ctx context.Context, request *cortexadmin.LabelRequest) (*cortexadmin.MetricLabels, error)

func (*CortexAdminServer) GetRule

func (*CortexAdminServer) GetSeriesMetrics

func (*CortexAdminServer) Initialize

func (p *CortexAdminServer) Initialize(conf CortexAdminServerConfig)

func (*CortexAdminServer) ListRules

func (*CortexAdminServer) LoadRules

LoadRules This method is responsible for Creating and Updating Rules

func (*CortexAdminServer) Query

func (*CortexAdminServer) QueryRange

func (*CortexAdminServer) WriteMetrics

type CortexAdminServerConfig

type CortexAdminServerConfig struct {
	CortexClientSet ClientSet                  `validate:"required"`
	Config          *v1beta1.GatewayConfigSpec `validate:"required"`
	Logger          *zap.SugaredLogger         `validate:"required"`
}

type DataFormat

type DataFormat string
const (
	// Rule data formatted as a single YAML document containing yaml-encoded
	// []rulefmt.RuleGroup keyed by tenant ID:
	// <tenantID>:
	//   - name: ...
	//     rules: [...]
	NamespaceKeyedYAML DataFormat = "namespace-keyed-yaml"
	// Rule data formatted as JSON containing the prometheus response metadata
	// and a list of rule groups, each of which has a field "file" containing
	// the tenant ID:
	// {"status":"success","data":{"groups":["file":"<tenantID>", ...]}}
	PrometheusRuleGroupsJSON DataFormat = "prometheus-rule-groups-json"
)

type HTTPClientOption

type HTTPClientOption func(*HTTPClientOptions)

func WithServerNameOverride

func WithServerNameOverride(serverNameOverride string) HTTPClientOption

type HTTPClientOptions

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

type HttpApiServer

type HttpApiServer struct {
	HttpApiServerConfig
	util.Initializer
}

func (*HttpApiServer) ConfigureRoutes

func (p *HttpApiServer) ConfigureRoutes(router *gin.Engine)

func (*HttpApiServer) Initialize

func (p *HttpApiServer) Initialize(config HttpApiServerConfig)

type HttpApiServerConfig

type HttpApiServerConfig struct {
	PluginContext    context.Context               `validate:"required"`
	ManagementClient managementv1.ManagementClient `validate:"required"`
	CortexClientSet  ClientSet                     `validate:"required"`
	Config           *v1beta1.GatewayConfigSpec    `validate:"required"`
	CortexTLSConfig  *tls.Config                   `validate:"required"`
	Logger           *zap.SugaredLogger            `validate:"required"`
	StorageBackend   storage.Backend               `validate:"required"`
	AuthMiddlewares  map[string]auth.Middleware    `validate:"required"`
}

type IngesterClient

type IngesterClient interface {
	Status(ctx context.Context) (*cortexadmin.IngesterStatus, error)
}

type MemberlistStatusClient

type MemberlistStatusClient interface {
	MemberlistStatus(ctx context.Context) (*cortexadmin.MemberlistStatus, error)
}

type MultiTenantRuleAggregator

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

func NewMultiTenantRuleAggregator

func NewMultiTenantRuleAggregator(
	client managementv1.ManagementClient,
	cortexClient *http.Client,
	headerCodec rbac.HeaderCodec,
	format DataFormat,
) *MultiTenantRuleAggregator

func (*MultiTenantRuleAggregator) Handle

func (a *MultiTenantRuleAggregator) Handle(c *gin.Context)

type PurgerClient

type PurgerClient interface {
	Status(ctx context.Context) (*cortexadmin.PurgerStatus, error)
}

type QuerierClient

type QuerierClient interface {
	Status(ctx context.Context) (*cortexadmin.QuerierStatus, error)
}

type QueryFrontendClient

type QueryFrontendClient interface {
	Status(ctx context.Context) (*cortexadmin.QueryFrontendStatus, error)
}

type RemoteWriteForwarder

func (*RemoteWriteForwarder) Initialize

func (*RemoteWriteForwarder) Push

func (f *RemoteWriteForwarder) Push(ctx context.Context, payload *remotewrite.Payload) (_ *emptypb.Empty, pushErr error)

func (*RemoteWriteForwarder) SyncRules

func (f *RemoteWriteForwarder) SyncRules(ctx context.Context, payload *remotewrite.Payload) (_ *emptypb.Empty, syncErr error)

type RemoteWriteForwarderConfig

type RemoteWriteForwarderConfig struct {
	CortexClientSet ClientSet                  `validate:"required"`
	Config          *v1beta1.GatewayConfigSpec `validate:"required"`
	Logger          *zap.SugaredLogger         `validate:"required"`
}

type RingStatusClient

type RingStatusClient interface {
	RingStatus(ctx context.Context) (*cortexadmin.RingStatus, error)
}

type RulerClient

type RulerClient interface {
	ruler.RulerClient
	Status(ctx context.Context) (*cortexadmin.RulerStatus, error)
}

type ServicesStatusClient

type ServicesStatusClient interface {
	ServicesStatus(ctx context.Context) (*cortexadmin.ServiceStatusList, error)
}

type StoreGatewayClient

type StoreGatewayClient interface {
	Status(ctx context.Context) (*cortexadmin.StoreGatewayStatus, error)
}

type UninstallTaskRunner

func (*UninstallTaskRunner) Initialize

func (a *UninstallTaskRunner) Initialize(conf UninstallTaskRunnerConfig)

func (*UninstallTaskRunner) OnTaskCompleted

func (a *UninstallTaskRunner) OnTaskCompleted(ctx context.Context, ti task.ActiveTask, state task.State, args ...any)

func (*UninstallTaskRunner) OnTaskRunning

func (a *UninstallTaskRunner) OnTaskRunning(ctx context.Context, ti task.ActiveTask) error

type UninstallTaskRunnerConfig

type UninstallTaskRunnerConfig struct {
	CortexClientSet ClientSet                  `validate:"required"`
	Config          *v1beta1.GatewayConfigSpec `validate:"required"`
	StorageBackend  storage.Backend            `validate:"required"`
}

Jump to

Keyboard shortcuts

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