<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
<!-- Issue number if applicable -->
Changes the underlying type of `component.Kind` to be closer to
[`pipeline.Signal`](https://pkg.go.dev/go.opentelemetry.io/collector/pipeline#Signal).
Right now the type is defined within `component`, but it could be moved
to an internal module so that we could have a different module exposing
other value on this enum.
This is already doable today, the only thing this PR gives us is
1. slightly more flexibility on things like making the concept of kind
more complex (e.g. adding an adjective to a kind).
2. restricting external consumers from implementing their own component
kinds without our explicit approval (with some kind of API we design)
I am not convinced this is _necessary_ to do, but we may as well do it.
This is technically a breaking change since `component.Kind(42)` was a
valid expression and it no longer is. I think this is extremely rare, so
I suggest if we go ahead we do so in one go.
#### Link to tracking issue
Fixes#11443
After reviewing the 6 month period, the period seems too long to get
feedback on whether an unmaintained component should be removed. I'm
proposing shortening it to 3 months.
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This PR also starts using the fact that StabilityLevel implements
UnmarshalText and cleans up the mdatagen stability structure.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.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>
This change updates values returned by `StabilityLevel.String` to be consistent with other enum types:
- All returned strings are capitalized.
- "Undefined" is returned only for `StabilityLevelUndefined`.
- "" is returned for integers that are out of StabilityLevel enum range.
* Remove use of unnecessary internal interface in factory
This PR does not change the design (which is to not allow external implementation),
but simplifies the way how this is achieved, now that the helpers are in the same package.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Use baseFactory to implement Type() func
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This change fixes inconsistencies in component interfaces. Motivation:
- Uniformness results in reduction of code that currently has to
deal with differences.
- Processor.Start is missing and is important for allowing processors
to communicate with the Host.
What's changed:
- Introduced Component interface.
- Unified Host interface.
- Added a Start function to processors (via Component interface).
- Start/Shutdown is now called for Processors from service start/shutdown.
- Receivers, Exporters, Processors, Extensions now embed Component interface.
- Replaced StartTraceReception/StartMetricsReception by single Start function for receivers.
- Replaced StopTraceReception/StopMetricsReception by single Shutdown function for receivers.
Note: before merging this we need to announce the change in Gitter since it
breaks existing implementations in contrib (although the fix is easy).
Resolves#477Resolves#262