diff --git a/CHANGELOG.md b/CHANGELOG.md index 731c9e5239..170f2ac106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ - (Splunk) Add a new discovery bundle for Envoy proxy metrics ([#5780](https://github.com/signalfx/splunk-otel-collector/pull/5780)) +### 🧰 Bug fixes 🧰 + +- (Splunk) Fix deprecation warning for multiline config source calls ([#5829](https://github.com/signalfx/splunk-otel-collector/pull/5829)) + ## v0.116.0 This Splunk OpenTelemetry Collector release includes changes from the [opentelemetry-collector v0.116.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.116.0) and the [opentelemetry-collector-contrib v0.116.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.116.0) releases where appropriate. diff --git a/internal/configsource/source.go b/internal/configsource/source.go index 22c1b6cb65..44c9b8ae9f 100644 --- a/internal/configsource/source.go +++ b/internal/configsource/source.go @@ -368,10 +368,18 @@ func resolveStringValue(ctx context.Context, configSources map[string]ConfigSour } default: if deprecatedFormUsed { - printDeprecationWarningOnce(fmt.Sprintf( - "[WARNING] Config source expansion formatted as $uri:selector has been deprecated, "+ - "use ${uri:selector[?params]} instead. Please replace $%s with ${%s} in your configuration", - expandableContent, expandableContent)) + if strings.Contains(expandableContent, "\n") { + printDeprecationWarningOnce(fmt.Sprintf( + "[WARNING] Calling config sources in multiline format is deprecated. "+ + "Please convert the following call to the one-line format ${uri:selector?param1"+ + "=value1,param2=value2}:\n %s", + expandableContent)) + } else { + printDeprecationWarningOnce(fmt.Sprintf( + "[WARNING] Config source expansion formatted as $uri:selector has been deprecated, "+ + "use ${uri:selector[?params]} instead. Please replace $%s with ${%s} in your configuration", + expandableContent, expandableContent)) + } } } }