opentelemetry-collector
opentelemetry-collector copied to clipboard
Add `NewDefaultFoo` for configurations
trafficstars
[...] We should add a `NewDefaultFoo` for all configs, so that we can easily add new fields and set the right default value.
So we can say that in order to guarantee "backwards compatible behavior" user should always initialize the config with default and overwrite anything as needed instead of creating a struct with "initial value" and leave others unset.
Originally posted by @bogdandrutu in https://github.com/open-telemetry/opentelemetry-collector/issues/9478#issuecomment-1930475996
We should add this to the contributing guidelines and, once approved, create subissues to address this on configtls, configgrpc and confighttp.