Documentation ¶
Index ¶
- Constants
- Variables
- func AdjustForTimeoutsMigration(c *Config) error
- func DisableSignalHandling(config *server.Config)
- func NewServerService(serv *server.Server, servicesToWaitFor func() []services.Service) services.Service
- func PrintVersion(args []string) bool
- func ValidateConfigCompatibility(c Config) error
- type Config
- type ConfigWrapper
- type FormatQueryResponse
- type Frontend
- type Loki
- type RunOpts
Constants ¶
const ( Ring string = "ring" 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" QueryLimiter string = "query-limiter" QueryLimitsInterceptors string = "query-limits-interceptors" QueryLimitsTripperware string = "query-limits-tripper" RulerStorage string = "ruler-storage" Ruler string = "ruler" RuleEvaluator string = "rule-evaluator" 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" QuerySchedulerRing string = "query-scheduler-ring" All string = "all" Read string = "read" Write string = "write" Backend string = "backend" Analytics string = "analytics" )
The various modules that make up Loki.
Variables ¶
var ErrTooManyStorageConfigs = errors.New("too many storage configs provided in the common config, please only define one storage backend")
Functions ¶
func AdjustForTimeoutsMigration ¶
AdjustForTimeoutsMigration will adjust Loki timeouts configuration to be in accordance with the next major release.
We're preparing to unify the querier:engine:timeout and querier:query_timeout into a single timeout named limits_config:query_timeout. The migration encompasses of: - If limits_config:query_timeout is explicitly configured, use it everywhere as it is a new configuration and by configuring it, users are expressing that they're willing of using it. - If none are explicitly configured, use the default engine:timeout everywhere as it is longer than the default limits_config:query_timeout and otherwise users would start to experience shorter timeouts without expecting it. - If only the querier:engine:timeout was explicitly configured, warn the user and use it everywhere.
func DisableSignalHandling ¶
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 ¶
Types ¶
type Config ¶
type Config struct { Target flagext.StringSliceCSV `yaml:"target,omitempty"` AuthEnabled bool `yaml:"auth_enabled,omitempty"` HTTPPrefix string `yaml:"http_prefix" doc:"hidden"` 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" doc:"hidden"` UseSyncLogger bool `yaml:"use_sync_logger" doc:"hidden"` Server server.Config `yaml:"server,omitempty"` InternalServer internalserver.Config `yaml:"internal_server,omitempty" doc:"hidden"` Distributor distributor.Config `yaml:"distributor,omitempty"` Querier querier.Config `yaml:"querier,omitempty"` QueryScheduler scheduler.Config `yaml:"query_scheduler"` Frontend lokifrontend.Config `yaml:"frontend,omitempty"` QueryRange queryrange.Config `yaml:"query_range,omitempty"` Ruler ruler.Config `yaml:"ruler,omitempty"` IngesterClient ingester_client.Config `yaml:"ingester_client,omitempty"` Ingester ingester.Config `yaml:"ingester,omitempty"` IndexGateway indexgateway.Config `yaml:"index_gateway"` StorageConfig storage.Config `yaml:"storage_config,omitempty"` ChunkStoreConfig config.ChunkStoreConfig `yaml:"chunk_store_config,omitempty"` SchemaConfig config.SchemaConfig `yaml:"schema_config,omitempty"` CompactorConfig compactor.Config `yaml:"compactor,omitempty"` CompactorHTTPClient compactor_client.HTTPConfig `yaml:"compactor_client,omitempty" doc:"hidden"` CompactorGRPCClient compactor_client.GRPCConfig `yaml:"compactor_grpc_client,omitempty" doc:"hidden"` LimitsConfig validation.Limits `yaml:"limits_config,omitempty"` Worker worker.Config `yaml:"frontend_worker,omitempty"` TableManager index.TableManagerConfig `yaml:"table_manager,omitempty"` MemberlistKV memberlist.KVConfig `yaml:"memberlist"` RuntimeConfig runtimeconfig.Config `yaml:"runtime_config,omitempty"` Tracing tracing.Config `yaml:"tracing"` Analytics analytics.Config `yaml:"analytics"` LegacyReadTarget bool `yaml:"legacy_read_target,omitempty" doc:"hidden"` Common common.Config `yaml:"common,omitempty"` ShutdownDelay time.Duration `yaml:"shutdown_delay" category:"experimental"` }
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 ¶
RegisterFlags registers flag.
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 FormatQueryResponse ¶
type Loki ¶
type Loki struct { Cfg Config // set during initialization ModuleManager *modules.Manager SignalHandler *signals.Handler Server *server.Server InternalServer *server.Server Overrides limiter.CombinedLimits 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 (*Loki) ListTargets ¶
func (t *Loki) ListTargets()
ListTargets prints a list of available user visible targets and their dependencies