#### Description
[whitespace](https://golangci-lint.run/usage/linters/#whitespace) is a
linter that checks for unnecessary newlines at the start and end of
functions.
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This change makes the names to be more "Go" friendly. Also it will not
become an issue that types will try to implement different Factory types
(receiver,processor) because that is forbidden because of our design.
This also makes the names consistent with connector.Factory.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Resolves#10570
Alternative to #10598
This implementation is more reliable that #10598 because it gets
information directly from the builder manifest. It relies on additional
structure in the `component.go` file, ultimately encoded in
`otelcol.Factories`.
An alternative would be to push the enhancements deeper, into the
`<kind>.Factories` implementations, so that the module information is
available directly alongside the Factory.
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
This change adds another layer of validation to pipelines. It validates
that all the components in a pipeline are of the same type as the
pipeline.
For example, if a `metrics` pipeline contains a `traces`-only receiver,
the `otelcol validate -config ...` command will fail.
**Link to tracking Issue:**
Fixes#8007.
**Testing:**
Added unit test + existing tests are passing.
**Documentation:**
godoc.
---------
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
The factories for the components are created before the CLI flags are
evaluated. Therefore, featuregate flags are ignored during the early
startup phase.
~This PR simply shifts the time of creation of the factory map after the
CLI flag evaluation.~
Closes https://github.com/open-telemetry/opentelemetry-collector/issues/4967
**Testing:**
Short manual testing via cli. Adding the following line in
`cobra.Command.RunE`.
```golang
featuregate.GlobalRegistry().VisitAll(func(fg *featuregate.Gate) { fmt.Println(fg.ID(), fg.IsEnabled()) })
```
Changing `+` & `-`:
```bash
./bin/otelcorecol_linux_amd64 --config=config.yaml --feature-gates=+telemetry.disableHighCardinalityMetrics
```
---------
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
Signed-off-by: Alex Boten <aboten@lightstep.com>
Co-authored-by: Alex Boten <aboten@lightstep.com>
* [chore] use license shortform
To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052
Signed-off-by: Alex Boten <aboten@lightstep.com>
* make goporto
Signed-off-by: Alex Boten <aboten@lightstep.com>
---------
Signed-off-by: Alex Boten <aboten@lightstep.com>