Documentation
¶
Index ¶
- func ValidateConfig(cfg *Config) error
- type BackendWorker
- func (w *BackendWorker) BlockRetentionForTenant(tenantID string) time.Duration
- func (w *BackendWorker) CompactionDisabledForTenant(tenantID string) bool
- func (w *BackendWorker) MaxBytesPerTraceForTenant(tenantID string) int
- func (w *BackendWorker) MaxCompactionRangeForTenant(tenantID string) time.Duration
- func (w *BackendWorker) OnRingInstanceHeartbeat(*ring.BasicLifecycler, *ring.Desc, *ring.InstanceDesc)
- func (w *BackendWorker) OnRingInstanceRegister(_ *ring.BasicLifecycler, ringDesc ring.Desc, instanceExists bool, _ string, ...) (ring.InstanceState, ring.Tokens)
- func (w *BackendWorker) OnRingInstanceStopping(*ring.BasicLifecycler)
- func (w *BackendWorker) OnRingInstanceTokens(*ring.BasicLifecycler, ring.Tokens)
- func (w *BackendWorker) Owns(hash string) bool
- func (w *BackendWorker) RecordDiscardedSpans(count int, tenantID string, traceID string, rootSpanName string, ...)
- type Config
- type RingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateConfig ¶
Types ¶
type BackendWorker ¶
type BackendWorker struct {
services.Service
Ring *ring.Ring
// contains filtered or unexported fields
}
func New ¶
func New(cfg Config, schedulerClientCfg backendscheduler_client.Config, store storage.Store, overrides overrides.Interface, reg prometheus.Registerer) (*BackendWorker, error)
func (*BackendWorker) BlockRetentionForTenant ¶
func (w *BackendWorker) BlockRetentionForTenant(tenantID string) time.Duration
BlockRetentionForTenant implements CompactorOverrides
func (*BackendWorker) CompactionDisabledForTenant ¶
func (w *BackendWorker) CompactionDisabledForTenant(tenantID string) bool
CompactionDisabledForTenant implements CompactorOverrides
func (*BackendWorker) MaxBytesPerTraceForTenant ¶
func (w *BackendWorker) MaxBytesPerTraceForTenant(tenantID string) int
func (*BackendWorker) MaxCompactionRangeForTenant ¶
func (w *BackendWorker) MaxCompactionRangeForTenant(tenantID string) time.Duration
func (*BackendWorker) OnRingInstanceHeartbeat ¶
func (w *BackendWorker) OnRingInstanceHeartbeat(*ring.BasicLifecycler, *ring.Desc, *ring.InstanceDesc)
OnRingInstanceHeartbeat is called while the instance is updating its heartbeat in the ring.
func (*BackendWorker) OnRingInstanceRegister ¶
func (w *BackendWorker) OnRingInstanceRegister(_ *ring.BasicLifecycler, ringDesc ring.Desc, instanceExists bool, _ string, instanceDesc ring.InstanceDesc) (ring.InstanceState, ring.Tokens)
OnRingInstanceRegister is called while the lifecycler is registering the instance within the ring and should return the state and set of tokens to use for the instance itself.
func (*BackendWorker) OnRingInstanceStopping ¶
func (w *BackendWorker) OnRingInstanceStopping(*ring.BasicLifecycler)
OnRingInstanceStopping is called while the lifecycler is stopping. The lifecycler will continue to heartbeat the ring the this function is executing and will proceed to unregister the instance from the ring only after this function has returned.
func (*BackendWorker) OnRingInstanceTokens ¶
func (w *BackendWorker) OnRingInstanceTokens(*ring.BasicLifecycler, ring.Tokens)
OnRingInstanceTokens is called once the instance tokens are set and are stable within the ring (honoring the observe period, if set).
func (*BackendWorker) Owns ¶
func (w *BackendWorker) Owns(hash string) bool
func (*BackendWorker) RecordDiscardedSpans ¶
type Config ¶
type Config struct {
BackendSchedulerAddr string `yaml:"backend_scheduler_addr"`
Backoff backoff.Config `yaml:"backoff"`
Compactor tempodb.CompactorConfig `yaml:"compaction"`
OverrideRingKey string `yaml:"override_ring_key"`
Ring RingConfig `yaml:"ring,omitempty"`
FinishOnShutdownTimeout time.Duration `yaml:"finish_on_shutdown_timeout"`
}
type RingConfig ¶
type RingConfig struct {
KVStore kv.Config `yaml:"kvstore"`
HeartbeatPeriod time.Duration `yaml:"heartbeat_period"`
HeartbeatTimeout time.Duration `yaml:"heartbeat_timeout"`
// Wait ring stability.
WaitStabilityMinDuration time.Duration `yaml:"wait_stability_min_duration"`
WaitStabilityMaxDuration time.Duration `yaml:"wait_stability_max_duration"`
// Instance details
InstanceID string `yaml:"instance_id" doc:"hidden"`
InstanceInterfaceNames []string `yaml:"instance_interface_names"`
InstancePort int `yaml:"instance_port" doc:"hidden"`
InstanceAddr string `yaml:"instance_addr" doc:"hidden"`
EnableInet6 bool `yaml:"enable_inet6"`
// Injected internally
ListenPort int `yaml:"-"`
WaitActiveInstanceTimeout time.Duration `yaml:"wait_active_instance_timeout"`
ObservePeriod time.Duration `yaml:"-"`
}
RingConfig masks the ring lifecycler config which contains many options not really required by the worker's ring. This config is used to strip down the config to the minimum, and avoid confusion to the user.
func (*RingConfig) RegisterFlags ¶
func (cfg *RingConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
func (*RingConfig) ToLifecyclerConfig ¶
func (cfg *RingConfig) ToLifecyclerConfig() ring.LifecyclerConfig
ToLifecyclerConfig returns a LifecyclerConfig based on the backend-worker ring config.