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

Clearly separate Config and Settings terms used in struct names throughout the codebase

Open dmitryax opened this issue 2 years ago • 5 comments
trafficstars

Currently, we use the Config term for collector configuration as a whole and parts of it defined for receivers/processors/exporters/extensions. Examples:

  • otelcol.Config
  • component.Config
  • otlpexporter.Config

But for unmarshalling some deeper parts of the user config, we use Settings structs, for example:

  • [ ] exporterhelper.QueueSettings
  • [x] configgrpc.GRPCClientSettings
  • [x] configtls.TLSSetting

At the same time service/telemetry package still uses Config, e.g. MetricsConfig, LogsSamplingConfig, and TracesConfig.

The suggestion is to use Config term for all the structs used to unmarshal any parts of the YAML config provided by users. We will keep Settings only for structs that are populated programmatically, like:

  • component.TelemetrySettings
  • component.ReceiverSettings

dmitryax avatar Dec 13 '22 00:12 dmitryax

I think we should start working on this, because we cannot delay until the stability.

bogdandrutu avatar Dec 12 '23 23:12 bogdandrutu

List of renames:

  • [x] #9402
  • [x] #9403
  • [x] #9404
  • [x] #9405
  • [x] #9392
  • [x] #9393 - on hold, might be part of bigger refactor
  • [x] #9391 - on hold, might be part of bigger refactor
  • [x] #9401

atoulme avatar Jan 25 '24 07:01 atoulme

Removing from the confighttp milestone as the public structs now use Config.

TylerHelmuth avatar Feb 23 '24 20:02 TylerHelmuth

Closing this in favour of https://github.com/open-telemetry/opentelemetry-collector/issues/9428

codeboten avatar Apr 17 '24 18:04 codeboten

exporterhelper still needs updating

codeboten avatar Jun 05 '24 16:06 codeboten

We still need to update:

  • exporterhelper.TimeoutSettings
  • NewDefaultTimeoutSettings
  • exporterhelper.QueueSettings
  • NewDefaultQueueSettings

mx-psi avatar Sep 09 '24 12:09 mx-psi

I'll work on this.

jade-guiton-dd avatar Sep 09 '24 12:09 jade-guiton-dd

If I'm not mistaken, #11264 was the last step for this issue, so it can probably be closed.

jade-guiton-dd avatar Oct 01 '24 13:10 jade-guiton-dd

Taking a look at the output of rg 'type \w*Setting' -tgo -i it looks like this is indeed the case :rocket:

mx-psi avatar Oct 01 '24 14:10 mx-psi