* Add maps iterators similar with MapIter in reflect
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Try to use iterate with callback.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.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.
* Refactor include/exclude processor logic and add it to span processor.
* Add files containing common logic.
* Move matching and attribute functions to internal
This adds "to_attributes" functionality that complements already
existing "from_attributes" functionality. This is very useful for
extracting attributes from span names and reducing cardinality of
span names.
For usage and examples see rocessor/spanprocessor/config.go and
processor/spanprocessor/testdata/config.yaml.
Testing: unit tests added.
Documentation: see readme.md, config.go and config.yaml
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
This is part 1 of the task to introduce capabilities and declare
processor's intent to mutate or not mutate consumed data for the
purpose of optimizing pipeline data ownership.
If a processor declares that they mutate data the pipeline
that the processor is in will use cloning fan out connector.
This is done only if the pipeline shares a receiver with another
pipeline.
This ensures that it is safe for processor modify the data (because
pipelines work concurrently) and avoids cloning for pipelines that
consume data from the same receiver but do not modify it.
For more details see:
https://github.com/open-telemetry/opentelemetry-collector/issues/372