diff --git a/pkg/loop/config.go b/pkg/loop/config.go index 223c86e33..24bb10b6a 100644 --- a/pkg/loop/config.go +++ b/pkg/loop/config.go @@ -111,7 +111,7 @@ func (e *EnvConfig) parse() error { if err != nil { return err } - e.TracingAttributes = getAttributes(envTracingAttribute) + e.TracingAttributes = getMap(envTracingAttribute) e.TracingSamplingRatio = getFloat64OrZero(envTracingSamplingRatio) e.TracingTLSCertPath = os.Getenv(envTracingTLSCertPath) } @@ -128,9 +128,9 @@ func (e *EnvConfig) parse() error { return fmt.Errorf("failed to parse %s: %w", envTelemetryEndpoint, err) } e.TelemetryCACertFile = os.Getenv(envTelemetryCACertFile) - e.TelemetryAttributes = getAttributes(envTelemetryAttribute) + e.TelemetryAttributes = getMap(envTelemetryAttribute) e.TelemetryTraceSampleRatio = getFloat64OrZero(envTelemetryTraceSampleRatio) - e.TelemetryAuthHeaders = getAttributes(envTelemetryAuthHeader) + e.TelemetryAuthHeaders = getMap(envTelemetryAuthHeader) } return nil } @@ -165,14 +165,14 @@ func getValidCollectorTarget() (string, error) { return tracingCollectorTarget, nil } -func getAttributes(envKeyPrefix string) map[string]string { - tracingAttributes := make(map[string]string) +func getMap(envKeyPrefix string) map[string]string { + m := make(map[string]string) for _, env := range os.Environ() { if strings.HasPrefix(env, envKeyPrefix) { - tracingAttributes[strings.TrimPrefix(env, envKeyPrefix)] = os.Getenv(env) + m[strings.TrimPrefix(env, envKeyPrefix)] = os.Getenv(env) } } - return tracingAttributes + return m } // Any errors in parsing result in a sampling ratio of 0.0.