Component(s)
exporter/dataset, exporter/elasticsearch, exporter/opensearch, receiver/dockerstats, receiver/podman
Describe the issue you're reporting
All collector's components must implement the component.ValidateConfig interface. During collector's startup, it goes through all components and calls the Validate method. Its execution is finished if any component returns an error. Nonetheless, some components call the Validate method during its initialization, which is redundant taking into account the collector life cycle. (e.g. Podman receiver)
I think that the Validate interface should be called by the configuration validator consumer (e.g. collector) instead of the configuration producers (components).
Context for Podman's receiver: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/32981/files#r1621849257
I linked to this issue the components that seems to be internally calling the configuration Validate method. I would not say calling Validate is forbidden, just that might be redundant during collector's execution. However, feel free to unlink your component from this issue if the Validate method call is necessary for your specific use case or if it performs additional checks that are not covered during the startup validation phase.
Component(s)
exporter/dataset, exporter/elasticsearch, exporter/opensearch, receiver/dockerstats, receiver/podman
Describe the issue you're reporting
All collector's components must implement the
component.ValidateConfiginterface. During collector's startup, it goes through all components and calls theValidatemethod. Its execution is finished if any component returns an error. Nonetheless, some components call the Validate method during its initialization, which is redundant taking into account the collector life cycle. (e.g. Podman receiver)I think that the
Validateinterface should be called by the configuration validator consumer (e.g. collector) instead of the configuration producers (components).Context for Podman's receiver: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/32981/files#r1621849257
I linked to this issue the components that seems to be internally calling the configuration
Validatemethod. I would not say callingValidateis forbidden, just that might be redundant during collector's execution. However, feel free to unlink your component from this issue if the Validate method call is necessary for your specific use case or if it performs additional checks that are not covered during the startup validation phase.