in loadgen/cmd/otelbench/flags.go [257:288]
func ExporterConfigs(exporter string) (configFiles []string) {
var configSets []string
configSets = append(configSets, fmt.Sprintf("service.pipelines.logs.exporters=[%s]", exporter))
configSets = append(configSets, fmt.Sprintf("service.pipelines.metrics.exporters=[%s]", exporter))
configSets = append(configSets, fmt.Sprintf("service.pipelines.traces.exporters=[%s]", exporter))
if Config.ServerURLOTLP != nil {
configSets = append(configSets, fmt.Sprintf("exporters.otlp.endpoint=%s", Config.ServerURLOTLP))
}
if Config.ServerURLOTLPHTTP != nil {
configSets = append(configSets, fmt.Sprintf("exporters.otlphttp.endpoint=%s", Config.ServerURLOTLPHTTP))
}
if v := getAuthorizationHeaderValue(Config.APIKey, Config.SecretToken); v != "" {
configSets = append(configSets, fmt.Sprintf("exporters.%s.headers.Authorization=%s", exporter, v))
}
for k, v := range Config.Headers {
configSets = append(configSets, fmt.Sprintf("exporters.%s.headers.%s=%s", exporter, k, v))
}
// Only set insecure and insecure_skip_verify on true, so that corresponding config value in yaml is used on default.
if Config.Insecure {
configSets = append(configSets, fmt.Sprintf("exporters.%s.tls.insecure=%v", exporter, Config.Insecure))
}
if Config.InsecureSkipVerify {
configSets = append(configSets, fmt.Sprintf("exporters.%s.tls.insecure_skip_verify=%v", exporter, Config.InsecureSkipVerify))
}
return setsToConfigs(configSets)
}