Commit Graph

28 Commits

Author SHA1 Message Date
Akash Suresh caadbbc476
Decentralize component documentation (#1089)
* Split out processor READMEs

* Split out exporter READMEs

* Split out extension READMEs

* Split out receiver READMEs

* Add new line at end of READMEs
2020-06-05 11:33:32 -07:00
Annie Fu 91b54ef544
Make MatchSpan implementation use FilterSet package (#978)
The MatchSpan interface is used by the attributes/span processor,
however this change does not change the yaml configuration or behavior,
just implementation.

FilterSet has the same filtering logic as MatchSpan previously had, but operates more
generically on just strings instead of spans and adds some additional
options, such as caching.

**Link to tracking Issue:** Side effect of #560 to help keep metrics and trace processors using matching configs the same.

**Testing:** unit tests updated, no new behavior, just implementation swapout
2020-05-29 14:33:34 -04: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
James Bebbington 9ab50d3f93
Refactor testify assertions for nil errors to use the NoError function instead (#925) 2020-05-07 06:37:45 -07:00
Bogdan Drutu 27b2d657f7
Rename Cap to Len for maps (#908)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-01 16:04:32 -07: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
Bogdan Drutu c355dff685
Change pdata.TraceData -> pdata.Traces and ConsumeTrace -> ConsumeTraces (#837)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-15 16:20:51 -07:00
Bogdan Drutu 995b153e23
Move internal/data to consumer/pdata. (#835)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-15 13:13:55 -07:00
Bogdan Drutu 5f7bcd40d8
Add maps iterators similar Java's "ForEach" (#818)
* 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>
2020-04-10 15:00:07 -07:00
Bogdan Drutu 990df3baaa
Change spanprocessor to use the new data format (#788)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-09 09:35:00 -07:00
Bogdan Drutu 2d1a9b7ed1
Rename componenterr to componenterrors (#783)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-06 12:15:13 -07: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
Bogdan Drutu 84326d92c4
Move oterr to componenterr (#771)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-03 20:16:17 -04:00
Bogdan Drutu 92bb7a9bde
Change NoopExporter to support the old and the new interface (#775)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-03 12:00:33 -07:00
Bogdan Drutu 81cc48ca89
Cleanup processors, remove options, hide ctor (#770)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-02 14:04:02 -07: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
Constance Caramanolis 7d44a4c211
Refactor include/exclude logic and expose to span processor. (#537)
* Refactor include/exclude processor logic and add it to span processor.

* Add files containing common logic.

* Move matching and attribute functions to internal
2020-02-10 14:33:37 -08:00
Tigran Najaryan fb09004bcf
Add support to extract attributes and rename span (#519)
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
2020-01-28 12:11:15 -08: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
Paulo Janotti adf05cd4f4
Validate configuration object tags (#383)
* Validate configuration object tags

Adds a validation via reflection that checks if the 'mapstructure' tags are following the desired naming conventions desired for the config file. This becomes a runtime validation so even if not properly tested by some component the inconsistency is captured.

* Fix typo in comment

* Delete leftover commented code

* Add comments to CreateDefaultConfig and respective tests w/ ValidateConfig
2019-10-15 07:18:49 -07:00
Tigran Najaryan 01d8d945b6
Add Shutdown() function to processors (#379)
Shutdown() method is added so that we can implement proper
pipeline flushing during collector shutdown. This will be done
in a future PR.
2019-10-08 15:56:19 -04:00
Paulo Janotti 0e505d53e4
Refactor config: pipelines now under service (#376)
* Refactor config: pipelines now under service

This change moves 'pipelines' sections from the top level to under the 'service' section.

* Fix typo in old comment
2019-10-02 17:42:18 -07:00
Tigran Najaryan 402b80cabd
Add Capabilities to Processor and use for Fanout cloning decision (#374)
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
2019-10-02 14:35:00 -04:00
Tigran Najaryan dc6b290e3c
Rename all github paths from opentelemtry-service to opentelemetry-collector (#371)
This is part of renaming task: https://github.com/open-telemetry/opentelemetry-service/issues/352
2019-09-27 17:17:03 -04:00
Constance Caramanolis 41a7afa548 Add Span Processor logic
Adds the logic to name a span using values from the attributes.
2019-09-04 09:59:13 -07:00
Paulo Janotti 3c3718be3f
Add extensions and service to configuration (#299)
* Add extensions and service to configuration

Adds the extensions and service to the configuration model so "extension components" can be configured in the standard way of data pipelines.

* Rename extension.Component to extension.ServiceExtension
2019-08-27 17:41:27 -07:00
Constance Caramanolis a207c97f83 Add span rename processor config (#240)
Span Rename Processor exposes functionality to rename a span using attribute values from a span.

This commit only adds:

- the configuration 
- tests for the configuration
- config documentation in the code and test yaml.
- Updated processor/readme.md to list all processors.

A follow up PR will add processor functionality and documentation to processor/readme.md
2019-08-26 16:03:38 -04:00