func()

in cmd/otelinmemexporter/store.go [117:134]


func (cfg *AggregationConfig) validate() error {
	if cfg.Name == "" {
		return errors.New("aggregation config must have name")
	}
	if cfg.Key == "" {
		return errors.New("aggregation config must have key")
	}
	if !cfg.Type.IsValid() {
		return fmt.Errorf("aggregation config %s invalid type: %s", cfg.Key, cfg.Type)
	}
	if cfg.Type == Percentile {
		if cfg.Percentile <= 0 || cfg.Percentile > 100 {
			return fmt.Errorf("aggregation config %s invalid aggregation percentile %f", cfg.Key, cfg.Percentile)
		}
	}

	return nil
}