Documentation
¶
Index ¶
- Constants
- Variables
- 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 Codec
- type Config
- type ConfigWrapper
- type DrilldownConfigResponse
- type FormatQueryResponse
- type Frontend
- type Loki
- type ProfilingConfig
- type RunOpts
Constants ¶
const ( Ring = "ring" Overrides = "overrides" OverridesExporter = "overrides-exporter" TenantConfigs = "tenant-configs" Server = "server" InternalServer = "internal-server" Distributor = "distributor" IngestLimits = "ingest-limits" IngestLimitsRing = "ingest-limits-ring" IngestLimitsFrontend = "ingest-limits-frontend" IngestLimitsFrontendRing = "ingest-limits-frontend-ring" Ingester = "ingester" PatternIngester = "pattern-ingester" PatternRingClient = "pattern-ring-client" PatternIngesterTee = "pattern-ingester-tee" Querier = "querier" QueryFrontend = "query-frontend" QueryFrontendTripperware = "query-frontend-tripperware" QueryLimiter = "query-limiter" QueryLimitsInterceptors = "query-limits-interceptors" QueryLimitsTripperware = "query-limits-tripperware" QueryEngine = "query-engine" QueryEngineScheduler = "query-engine-scheduler" QueryEngineWorker = "query-engine-worker" Store = "store" TableManager = "table-manager" RulerStorage = "ruler-storage" Ruler = "ruler" RuleEvaluator = "rule-evaluator" Compactor = "compactor" IndexGateway = "index-gateway" IndexGatewayRing = "index-gateway-ring" IndexGatewayInterceptors = "index-gateway-interceptors" BloomStore = "bloom-store" BloomGateway = "bloom-gateway" BloomGatewayClient = "bloom-gateway-client" BloomPlanner = "bloom-planner" BloomBuilder = "bloom-builder" QueryScheduler = "query-scheduler" QuerySchedulerRing = "query-scheduler-ring" IngesterQuerier = "ingester-querier" IngesterGRPCInterceptors = "ingester-grpc-interceptors" RuntimeConfig = "runtime-config" MemberlistKV = "memberlist-kv" Analytics = "analytics" CacheGenerationLoader = "cache-generation-loader" PartitionRing = "partition-ring" DataObjExplorer = "dataobj-explorer" DataObjConsumer = "dataobj-consumer" DataObjConsumerRing = "dataobj-consumer-ring" DataObjConsumerPartitionRing = "dataobj-consumer-partition-ring" DataObjIndexBuilder = "dataobj-index-builder" ScratchStore = "scratch-store" UIRing = "ui-ring" UI = "ui" All = "all" Read = "read" Write = "write" Backend = "backend" )
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 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 Codec ¶
type Codec interface {
transport.Codec
worker.RequestCodec
}
Codec defines methods to encode and decode requests from HTTP, httpgrpc and Protobuf.
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"`
Server server.Config `yaml:"server,omitempty"`
InternalServer internalserver.Config `yaml:"internal_server,omitempty" doc:"hidden"`
UI ui.Config `yaml:"ui,omitempty"`
Distributor distributor.Config `yaml:"distributor,omitempty"`
Querier querier.Config `yaml:"querier,omitempty"`
QueryEngine engine.Config `yaml:"query_engine,omitempty" category:"experimental"`
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"`
RulerStorage rulestore.Config `yaml:"ruler_storage,omitempty"`
IngesterClient ingester_client.Config `yaml:"ingester_client,omitempty"`
Ingester ingester.Config `yaml:"ingester,omitempty"`
Pattern pattern.Config `yaml:"pattern_ingester,omitempty"`
IndexGateway indexgateway.Config `yaml:"index_gateway"`
BloomBuild bloombuild.Config `yaml:"bloom_build,omitempty" category:"experimental"`
BloomGateway bloomgateway.Config `yaml:"bloom_gateway,omitempty" category:"experimental"`
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 compactorclient.HTTPConfig `yaml:"compactor_client,omitempty" doc:"hidden"`
CompactorGRPCClient compactorclient.GRPCConfig `yaml:"compactor_grpc_client,omitempty"`
LimitsConfig validation.Limits `yaml:"limits_config"`
Worker worker.Config `yaml:"frontend_worker,omitempty"`
TableManager index.TableManagerConfig `yaml:"table_manager,omitempty"`
MemberlistKV memberlist.KVConfig `yaml:"memberlist"`
KafkaConfig kafka.Config `yaml:"kafka_config,omitempty" category:"experimental"`
DataObj dataobjconfig.Config `yaml:"dataobj,omitempty" category:"experimental"`
IngestLimits limits.Config `yaml:"ingest_limits,omitempty" category:"experimental"`
IngestLimitsFrontend limits_frontend.Config `yaml:"ingest_limits_frontend,omitempty" category:"experimental"`
IngestLimitsFrontendClient limits_frontend_client.Config `yaml:"ingest_limits_frontend_client,omitempty" category:"experimental"`
RuntimeConfig runtimeconfig.Config `yaml:"runtime_config,omitempty"`
OperationalConfig runtime.Config `yaml:"operational_config,omitempty"`
Tracing tracing.Config `yaml:"tracing"`
Analytics analytics.Config `yaml:"analytics"`
Profiling ProfilingConfig `yaml:"profiling,omitempty"`
// TenantLimitsAllowPublish specifies which limit fields to return from the tenant limits endpoint.
// If empty, all fields are returned. This allows filtering of sensitive or unwanted configuration.
TenantLimitsAllowPublish []string `yaml:"tenant_limits_allow_publish" json:"tenant_limits_allowlist_fields"`
LegacyReadTarget bool `yaml:"legacy_read_target,omitempty" doc:"hidden|deprecated"`
Common common.Config `yaml:"common,omitempty"`
ShutdownDelay time.Duration `yaml:"shutdown_delay"`
MetricsNamespace string `yaml:"metrics_namespace"`
}
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 DrilldownConfigResponse ¶ added in v3.6.0
type DrilldownConfigResponse struct {
Limits map[string]any `json:"limits"`
PatternIngesterEnabled bool `json:"pattern_ingester_enabled"`
Version string `json:"version"`
}
DrilldownConfigResponse represents the structure for the drilldown config endpoint This endpoint returns the filtered tenant limits in a JSON-optimized format
type FormatQueryResponse ¶
type Loki ¶
type Loki struct {
Cfg Config
// set during initialization
ModuleManager *modules.Manager
SignalHandler *signals.Handler
Server *server.Server
InternalServer *server.Server
UI *ui.Service
Overrides limiter.CombinedLimits
TenantLimits validation.TenantLimits
Ingester ingester.Interface
PatternIngester *pattern.Ingester
PatternRingClient pattern.RingClient
Querier querier.Querier
Store storage.Store
BloomStore bloomshipper.Store
RulerStorage rulestore.RuleStore
MemberlistKV *memberlist.KVInitService
QueryFrontEndMiddleware queryrangebase.Middleware
PartitionRingWatcher *ring.PartitionRingWatcher
DataObjConsumerPartitionRingWatcher *ring.PartitionRingWatcher
ClientMetrics storage.ClientMetrics
Tee distributor.Tee
PushParserWrapper push.RequestParserWrapper
HTTPAuthMiddleware middleware.Interface
Codec Codec
Metrics *server.Metrics
UsageTracker push.UsageTracker
// 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
type ProfilingConfig ¶ added in v3.1.0
type ProfilingConfig struct {
BlockProfileRate int `yaml:"block_profile_rate"`
CPUProfileRate int `yaml:"cpu_profile_rate"`
MutexProfileFraction int `yaml:"mutex_profile_fraction"`
}
func (*ProfilingConfig) RegisterFlags ¶ added in v3.1.0
func (c *ProfilingConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers flag.
func (*ProfilingConfig) RegisterFlagsWithPrefix ¶ added in v3.1.0
func (c *ProfilingConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix registers flag with a common prefix.
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)
// StartTime is the time at which the main() function started executing.
// It is used to determine the startup time as well as the running time of the Loki process.
StartTime time.Time
}
RunOpts configures custom behavior for running Loki.