mimir

package
v0.0.0-...-1e903e4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 104 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"
	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 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" doc:"hidden"`
	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 flag.

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
	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.

type OpenTelemetryProviderBridge

type OpenTelemetryProviderBridge struct {
	// TracerProvider is the fallback trace.TracerProvider used for functions not implemented
	// by our custom one (even if we aim to implement all of them). OpenTelemetry library
	// requires one (compilation fails without it).
	noop.TracerProvider
	// contains filtered or unexported fields
}

func NewOpenTelemetryProviderBridge

func NewOpenTelemetryProviderBridge(tracer opentracing.Tracer) *OpenTelemetryProviderBridge

func (*OpenTelemetryProviderBridge) Tracer

Tracer creates an implementation of the Tracer interface. The instrumentationName must be the name of the library providing instrumentation. This name may be the same as the instrumented code only if that code provides built-in instrumentation. If the instrumentationName is empty, then a implementation defined default name will be used instead.

This method must be concurrency safe.

type OpenTelemetrySpanBridge

type OpenTelemetrySpanBridge struct {
	// Span is the fallback trace.Span used for functions not implemented
	// by our custom one (even if we aim to implement all of them). OpenTelemetry library
	// requires one (compilation fails without it).
	noop.Span
	// contains filtered or unexported fields
}

func NewOpenTelemetrySpanBridge

func NewOpenTelemetrySpanBridge(span opentracing.Span, provider trace.TracerProvider) *OpenTelemetrySpanBridge

func (*OpenTelemetrySpanBridge) AddEvent

func (s *OpenTelemetrySpanBridge) AddEvent(name string, options ...trace.EventOption)

AddEvent adds an event with the provided name and options.

func (*OpenTelemetrySpanBridge) End

func (s *OpenTelemetrySpanBridge) End(options ...trace.SpanEndOption)

End completes the Span. The Span is considered complete and ready to be delivered through the rest of the telemetry pipeline after this method is called. Therefore, updates to the Span are not allowed after this method has been called.

func (*OpenTelemetrySpanBridge) IsRecording

func (s *OpenTelemetrySpanBridge) IsRecording() bool

IsRecording returns the recording state of the Span. It will return true if the Span is active and events can be recorded.

func (*OpenTelemetrySpanBridge) RecordError

func (s *OpenTelemetrySpanBridge) RecordError(err error, options ...trace.EventOption)

RecordError will record err as an exception span event for this span. An additional call to SetStatus is required if the Status of the Span should be set to Error, as this method does not change the Span status. If this span is not being recorded or err is nil then this method does nothing.

func (*OpenTelemetrySpanBridge) SetAttributes

func (s *OpenTelemetrySpanBridge) SetAttributes(kv ...attribute.KeyValue)

SetAttributes sets kv as attributes of the Span. If a key from kv already exists for an attribute of the Span it will be overwritten with the value contained in kv.

func (*OpenTelemetrySpanBridge) SetName

func (s *OpenTelemetrySpanBridge) SetName(name string)

SetName sets the Span name.

func (*OpenTelemetrySpanBridge) SetStatus

func (s *OpenTelemetrySpanBridge) SetStatus(code codes.Code, description string)

SetStatus sets the status of the Span in the form of a code and a description, overriding previous values set. The description is only included in a status when the code is for an error.

func (*OpenTelemetrySpanBridge) SpanContext

func (s *OpenTelemetrySpanBridge) SpanContext() trace.SpanContext

SpanContext returns the SpanContext of the Span. The returned SpanContext is usable even after the End method has been called for the Span.

func (*OpenTelemetrySpanBridge) TracerProvider

func (s *OpenTelemetrySpanBridge) TracerProvider() trace.TracerProvider

TracerProvider returns a TracerProvider that can be used to generate additional Spans on the same telemetry pipeline as the current Span.

type OpenTelemetryTracerBridge

type OpenTelemetryTracerBridge struct {
	// Tracer is the fallback trace.Tracer used for functions not implemented
	// by our custom one (even if we aim to implement all of them). OpenTelemetry library
	// requires one (compilation fails without it).
	noop.Tracer
	// contains filtered or unexported fields
}

func NewOpenTelemetryTracerBridge

func NewOpenTelemetryTracerBridge(tracer opentracing.Tracer, provider trace.TracerProvider) *OpenTelemetryTracerBridge

func (*OpenTelemetryTracerBridge) Start

Start creates a span and a context.Context containing the newly-created span.

If the context.Context provided in `ctx` contains a Span then the newly-created Span will be a child of that span, otherwise it will be a root span. This behavior can be overridden by providing `WithNewRoot()` as a SpanOption, causing the newly-created Span to be a root span even if `ctx` contains a Span.

When creating a Span it is recommended to provide all known span attributes using the `WithAttributes()` SpanOption as samplers will only have access to the attributes provided when a Span is created.

Any Span that is created MUST also be ended. This is the responsibility of the user. Implementations of this API may leak memory or other resources if Spans are not ended.

Jump to

Keyboard shortcuts

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