mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* [backend-scheduler] require minimum time between tenant sorting * [backend-scheduler] remove compaction.backoff configuration * Rename metric for clarity * Generate config manifest * Update changelog * Update changelog * Move log message * Include additional guidance for minimum cycle interval * Include additional guidance for minimum cycle interval
36 lines
967 B
Go
36 lines
967 B
Go
package provider
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
|
|
"github.com/grafana/tempo/pkg/util"
|
|
)
|
|
|
|
// Config contains configuration for all providers
|
|
type Config struct {
|
|
Retention RetentionConfig `yaml:"retention"`
|
|
Compaction CompactionConfig `yaml:"compaction"`
|
|
}
|
|
|
|
func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet) {
|
|
cfg.Retention.RegisterFlagsAndApplyDefaults(util.PrefixConfig(prefix, "work"), f)
|
|
cfg.Compaction.RegisterFlagsAndApplyDefaults(util.PrefixConfig(prefix, "work"), f)
|
|
}
|
|
|
|
func ValidateConfig(cfg *Config) error {
|
|
if cfg.Compaction.MaxJobsPerTenant <= 0 {
|
|
return fmt.Errorf("max_jobs_per_tenant must be greater than 0")
|
|
}
|
|
|
|
if cfg.Compaction.MinCycleInterval <= 0 {
|
|
return fmt.Errorf("min_cycle_interval must be greater than 0, and should be at least half the blocklist_poll cycle for general use")
|
|
}
|
|
|
|
if cfg.Compaction.MeasureInterval <= 0 {
|
|
return fmt.Errorf("measure_interval must be greater than 0")
|
|
}
|
|
|
|
return nil
|
|
}
|