-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[exporter/datadog] Deprecate env
setting
#9017
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good to me, but users will have to read the comment in the code or this PR to know what they should use instead of env
. Should the warning include the recommended alternative/a link to the docs for deprecated settings?
If an user has a configuration like this: receivers:
otlp:
protocols:
grpc:
exporters:
datadog:
api:
key: aaaaaaaa
# ↓↓↓ Using env ↓↓↓
env: my-custom-env
service:
telemetry:
logs:
level: warn
pipelines:
metrics:
receivers: [otlp]
exporters: [datadog]
They will get a warning like this:
|
@@ -406,6 +408,9 @@ func (c *Config) Unmarshal(configMap *config.Map) error { | |||
if c.Version != "" { | |||
c.warnings = append(c.warnings, fmt.Errorf(deprecationTemplate, "version", "v0.52.0", 8783)) | |||
} | |||
if c.Env != "" { | |||
c.warnings = append(c.warnings, fmt.Errorf(deprecationTemplate, "env", "v0.52.0", 9016)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(the warning on the previous message comes from here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is super cool :D
Marking as ready to merge since albertvaka also works at Datadog |
Description:
Deprecate
env
setting in favor ofdeployment.environment
.Link to tracking Issue: #9016
Testing: Tested that a deprecation warning is logged when using this setting.
Documentation: Removed usage of
env
from examples.