Validate initializes and validates the remote write configurations. This must be called once at startup before any tenant storage instances are created, so that NameValidationScheme is set on all write relabel configs. Without this, relabeling panics with "Invalid name validation scheme requested: u
()
| 33 | // that NameValidationScheme is set on all write relabel configs. Without this, |
| 34 | // relabeling panics with "Invalid name validation scheme requested: unset". |
| 35 | func (cfg *Config) Validate() error { |
| 36 | for i := range cfg.RemoteWrite { |
| 37 | if err := cfg.RemoteWrite[i].Validate(model.UTF8Validation); err != nil { |
| 38 | return fmt.Errorf("invalid remote write config %q: %w", cfg.RemoteWrite[i].Name, err) |
| 39 | } |
| 40 | } |
| 41 | return nil |
| 42 | } |
| 43 | |
| 44 | func (cfg *Config) RegisterFlagsAndApplyDefaults(string, *flag.FlagSet) { |
| 45 | cfg.Wal = agentDefaultOptions() |