loki

package
v0.0.0-...-e951c9a Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 92 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ring                     string = "ring"
	Embededcache             string = "embedded-cache"
	RuntimeConfig            string = "runtime-config"
	Overrides                string = "overrides"
	OverridesExporter        string = "overrides-exporter"
	TenantConfigs            string = "tenant-configs"
	Server                   string = "server"
	InternalServer           string = "internal-server"
	Distributor              string = "distributor"
	Ingester                 string = "ingester"
	Querier                  string = "querier"
	CacheGenerationLoader    string = "cache-generation-loader"
	IngesterQuerier          string = "ingester-querier"
	QueryFrontend            string = "query-frontend"
	QueryFrontendTripperware string = "query-frontend-tripperware"
	RulerStorage             string = "ruler-storage"
	Ruler                    string = "ruler"
	Store                    string = "store"
	TableManager             string = "table-manager"
	MemberlistKV             string = "memberlist-kv"
	Compactor                string = "compactor"
	IndexGateway             string = "index-gateway"
	IndexGatewayRing         string = "index-gateway-ring"
	QueryScheduler           string = "query-scheduler"
	All                      string = "all"
	Read                     string = "read"
	Write                    string = "write"
	UsageReport              string = "usage-report"
)

The various modules that make up Loki.

Variables

View Source
var ErrTooManyStorageConfigs = errors.New("too many storage configs provided in the common config, please only define one storage backend")

Functions

func DisableSignalHandling

func DisableSignalHandling(config *server.Config)

DisableSignalHandling puts a dummy signal handler

func NewServerService

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. Passed server should not react on signals. Early return from Run function is considered to be an error.

func PrintVersion

func PrintVersion(args []string) bool

func ValidateConfigCompatibility

func ValidateConfigCompatibility(c Config) error

Types

type Config

type Config struct {
	Target       flagext.StringSliceCSV `yaml:"target,omitempty"`
	AuthEnabled  bool                   `yaml:"auth_enabled,omitempty"`
	HTTPPrefix   string                 `yaml:"http_prefix"`
	BallastBytes int                    `yaml:"ballast_bytes"`

	// TODO(dannyk): Remove these config options before next release; they don't need to be configurable.
	//				 These are only here to allow us to test the new functionality.
	UseBufferedLogger bool `yaml:"use_buffered_logger"`
	UseSyncLogger     bool `yaml:"use_sync_logger"`

	Common           common.Config            `yaml:"common,omitempty"`
	Server           server.Config            `yaml:"server,omitempty"`
	InternalServer   internalserver.Config    `yaml:"internal_server,omitempty"`
	Distributor      distributor.Config       `yaml:"distributor,omitempty"`
	Querier          querier.Config           `yaml:"querier,omitempty"`
	IngesterClient   client.Config            `yaml:"ingester_client,omitempty"`
	Ingester         ingester.Config          `yaml:"ingester,omitempty"`
	StorageConfig    storage.Config           `yaml:"storage_config,omitempty"`
	IndexGateway     indexgateway.Config      `yaml:"index_gateway"`
	ChunkStoreConfig config.ChunkStoreConfig  `yaml:"chunk_store_config,omitempty"`
	SchemaConfig     config.SchemaConfig      `yaml:"schema_config,omitempty"`
	LimitsConfig     validation.Limits        `yaml:"limits_config,omitempty"`
	TableManager     index.TableManagerConfig `yaml:"table_manager,omitempty"`
	Worker           worker.Config            `yaml:"frontend_worker,omitempty"`
	Frontend         lokifrontend.Config      `yaml:"frontend,omitempty"`
	Ruler            ruler.Config             `yaml:"ruler,omitempty"`
	QueryRange       queryrange.Config        `yaml:"query_range,omitempty"`
	RuntimeConfig    runtimeconfig.Config     `yaml:"runtime_config,omitempty"`
	MemberlistKV     memberlist.KVConfig      `yaml:"memberlist"`
	Tracing          tracing.Config           `yaml:"tracing"`
	CompactorConfig  compactor.Config         `yaml:"compactor,omitempty"`
	QueryScheduler   scheduler.Config         `yaml:"query_scheduler"`
	UsageReport      usagestats.Config        `yaml:"analytics"`
}

Config is the root config for Loki.

func (*Config) Clone

func (c *Config) Clone() flagext.Registerer

Clone takes advantage of pass-by-value semantics to return a distinct *Config. This is primarily used to parse a different flag set without mutating the original *Config.

func (*Config) RegisterFlags

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

RegisterFlags registers flag.

func (*Config) Validate

func (c *Config) Validate() error

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

type ConfigWrapper

type ConfigWrapper struct {
	Config `yaml:",inline"`

	VerifyConfig    bool
	PrintConfig     bool
	ListTargets     bool
	LogConfig       bool
	ConfigFile      string
	ConfigExpandEnv bool
	// contains filtered or unexported fields
}

ConfigWrapper is a struct containing the Loki config along with other values that can be set on the command line for interacting with the config file or the application directly. ConfigWrapper implements cfg.DynamicCloneable, allowing configuration to be dynamically set based on the logic in ApplyDynamicConfig, which receives values set in config file

func (*ConfigWrapper) ApplyDynamicConfig

func (c *ConfigWrapper) ApplyDynamicConfig() cfg.Source

ApplyDynamicConfig satisfies WithCommonCloneable interface, and applies all rules for setting Loki config values from the common section of the Loki config file. This method's purpose is to simplify Loki's config in an opinionated way so that Loki can be run with the minimal amount of config options for most use cases. It also aims to reduce redundancy where some values are set multiple times through the Loki config.

func (*ConfigWrapper) Clone

func (c *ConfigWrapper) Clone() flagext.Registerer

Clone takes advantage of pass-by-value semantics to return a distinct *Config. This is primarily used to parse a different flag set without mutating the original *Config.

func (*ConfigWrapper) RegisterFlags

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

type Frontend

type Frontend interface {
	services.Service
	CheckReady(_ context.Context) error
}

type Loki

type Loki struct {
	Cfg Config

	// set during initialization
	ModuleManager *modules.Manager

	SignalHandler *signals.Handler

	Server         *server.Server
	InternalServer *server.Server

	TenantLimits validation.TenantLimits

	Ingester ingester.Interface
	Querier  querier.Querier

	Store storage.Store

	RulerStorage rulestore.RuleStore

	MemberlistKV *memberlist.KVInitService

	QueryFrontEndTripperware basetripper.Tripperware

	HTTPAuthMiddleware middleware.Interface
	// contains filtered or unexported fields
}

Loki is the root datastructure for Loki.

func New

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

New makes a new Loki.

func (*Loki) ListTargets

func (t *Loki) ListTargets()

ListTargets prints a list of available user visible targets and their dependencies

func (*Loki) Run

func (t *Loki) Run(opts RunOpts) error

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

type RunOpts

type RunOpts struct {
	// CustomConfigEndpointHandlerFn is the handlerFunc to be used by the /config endpoint.
	// If empty, default handlerFunc will be used.
	CustomConfigEndpointHandlerFn func(http.ResponseWriter, *http.Request)
}

RunOpts configures custom behavior for running Loki.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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