Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[exporter/datadog] Modify deprecation messages to reflect new plan #9422

Merged
merged 4 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- `basicauthextension`: Implement `configauth.ClientAuthenticator` so that the extension can also be used as HTTP client basic authenticator.(#8847)
- `azuremonitorexporter`, `lokiexporter`, `observiqexporter`: Update timestamp processing logic (#9130)
- `cumulativetodeltaprocessor`: add new include/exclude configuration options with regex support (#8952)
- `datadogexporter`: Update deprecation messages to reflect new deprecation plan (#9422)
- `cmd/mdatagen`: Update generated functions to have simple parse function to handle string parsing consistently and limit code duplication across receivers (#7574)
- `attributesprocessor`: Support filter by severity (#9132)
- `processor/transform`: Add transformation of logs (#9368)
Expand Down
2 changes: 1 addition & 1 deletion exporter/datadogexporter/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ func (c *Config) Unmarshal(configMap *config.Map) error {
// Add warnings about autodetected environment variables.
c.warnings = append(c.warnings, warnUseOfEnvVars(configMap, c)...)

deprecationTemplate := "%q has been deprecated and will be removed in %s. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/%d"
deprecationTemplate := "%q has been deprecated and will be removed in %s or later. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/%d"
if c.Service != "" {
c.warnings = append(c.warnings, fmt.Errorf(deprecationTemplate, "service", "v0.52.0", 8781))
}
Expand Down
4 changes: 2 additions & 2 deletions exporter/datadogexporter/config/warn_envvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func futureDefaultConfig() *Config {
// explicitly on configuration instead.
func errUsedEnvVar(settingName, envVarName string) error {
return fmt.Errorf(
"%q will not default to %q's value starting on v0.50.0. Set %s: ${%s} to remove this warning",
"%q will not default to %q's value in a future minor version. Set %s: ${%s} to remove this warning",
settingName,
envVarName,
settingName,
Expand Down Expand Up @@ -145,7 +145,7 @@ func warnUseOfEnvVars(configMap *config.Map, cfg *Config) (warnings []error) {
warnings = append(warnings, errUsedEnvVar("traces.endpoint", "DD_APM_URL"))
}
if tagsDiffer(cfg.GetHostTags(), futureCfg.GetHostTags()) {
warnings = append(warnings, fmt.Errorf("\"tags\" will not default to \"DD_TAGS\"'s value starting on v0.50.0. Use 'env' configuration source instead to remove this warning"))
warnings = append(warnings, fmt.Errorf("\"tags\" will not default to \"DD_TAGS\"'s value in a future minor version. Use 'env' configuration source instead to remove this warning"))
}

if len(warnings) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion exporter/datadogexporter/config/warning_deprecated.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var removedSettings = []renameError{}
// Error implements the error interface.
func (e renameError) Error() string {
return fmt.Sprintf(
"%q has been deprecated in favor of %q and will be removed in %s. See github.com/open-telemetry/opentelemetry-collector-contrib/issues/%d",
"%q has been deprecated in favor of %q and will be removed in %s or later. See github.com/open-telemetry/opentelemetry-collector-contrib/issues/%d",
e.oldName,
e.newName,
e.oldRemovedIn,
Expand Down
4 changes: 2 additions & 2 deletions exporter/datadogexporter/config/warning_deprecated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestDeprecationSendMonotonic(t *testing.T) {
}),
expectedMode: CumulativeMonotonicSumModeToDelta,
warnings: []string{
"\"metrics::send_monotonic_counter\" has been deprecated in favor of \"metrics::sums::cumulative_monotonic_mode\" and will be removed in v0.50.0. See github.com/open-telemetry/opentelemetry-collector-contrib/issues/8489",
"\"metrics::send_monotonic_counter\" has been deprecated in favor of \"metrics::sums::cumulative_monotonic_mode\" and will be removed in v0.50.0 or later. See github.com/open-telemetry/opentelemetry-collector-contrib/issues/8489",
},
},
{
Expand All @@ -62,7 +62,7 @@ func TestDeprecationSendMonotonic(t *testing.T) {
}),
expectedMode: CumulativeMonotonicSumModeRawValue,
warnings: []string{
"\"metrics::send_monotonic_counter\" has been deprecated in favor of \"metrics::sums::cumulative_monotonic_mode\" and will be removed in v0.50.0. See github.com/open-telemetry/opentelemetry-collector-contrib/issues/8489",
"\"metrics::send_monotonic_counter\" has been deprecated in favor of \"metrics::sums::cumulative_monotonic_mode\" and will be removed in v0.50.0 or later. See github.com/open-telemetry/opentelemetry-collector-contrib/issues/8489",
},
},
{
Expand Down