mimir

package
v0.0.0-...-ba40f9b Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: AGPL-3.0 Imports: 99 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivityTracker                 string = "activity-tracker"
	API                             string = "api"
	SanityCheck                     string = "sanity-check"
	IngesterRing                    string = "ingester-ring"
	IngesterPartitionRing           string = "ingester-partitions-ring"
	RuntimeConfig                   string = "runtime-config"
	Overrides                       string = "overrides"
	OverridesExporter               string = "overrides-exporter"
	Server                          string = "server"
	ActiveGroupsCleanupService      string = "active-groups-cleanup-service"
	Distributor                     string = "distributor"
	DistributorService              string = "distributor-service"
	Ingester                        string = "ingester"
	IngesterService                 string = "ingester-service"
	Flusher                         string = "flusher"
	Querier                         string = "querier"
	Queryable                       string = "queryable"
	StoreQueryable                  string = "store-queryable"
	QueryFrontend                   string = "query-frontend"
	QueryFrontendCodec              string = "query-frontend-codec"
	QueryFrontendTripperware        string = "query-frontend-tripperware"
	QueryFrontendTopicOffsetsReader string = "query-frontend-topic-offsets-reader"
	RulerStorage                    string = "ruler-storage"
	Ruler                           string = "ruler"
	AlertManager                    string = "alertmanager"
	Compactor                       string = "compactor"
	StoreGateway                    string = "store-gateway"
	MemberlistKV                    string = "memberlist-kv"
	QueryScheduler                  string = "query-scheduler"
	Vault                           string = "vault"
	TenantFederation                string = "tenant-federation"
	UsageStats                      string = "usage-stats"
	ContinuousTest                  string = "continuous-test"
	All                             string = "all"

	// Write Read and Backend are the targets used when using the read-write deployment mode.
	Write   string = "write"
	Read    string = "read"
	Backend string = "backend"
)

The various modules that make up Mimir.

Variables

This section is empty.

Functions

func DisableSignalHandling

func DisableSignalHandling(config *server.Config)

DisableSignalHandling puts a dummy signal handler

func InheritCommonFlagValues

func InheritCommonFlagValues(log log.Logger, fs *flag.FlagSet, common CommonConfig, inheriters ...CommonConfigInheriter) error

InheritCommonFlagValues will inherit the values of the provided common flags to all the inheriters.

func NewRuntimeManager

func NewRuntimeManager(cfg *Config, name string, reg prometheus.Registerer, logger log.Logger) (*runtimeconfig.Manager, error)

NewRuntimeManager returns a runtimeconfig.Manager, a services.Service that must be explicitly started to perform any work. cfg is initialized as necessary, before being passed to runtimeconfig.New.

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 Mimir 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 ThanosTracerStreamInterceptor

func ThanosTracerStreamInterceptor(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error

ThanosTracerStreamInterceptor injects the opentracing global tracer into the context in order to get it picked up by Thanos components.

func ThanosTracerUnaryInterceptor

func ThanosTracerUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

ThanosTracerUnaryInterceptor injects the opentracing global tracer into the context in order to get it picked up by Thanos components.

func UnmarshalCommonYAML

func UnmarshalCommonYAML(value *yaml.Node, inheriters ...CommonConfigInheriter) error

UnmarshalCommonYAML provides the implementation for UnmarshalYAML functions to unmarshal the CommonConfig. A list of CommonConfig inheriters can be provided

Types

type CommonConfig

type CommonConfig struct {
	Storage bucket.StorageBackendConfig `yaml:"storage"`
}

func (*CommonConfig) RegisterFlags

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

RegisterFlags registers flag.

type CommonConfigInheritance

type CommonConfigInheritance struct {
	Storage map[string]*bucket.StorageBackendConfig
}

type CommonConfigInheriter

type CommonConfigInheriter interface {
	CommonConfigInheritance() CommonConfigInheritance
}

CommonConfigInheriter abstracts config that inherit common config values.

type Config

type Config struct {
	Target                          flagext.StringSliceCSV `yaml:"target"`
	MultitenancyEnabled             bool                   `yaml:"multitenancy_enabled"`
	NoAuthTenant                    string                 `yaml:"no_auth_tenant" category:"advanced"`
	ShutdownDelay                   time.Duration          `yaml:"shutdown_delay" category:"advanced"`
	MaxSeparateMetricsGroupsPerUser int                    `yaml:"max_separate_metrics_groups_per_user" category:"experimental"`
	EnableGoRuntimeMetrics          bool                   `yaml:"enable_go_runtime_metrics" category:"advanced"`
	PrintConfig                     bool                   `yaml:"-"`
	ApplicationName                 string                 `yaml:"-"`

	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"`
	LimitsConfig     validation.Limits               `yaml:"limits"`
	Worker           querier_worker.Config           `yaml:"frontend_worker"`
	Frontend         frontend.CombinedFrontendConfig `yaml:"frontend"`
	IngestStorage    ingest.Config                   `yaml:"ingest_storage"`
	BlocksStorage    tsdb.BlocksStorageConfig        `yaml:"blocks_storage"`
	Compactor        compactor.Config                `yaml:"compactor"`
	StoreGateway     storegateway.Config             `yaml:"store_gateway"`
	TenantFederation tenantfederation.Config         `yaml:"tenant_federation"`
	ActivityTracker  activitytracker.Config          `yaml:"activity_tracker"`
	Vault            vault.Config                    `yaml:"vault"`

	Ruler               ruler.Config                               `yaml:"ruler"`
	RulerStorage        rulestore.Config                           `yaml:"ruler_storage"`
	Alertmanager        alertmanager.MultitenantAlertmanagerConfig `yaml:"alertmanager"`
	AlertmanagerStorage alertstore.Config                          `yaml:"alertmanager_storage"`
	RuntimeConfig       runtimeconfig.Config                       `yaml:"runtime_config"`
	MemberlistKV        memberlist.KVConfig                        `yaml:"memberlist"`
	QueryScheduler      scheduler.Config                           `yaml:"query_scheduler"`
	UsageStats          usagestats.Config                          `yaml:"usage_stats"`
	ContinuousTest      continuoustest.Config                      `yaml:"-"`
	OverridesExporter   exporter.Config                            `yaml:"overrides_exporter"`

	Common CommonConfig `yaml:"common"`

	TimeseriesUnmarshalCachingOptimizationEnabled bool `yaml:"timeseries_unmarshal_caching_optimization_enabled" category:"experimental"`
}

Config is the root config for Mimir.

func (*Config) CommonConfigInheritance

func (c *Config) CommonConfigInheritance() CommonConfigInheritance

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger)

