Commit Graph

38 Commits

Author SHA1 Message Date
Pablo Baeyens c1af501cf7
[connector,exporter,processor,receiver] Error out on mismatched type (#12381)
<!--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 #12357
Fixes #12221
2025-02-27 12:24:18 +00:00
Pablo Baeyens 9ea6963fca
Remove a lot of deprecated symbols (#12421)
<!--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
2025-02-18 16:57:10 +00:00
Jade Guiton 77f824660e
Make MakeFactoryMap generic and move to otelcol (#12220)
#### 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>
2025-02-13 11:47:22 +00:00
Pablo Baeyens fc644ed67e
Deprecate 'Create*' methods (#12356)
<!--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
2025-02-11 17:25:52 +00:00
Bogdan Drutu 18090a763f
Remove deprecated funcs Create[*]Exporter and [*]ExporterStability (#11662)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-11-12 15:01:06 -08:00
Bogdan Drutu 738b9dfe66
Deprecate funcs that repeate exporter in name (#11370)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-08 19:38:32 -07:00
Bogdan Drutu 99cf16ef4c
[chore] Move back exporter definitions, make profile embed exporter (#11290)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-09-27 14:09:13 -07:00
Alex Boten e590ed1dd4
[connector,exporter,receiver,extension,processor] remove deprecated funcs/structs (#10423)
Finishing CreateSettings rename.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-07-19 08:13:50 -07:00
Damien Mathieu a07e6c3e10
Move exporter into an internal package, in preparation for profiles (#10527)
<!--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 exporter 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
2024-07-18 11:26:13 +02:00
Alex Boten f0c8787d2b
[exporter] deprecate CreateSettings -> Settings (#10335)
This deprecates CreateSettings in favour of Settings.
NewNopCreateSettings is also being deprecated in favour of
NewNopSettings
    
Part of #9428

~Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/10333~

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-06 08:03:40 -07:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [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>
2023-05-18 13:11:17 -07:00
Bogdan Drutu 1bfb1804fb
Continue to disallow directly implementing Factories, but allow it for component.Factory (#6962)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-01-24 09:50:47 -08:00
Daniel Jaglowski 13672f4792
Remove deprecated component.Exporter types (#6880) 2023-01-03 13:31:03 -08:00
Bogdan Drutu e63aed8fef
Improve service Config types name (#6787) (#6803)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-15 12:43:00 -08:00
Bogdan Drutu ace2bc6829
Remove deprecated funcs/types from component package (#6769)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-12 18:12:32 -08:00
Bogdan Drutu 6a2dc302a9
Move exporter Factory and types to exporter package (#6672)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-07 10:20:34 -08: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 98973e7008
Add the rest of V2 factories and interfaces (#626)
- Added V2 metric factories and interfaces for receivers and exporters.
- Added V2 factories and interfaces for processors.
- Creation methods in V2 factories accept a CreationParams struct to
  allow for easier addition of new parameters in the future without
  breaking the interface.

All changes are uniform with previously introduced initial batch of
V2 factories and interfaces (except introduction of CreationParams).

Issue: https://github.com/open-telemetry/opentelemetry-collector/issues/478
2020-03-16 15:44:37 -04:00
Tigran Najaryan 65fc2439d4
Introduce internal TraceData and other data structures (#584)
1. Introduced data structures that represent telemetry data in-memory.

2. Renamed OTLP* interfaces and types to *V2 types to denote that they are
   Internal and not OTLP and are the new version of internal data.
   Internal representation is somewhat different from OTLP.

Testing done: unit tests that cover non-trivial functions. Single-line
getters and setters are typically not covered.

Documentation: added doc.go to describe the implementation and usage.

Design doc and benchmarks: https://docs.google.com/document/d/1MSKjMVXQsP51lA6OwpfyLfZhWK-MkGo5vff43LhrqZU/edit#
2020-03-05 10:03:41 -05:00
Tigran Najaryan 4da23d11f0
Add OTLP trace data types, factories and helpers (#534)
This is step one in converting in-memory representation from OC to OTLP. This
change has no effect except in tests. The introduced code is not reachable.

Issue: https://github.com/open-telemetry/opentelemetry-collector/issues/478
2020-02-11 12:48:55 -05: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
Tigran Najaryan b125d052db
Add Start() function to Exporter interface (#380)
This is done to have uniformness with Receivers and allow
exporters to communicate with the host (Collector) in the
future.

Implements https://github.com/open-telemetry/opentelemetry-collector/issues/373
2019-10-07 13:28:06 -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
Bogdan Drutu 97a71b3b8d
Use full name for the metrics and spans created for observability (#316)
* Use full name for the metrics and spans created for observability, remove Name from Exporter

* Update error name

* Add tests for ComponentName
2019-09-04 10:59:49 -04:00
Constance Caramanolis 068dcaeca9 Implement Shutdown() method from exporter interfaces (#259)
* INITIAL

* Properly implement name

* reword comment

* address comments and rename stop to shutdown

* Use assert in tests, change to shutdown instead of shutdownFunc and add some missing comments.
2019-08-20 07:19:59 -07:00
Paulo Janotti 5a294700fe
Refactor (Trace/Metrics)ExportFormat to ExporterName (#229)
* Refactor (Trace/Metrics)ExportFormat to ExporterName

Continuing the refactor that started from exporterhelper in proper naming the related fileds and methods.

* Remove Exporter interface and shorten method names
2019-08-05 15:17:19 -07:00
Yang Song a72d9e5bed Fix license header, typos and lints (#160)
* Fix license header, typos and lints

* Update import order
2019-07-17 12:19:43 -07:00
Bogdan Drutu 7e1d6008fc
Use Factory instead of ExporterFactory when package contains exporter (#123) 2019-07-03 15:39:39 -07:00
Tigran Najaryan d253ccf80d Move ExporterFactory to "exporter" package (#95)
This is part 2 of 3 of the refactoring plan to eliminate factories.go
and move the content to corresponding packages (receiver, exporter, processor).
2019-07-03 12:17:38 -07:00
Steve Flanders 559835ceee
Change census-instrumentation to open-telemetry and update authors (#20)
* 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
2019-06-18 14:22:28 -07:00
Tigran Najaryan 0747a8305a
Build exporters based on new configuration (#569)
- Introduced a new unisvc binary and make target. Unisvc is
  planned to be the implementation of the unified agent and collector
  that uses the new configuration format.

- Refactored existing Application.execute() code to make it more
  readable and also reusable.
  The functionality is not changed. Reviews: please check this carefully!

- Introduced new Application.executeUnified() function that will call
  all new agent/collector execution logic that is different from
  old logic.
  Application.executeUnified() is currently partial implementation,
  which only builds the exporters. I plan to add building of processor
  pipelines and receivers in future PRs.

- Introduced ExportersBuilder which builds runtime exporters based
  on provided configuration.

- Added ability for App telemetry shutdown. This is required to be able to
  run multiple tests that involve App start and shutdown. Previously
  there was only one test - TestApplication_Start - and it was not
  correctly cleaning up telemetry resources at the end, making impossible
  to add more tests against App.
2019-06-13 16:10:57 -04:00
Bogdan Drutu 62b0ae5be7
Rename [Trace|Metrics]DataProcessor to [Trace|Metrics]Consumer, add TraceProcessor similar to receiver,exporter. (#473)
* Rename [Trace|Metrics]DataProcessor to [Trace|Metrics]Processor

* Rename TraceProcessor to TraceConsumer as discussed.

* Add empty_test for processor.
2019-03-05 17:36:22 -08:00
Emmanuel T Odeke e939042488
exporter: plumbing to glue SpanReceiver with OC exporters
* Implemented the exporter.TraceExporter interface whose
method
```go
ExportSpanData(*commonpb.Node, ...*trace.SpanData) error
```

is feeds into a transformer that creates a spanreceiver.SpanReceiver
of which that signature
```go
ReceiveSpans(*commonpb.Node, ...*trace.SpanData) (*spanreceiver.Acknowledgement, error)
```
Also provided a dummy transformer which takes trace.Exporter-s and
creates a spanreceiver.SpanReceiver that that is passed to each
interceptor.

* Also provided an end-to-end application which if copied and pasted
is the prototype for our cmd/ocagent code that exports traces to the
various traditional OpenCensus trace.Exporter-s that have grown around
the OpenCensus ecosystem. The config parsing phase will determine
which trace.Exporter-s will be used. In the demo, application,
I am able to send traces to both Stackdriver and Jaeger simultaneously
2018-10-01 15:57:53 -07:00
JBD 61d8c042d7
Rename opencensusd to ocagent (#38) 2018-09-21 09:49:16 -07:00
Yang Song b987f0c14f
Fix import path from gen-go files. (#17)
* Fix import path from gen-go files.

* Update opencensus-proto in vendor directory.

* Fix package name conflict.
2018-08-30 12:35:11 -07:00
JBD 2ad88673f0
Add experimental exporter support for traces (#9)
Example config.yaml:

stackdriver:
  project: "projectid"
  enableTraces: true

zipkin:
  endpoint: "http://localhost:9411/api/v2/spans"

Exporter will export the traces both to Stackdriver
and Zipkin.

Updates #8.
2018-06-29 09:50:47 -07:00
JBD 4ed4cc0c38
Make endpoint file JSON (#6)
It allows us to extend what else we are going to store
as metadata in the file.

Fixes #5.
2018-06-28 16:30:02 -07:00
JBD e3604d9820
Initial commit of the exporter daemon and its Go exporter (#1)
This commit contains an initial prototype for the exporter daemon
that can discovered via and endpoint file on the host.

The exporter looks for the endpoint file to see the availability
of the daemon and exports if it is running.

Exporter daemon will allow OpenCensus users to export
without having to link a vendor-specific exporter in their final
binaries. We are expecting the prototype exporter is going to
be implemented in every language and registered by default.

Updates https://github.com/census-instrumentation/opencensus-specs/issues/72.
2018-06-07 15:42:37 -07:00