opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Add `NewDefaultFoo` for configurations

Open mx-psi opened this issue 1 year ago • 0 comments
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.

mx-psi avatar Feb 07 '24 09:02 mx-psi