Commit Graph

61 Commits

Author SHA1 Message Date
Bogdan Drutu c6991e948e
Add new FactoryUnmarshaler support to all components, deprecate old way (#1468)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-08-04 13:52:42 -07:00
Bruno Garcia 8aa2731844
Remove year from copyright (#964) 2020-05-26 12:44:22 -04:00
Bogdan Drutu a637b41c22
Change entire repo to use the new vanityurl go.opentelemetry.io/collector (#977)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-15 12:04:05 -07:00
Tigran Najaryan 676261f153
Allow components to discover Exporters (#890)
Host.GetExporters now allows components to discover exporters.
This will be used by upcoming receivers that need to cooperate
with exporters.
2020-04-29 21:43:36 -04:00
Tigran Najaryan 9d16f5971e
Declare component Type as a type alias (#860)
We previously used string in the codebase to represent component type
(as it is known to factories and referred to in the config).

Now we have configmodels.Type alias that provides stronger compile-time
type checks.

This is a breaking change for components but fixing the components is easy.

Resolves: https://github.com/open-telemetry/opentelemetry-collector/issues/762
2020-04-24 11:55:04 -04:00
Tigran Najaryan dfe2c814d2
Allow components to discover Extensions (#810)
Host.GetExtensions now allows components to discover extensions.
This will be used by upcoming receivers that need to cooperate
with extensions.
2020-04-09 12:46:45 -04:00
Bogdan Drutu 0bc0d57022
Add context to start and stop methods in the component (#790)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-06 10:59:17 -07:00
Paulo Janotti 238996b51e
Remove Context() from component.Host interface (#777)
It doesn't make sense to have this method on `component.Host`. Currently, the only usages are in `Start` methods, later we can add it to `Start` if we want to support timeout or cancellation. See https://github.com/open-telemetry/opentelemetry-collector/pull/748#discussion_r402690039
2020-04-03 20:15:55 -04:00
Tigran Najaryan c3411f50cd
Allow getting factories from component Host (#748)
Added GetFactory function to Host interface. This allows components
to fetch factories and create components dynamically. The functionality
will be used by receiver creator that creates and destroys other receivers
as it discovers relevant external endpoints from which these receivers
can get data.
2020-04-01 16:42:30 -04:00
Tigran Najaryan c931b9875f
Refactor component and factory interface definitions (#683)
As we are preparing for Beta release we want to cleanup publicly exported
types and interfaces and do all necessary refactoring and breaking changes
now, before the Beta release. We will have a lot less leeway for breaking
changes after the Beta release.

Component related type declarations are now all in the `component` package.
This makes it possible for the interfaces to reference each other. This
was were very restricted earlier because component interfaces were in 5
different packages and many proposals were impossible to implement because
they would result in circular dependencies between packages.

(An example upcoming new capability that is enabled by this refactoring
is for components to query the Host for other components and for factories).

List of changes in this commit:

- Move all factory interfaces and component interfaces to component package.
- Rename old factories and components interfaces to use "Old" suffix for clarity.
- Eliminate forced checks that components implement factories. This is already
  enforced by the compiler when the factory is added to the Defaults() and
  was unnecessary code.
- Eliminated some unnecessary codes (removed overall over 200 lines).
- Run `go mod tidy` on testbed.

Warning: this is a breaking change to publicly exported types and function
signatures. We announced that a breaking change is comming. Once we agree
to merge this commit we will need to announce the exact list of changes
and guide component authors to modify their components accordingly.

Future changes:
- Once all components are migrated to the new internal representation,
  delete all "Old"-suffixed definitions. This will likely be done while
  we are still in Beta phase, before the Stable release.
2020-03-25 13:43:35 -04:00
Tigran Najaryan 91728bc8ce
Make component interfaces uniform (#488)
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 #477
Resolves #262
2020-01-10 08:49:34 -05:00