func()

in loadgen/cmd/otelbench/remote_stats.go [122:136]


func (cfg elasticsearchTelemetryConfig) validate() error {
	if len(cfg.ElasticsearchURL) == 0 {
		return errors.New("remote stats will be ignored because of empty telemetry Elasticsearch URL")
	}
	if cfg.ElasticsearchAPIKey == "" && (cfg.ElasticsearchUserName == "" || cfg.ElasticsearchPassword == "") {
		return errors.New("remote stats will be ignored because of empty telemetry Elasticsearch API key and username or password")
	}
	if cfg.ElasticsearchIndex == "" {
		return errors.New("remote stats will be ignored because of empty telemetry Elasticsearch search index pattern")
	}
	if len(cfg.Metrics) == 0 {
		return errors.New("remote stats will be ignored because of empty telemetry metrics list")
	}
	return nil
}