RegisterFlags registers flags.

func (*Config) Validate

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

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

func (*Config) ValidateLimits

func (c *Config) ValidateLimits(limits validation.Limits) error

ValidateLimits validates the runtime limits that can be set for each tenant against static configs

type ConfigWithCommon

type ConfigWithCommon Config

ConfigWithCommon should be passed to yaml.Unmarshal to properly unmarshal Common values. We don't implement UnmarshalYAML on Config itself because that would disallow inlining it in other configs.

func (*ConfigWithCommon) UnmarshalYAML

func (c *ConfigWithCommon) UnmarshalYAML(value *yaml.Node) error

type Mimir

type Mimir struct {
	Cfg        Config
	Registerer prometheus.Registerer

	// set during initialization
	ServiceMap    map[string]services.Service
	ModuleManager *modules.Manager

	API                             *api.API
	Server                          *server.Server
	IngesterRing                    *ring.Ring
	IngesterPartitionRingWatcher    *ring.PartitionRingWatcher
	IngesterPartitionInstanceRing   *ring.PartitionInstanceRing
	TenantLimits                    validation.TenantLimits
	Overrides                       *validation.Overrides
	ActiveGroupsCleanup             *util.ActiveGroupsCleanupService
	Distributor                     *distributor.Distributor
	Ingester                        *ingester.Ingester
	Flusher                         *flusher.Flusher
	FrontendV1                      *frontendv1.Frontend
	RuntimeConfig                   *runtimeconfig.Manager
	QuerierQueryable                prom_storage.SampleAndChunkQueryable
	ExemplarQueryable               prom_storage.ExemplarQueryable
	MetadataSupplier                querier.MetadataSupplier
	QuerierEngine                   promql.QueryEngine
	QueryFrontendTripperware        querymiddleware.Tripperware
	QueryFrontendTopicOffsetsReader *ingest.TopicOffsetsReader
	QueryFrontendCodec              querymiddleware.Codec
	Ruler                           *ruler.Ruler
	RulerDirectStorage              rulestore.RuleStore
	RulerCachedStorage              rulestore.RuleStore
	Alertmanager                    *alertmanager.MultitenantAlertmanager
	Compactor                       *compactor.MultitenantCompactor
	StoreGateway                    *storegateway.StoreGateway
	StoreQueryable                  prom_storage.Queryable
	MemberlistKV                    *memberlist.KVInitService
	ActivityTracker                 *activitytracker.ActivityTracker
	Vault                           *vault.Vault
	UsageStatsReporter              *usagestats.Reporter
	ContinuousTestManager           *continuoustest.Manager
	BuildInfoHandler                http.Handler
}

Mimir is the root datastructure for Mimir.

func New

func New(cfg Config, reg prometheus.Registerer) (*Mimir, error)

New makes a new Mimir.

func (*Mimir) Run

func (t *Mimir) Run() error

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

Jump to

Keyboard shortcuts

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