cortex

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 51 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServerService added in v0.7.0

func NewServerService(serv *server.Server, servicesToWaitFor func() []services.Service) services.Service

NewServerService constructs service from Server component. servicesToWaitFor is called when server is stopping, and should return all services that need to terminate before server actually stops. N.B.: this function is NOT Cortex specific, please let's keep it that way.

Types

type Config

type Config struct {
	Target      ModuleName `yaml:"target"`
	AuthEnabled bool       `yaml:"auth_enabled"`
	PrintConfig bool       `yaml:"-"`
	HTTPPrefix  string     `yaml:"http_prefix"`

	API              api.Config               `yaml:"api"`
	Server           server.Config            `yaml:"server"`
	Distributor      distributor.Config       `yaml:"distributor"`
	Querier          querier.Config           `yaml:"querier"`
	IngesterClient   client.Config            `yaml:"ingester_client"`
	Ingester         ingester.Config          `yaml:"ingester"`
	Flusher          flusher.Config           `yaml:"flusher"`
	Storage          storage.Config           `yaml:"storage"`
	ChunkStore       chunk.StoreConfig        `yaml:"chunk_store"`
	Schema           chunk.SchemaConfig       `yaml:"schema" doc:"hidden"` // Doc generation tool doesn't support it because part of the SchemaConfig doesn't support CLI flags (needs manual documentation)
	LimitsConfig     validation.Limits        `yaml:"limits"`
	Prealloc         client.PreallocConfig    `yaml:"prealloc" doc:"hidden"`
	Worker           frontend.WorkerConfig    `yaml:"frontend_worker"`
	Frontend         frontend.Config          `yaml:"frontend"`
	QueryRange       queryrange.Config        `yaml:"query_range"`
	TableManager     chunk.TableManagerConfig `yaml:"table_manager"`
	Encoding         encoding.Config          `yaml:"-"` // No yaml for this, it only works with flags.
	TSDB             tsdb.Config              `yaml:"tsdb"`
	Compactor        compactor.Config         `yaml:"compactor"`
	StoreGateway     storegateway.Config      `yaml:"store_gateway"`
	DataPurgerConfig purger.Config            `yaml:"purger"`

	Ruler         ruler.Config                               `yaml:"ruler"`
	Configs       configs.Config                             `yaml:"configs"`
	Alertmanager  alertmanager.MultitenantAlertmanagerConfig `yaml:"alertmanager"`
	RuntimeConfig runtimeconfig.ManagerConfig                `yaml:"runtime_config"`
	MemberlistKV  memberlist.KVConfig                        `yaml:"memberlist"`
}

Config is the root config for Cortex.

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers flag.

func (*Config) Validate added in v0.4.0

func (c *Config) Validate(log log.Logger) error

Validate the cortex config and returns an error if the validation doesn't pass

type Cortex

type Cortex struct {
	Cfg Config

	// set during initialization
	ServiceMap map[ModuleName]services.Service

	API              *api.API
	Server           *server.Server
	Ring             *ring.Ring
	Overrides        *validation.Overrides
	Distributor      *distributor.Distributor
	Ingester         *ingester.Ingester
	Flusher          *flusher.Flusher
	Store            chunk.Store
	DeletesStore     *purger.DeleteStore
	Frontend         *frontend.Frontend
	TableManager     *chunk.TableManager
	Cache            cache.Cache
	RuntimeConfig    *runtimeconfig.Manager
	DataPurger       *purger.DataPurger
	TombstonesLoader *purger.TombstonesLoader

	Ruler        *ruler.Ruler
	ConfigAPI    *configAPI.API
	ConfigDB     db.DB
	Alertmanager *alertmanager.MultitenantAlertmanager
	Compactor    *compactor.Compactor
	StoreGateway *storegateway.StoreGateway
	MemberlistKV *memberlist.KVInit

	// Queryable that the querier should use to query the long
	// term storage. It depends on the storage engine used.
	StoreQueryable prom_storage.Queryable
}

Cortex is the root datastructure for Cortex.

func New

func New(cfg Config) (*Cortex, error)

New makes a new Cortex.

func (*Cortex) Run

func (t *Cortex) Run() error

Run starts Cortex running, and blocks until a Cortex stops.

type ModuleName added in v1.0.0

type ModuleName string

ModuleName is used to describe a running module

const (
	API                 ModuleName = "api"
	Ring                ModuleName = "ring"
	RuntimeConfig       ModuleName = "runtime-config"
	Overrides           ModuleName = "overrides"
	Server              ModuleName = "server"
	Distributor         ModuleName = "distributor"
	Ingester            ModuleName = "ingester"
	Flusher             ModuleName = "flusher"
	Querier             ModuleName = "querier"
	StoreQueryable      ModuleName = "store-queryable"
	QueryFrontend       ModuleName = "query-frontend"
	Store               ModuleName = "store"
	DeleteRequestsStore ModuleName = "delete-requests-store"
	TableManager        ModuleName = "table-manager"
	Ruler               ModuleName = "ruler"
	Configs             ModuleName = "configs"
	AlertManager        ModuleName = "alertmanager"
	Compactor           ModuleName = "compactor"
	StoreGateway        ModuleName = "store-gateway"
	MemberlistKV        ModuleName = "memberlist-kv"
	DataPurger          ModuleName = "data-purger"
	All                 ModuleName = "all"
)

The various modules that make up Cortex.

func (ModuleName) MarshalYAML added in v1.0.0

func (m ModuleName) MarshalYAML() (interface{}, error)

func (*ModuleName) Set added in v1.0.0

func (m *ModuleName) Set(s string) error

func (ModuleName) String added in v1.0.0

func (m ModuleName) String() string

func (*ModuleName) UnmarshalYAML added in v1.0.0

func (m *ModuleName) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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