<!--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 -->
Error out on mismatched type for all component kinds. Same as #12305 but
for all component kinds.
#### Link to tracking issue
Requires #12357Fixes#12221
<!--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 -->
Remove deprecated symbols
#### Link to tracking issue
Updates #12222, #12305, #11524
#### Description
At the moment, `receiver`, `scraper`, `processor`, `exporter`, and
`extension` each have their own version of the `MakeFactoryMap`
function, which takes a list of Factories and returns it as a map, with
the component name as the key (and an error if there is overlap).
Because all versions are near-identical except for the Factory type
used, and this function is only used in tests and in the code generated
by OCB (`components.go`), it was suggested to make it generic and move
it to the `otelcol` package.
This PR does exactly that. The old `MakeFactoryMap` functions are
deprecated (and may be removed alongside their tests in a future
release). I also had to make a few other odd changes to fit the new
dependency graph.
#### Link to tracking issue
Resolves#12222
---------
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
<!--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 -->
Deprecate `Create*` methods. This is a small part of #12305, but applied
to all other component kinds
#### Link to tracking issue
Updates #12221
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>
#### Description
This moves the receiver builder out of the `receiver` package, and into
`service/internal/builders`.
There's no real reason for this struct to be public (folks shouldn't
call it), and making it private will allow us to add profiling support
to it.
#### Link to tracking issue
https://github.com/open-telemetry/opentelemetry-collector/pull/10375#pullrequestreview-2144929463
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This splits the receiver package, so the APIs are in an internal
package, and redefined publicly for logs/metrics/traces.
In preparation for adding profiles to the package.
<!-- Issue number if applicable -->
#### Link to tracking issue
See https://github.com/open-telemetry/opentelemetry-collector/pull/10375
cc @mx-psi
This deprecates CreateSettings in favour of Settings.
NewNopCreateSettings is also being deprecated in favour of
NewNopSettings
Part of #9428
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.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>
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.
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
* Remove memory limiting changes
We paused on that until further design conversations, in order to avoid confusion with this incomplete feature let's remove it from the code base.
* Recover test that covered more than back presssure
* gofmt config_test.go
Refactored oc exporter code to make it easier to import in derived
builds without copying all the code.
Example derived exporter: https://github.com/owais/example-derived-oc-exporter
- Moved internal/compression to root
- Split opencensusexporter factory's `CreateTraceExporter` method into
- `OCAgentOptions` and `CreateOCAgent`
Add Receiver Host Interface
This interface allows better communication between receivers and the code hosting them. This becomes important when the host needs to request receivers to stop ingestion due to limited resources.
* Change census-instrumentation to open-telemetry and update authors
census-instrumentation/opencensus is now open-telemetry/opentelemetry
"OpenCensus Authors" is now "OpenTelemetry Authors"
"Copyright 2018" is now "Copyright 2019"
Fix go fmt
* Make all receivers take "next" on creation
This is required in order to move the code to use factories for the receivers. The "next" parameter will be passed to the factory and then to the receiver constructor, this way Start[Trace|Metrics]Reception doesn't need the next parameter anymore. Since typically the Start* methods launch goroutines took the opportunity to add a channel to report asynchronous errors.
Opportunistic change: renamed WrapWithSpanSink and related variables.
Remaing items from previous commit
* Improve test coverage for zipkin-scribe
Improving code coverage for zipkin-scribe that went a tad down with the initial PR.
* Improve a little code coverage zipkin receiver
* Fix test broken during rebase
* Rename [Trace|Metrics]DataProcessor to [Trace|Metrics]Processor
* Rename TraceProcessor to TraceConsumer as discussed.
* Add empty_test for processor.