Commit Graph

237 Commits

Author SHA1 Message Date
Dmitrii Anoshin c239e73bbb
[exporterhelper] Add data_type attribute to internal queue metrics (#10593)
Add `data_type` attribute to the internal otelcol_exporter_queue_size
metric to report the type of data being processed.

All other metrics have the data type reported as part of their names. We
could've done the same for queue metrics, but that would introduce a
significant breaking change. We want to avoid that until we have all the
metrics standardized with OpenTelemetry semantic conventions.

Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/9943
2024-07-23 14:02:54 -07:00
Alex Boten 5753a58f71
update all metrics to include otelcol_ prefix (#9759)
This ensures the consistency for folks emitting metrics w/ OTLP until
the OTEP to specify pipeline telemetry is completed.

Waiting on
https://github.com/open-telemetry/opentelemetry-collector/pull/9775
before moving this forward

Fixes #9315

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-07-16 16:18:37 -07:00
Daniel Jaglowski ea7270caba
Add "inserted" metrics to processors (#10372)
#### Link to tracking issue

Resolves #10353

#### Testing

Added equivalent testing to other processor metrics (accepted, refused,
dropped).

#### Documentation

Metric documentation is autogenerated.

#### Open Question

My initial implementation includes a breaking change to
`componenttest.TestTelemetry` which is public facing API. If we want to
avoid an immediate breaking change in this test package, I would propose
the following, which I can submit in a prerequisite PR:
1. Deprecate all `TestTelemetry.Check*` methods.
2. Replace with more granular `TestTelemetry.CheckOneSpecificMetric`
methods.
2024-06-19 12:15:42 +02:00
dockercui 6dfa6bc5d9
chore: fix function names in comment (#10027)
fix function names in comment


Signed-off-by: dockercui <dockercui@aliyun.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-04-26 06:43:17 -07:00
Tyler Helmuth 6611edfa5a
Remove `GetExporters` from component.Host (#9987)
**Description:** 
Remove the deprecated `GetExporters` function from `component.Host`

**Link to tracking Issue:** <Issue number if applicable>

Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/7370
2024-04-22 09:41:14 +02:00
Alex Boten 062d0a7ffc
[chore] remove unnecessary underscores (#9580)
As per feedback from my previous PR

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-02-13 13:34:53 -08:00
Antoine Toulme 223be4117e
[component] Remove host.ReportFatalError (#9506)
**Description:** 
 Remove `host.ReportFatalError`. It has been deprecated since 0.87.0.

**Link to tracking Issue:**
#6344

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-02-09 12:46:21 +01:00
Pablo Baeyens 26c157e3bf
[component] Add MustNewType constructor for component.Type (#9414)
**Description:** 

- Adds `component.MustNewType` to create a type. This function panics if
the type has invalid characters. Add similar functions
`component.MustNewID` and `component.MustNewIDWithName`.
- Adds `component.Type.String` to recover the string
- Use `component.MustNewType`, `component.MustNewID`,
`component.MustNewIDWithName` and `component.Type.String` everywhere in
this codebase. To do this I changed `component.Type` into an opaque
struct and checked for compile-time errors.

Some notes:

1. All components currently on core and contrib follow this rule. This
is still breaking for other components.
2. A future PR will change this into a struct, to actually validate this
(right now you can just do `component.Type("anything")` to bypass
validation). I want to do this in two steps to avoid breaking contrib
tests: we first introduce this function, and after that we change into a
struct.

**Link to tracking Issue:** Updates #9208
2024-02-02 17:33:03 +01:00
Alex Boten 9c7177496f
[chore] remove unused opencensus code (#9108)
Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/9102

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-30 10:19:42 -08:00
Alex Boten 834413537b
[telemetry] mark useOtelForInternalMetrics stable (#9102)
This marks the flag as stable. Leaving this as a draft until v0.92.0 is
released.

Closes https://github.com/open-telemetry/opentelemetry-collector/issues/8962
Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/816

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-16 15:38:21 -08:00
Alex Boten 83d463ceba
[obsreport] deprecate test funcs/structs (#8538)
This deprecates the remaining code under the obsreport package.

Follows
bf141227c5

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-12 09:28:57 -08:00
Antoine Toulme c5a2c78d61
Move error out of `ReportComponentStatus` function signature, use `ReportStatus` instead (#9175)
Fixes #9148
2024-01-09 09:36:41 -08:00
Curtis Robert 8ee1f13743
[chore] Enable goleak for all (passing) tests (#9173)
**Description:**
It was suggested that we add the [goleak
package](https://pkg.go.dev/go.uber.org/goleak) to every test in core.
This change adds `goleak` to every package that is succeeds with goleak.
There a number that are not successful, the full list of which I've
posted in the bug.

I generated these files using a shell script to copy a template
`main_test.go` file into each package, then modified the package name.
I'm sure there was a better way to automate this, but it worked well
enough at this point. Here's the script:
 ```
cp ./main_test.go $1

PACKAGE_NAME=$(basename $1)

sed -i '' -e "s|package component|package $PACKAGE_NAME|g"
$1/main_test.go

pushd . && cd $1 && go mod tidy 
go test -v .
```
Usage example:
```
$ ./add_leak_test reciever/scrapererror
```


**Link to tracking Issue:**
#9165

**Testing:**
All added tests are passing, but there are a number failing. Note that there's no sign of `goleak` running until it fails.
2024-01-03 08:35:58 -08:00
Alex Boten b570812b1e
[chore] bump otel-go deps (#8843)
Address deprecation of NewNoopTracerProvider in this change.

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-11-12 07:18:05 -08:00
Matthew Wear 53615832e6
Component Status Reporting (#8169)
This PR introduces component status reporting. There have been several
attempts to introduce this functionality previously, with the most
recent being: #6560.

This PR was orignally based off of #6560, but has evolved based on the
feedback received and some additional enhancements to improve the ease
of use of the `ReportComponentStatus` API.

In earlier discussions (see
https://github.com/open-telemetry/opentelemetry-collector/pull/8169#issuecomment-1668367246)
we decided to model status as a finite state machine with the following
statuses: `Starting`, `OK`, `RecoverableError`, `PermanentError`,
`FatalError`. `Stopping`, and `Stopped`. A benefit of this design is
that `StatusWatcher`s will be notified on changes in status rather than
on potentially repetitive reports of the same status.

With the additional statuses and modeling them using a finite state
machine, there are more statuses to report. Rather than having each
component be responsible for reporting all of the statuses, I automated
status reporting where possible. A component's status will automatically
be set to `Starting` at startup. If the components `Start` returns an
error, the status will automatically be set to `PermanentError`. A
component is expected to report `StatusOK` when it has successfully
started (if it has successfully started) and from there can report
changes in status as it runs. It will likely be a common scenario for
components to transition between `StatusOK` and `StatusRecoverableError`
during their lifetime. In extenuating circumstances they can transition
into terminal states of `PermanentError` and `FatalError` (where a fatal
error initiates collector shutdown). Additionally, during component
Shutdown statuses are automatically reported where possible. A
component's status is set to `Stopping` when Shutdown is initially
called, if Shutdown returns an error, the status will be set to
`PermanentError` if it does not return an error, the status is set to
`Stopped`.

In #6560 ReportComponentStatus was implemented on the `Host` interface.
I found that few components use the Host interface, and none of them
save a handle to it (to be used outside of the `start` method). I found
that many components keep a handle to the `TelemetrySettings` that they
are initialized with, and this seemed like a more natural, convenient
place for the `ReportComponentStatus` API. I'm ultimately flexible on
where this method resides, but feel that `TelemetrySettings` a more user
friendly place for it.

Regardless of where the `ReportComponentStatus` method resides (Host or
TelemetrySettings), there is a difference in the method signature for
the API based on whether it is used from the service or from a
component. As the service is not bound to a specific component, it needs
to take the `instanceID` of a component as a parameter, whereas the
component version of the method already knows the `instanceID`. In #6560
this led to having both `component.Host` and `servicehost.Host` versions
of the Host interface to be used at the component or service levels. In
this version, we have the same for TelemetrySettings. There is a
`component.TelemetrySettings` and a `servicetelemetry.Settings` with the
only difference being the method signature of `ReportComponentStatus`.

Lastly, this PR sets up the machinery for report component status, and
allows extensions to be `StatusWatcher`s, but it does not introduce any
`StatusWatcher`s. We expect the OpAMP extension to be a `StatusWatcher`
and use data from this system as part of its AgentHealth message (the
message is currently being extended to accommodate more component level
details). We also expect there to be a non-OpAMP `StatusWatcher`
implementation, likely via the HealthCheck extension (or something
similiar).

**Link to tracking Issue:** #7682

cc: @tigrannajaryan @djaglowski @evan-bradley

---------

Co-authored-by: Tigran Najaryan <tnajaryan@splunk.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
Co-authored-by: Alex Boten <aboten@lightstep.com>
2023-10-06 11:35:38 -07:00
Daniel Jaglowski fe2ae8defc
Deprecate component.Host.GetExporters (#7390)
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2023-05-26 15:34:08 -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
Jacob Aronoff 833cbdaf75
Enable create settings to access resource attributes (#7531)
Adds the ability for create settings to access instantiated resource attributes

Link to tracking Issue: #6599
2023-05-08 09:06:06 -07:00
Alex Boten 5a7b14153a
[chore] update otel-go dep (#7588)
Updating required APIs along the way.

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-02 09:47:52 -07:00
Bogdan Drutu a2f0153679
[chore] replace the usage of interface{} with any (#7053)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-01-30 15:01:25 -08:00
Bogdan Drutu bc870f854e
Remove deprecated funcs from componenttest (#6836)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-19 21:42:31 -08:00
Bogdan Drutu f907bb5431
Remove deprecated component.[Factories|MakePorcessorFactoryMap] and componenttest.NewNopFactories (#6835)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-19 15:00:02 -08:00
Daniel Jaglowski 1e6c7e51a5
Move Factories to otelcol, delete otelcoltest (#6792) 2022-12-13 14:11:15 -08:00
Daniel Jaglowski 55e6fa00de
Deprecate component.Factories in favor of service.Factories (#6723) 2022-12-12 18:12:48 -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 42c7b20c31
Remove deprecated componenttest.NewNop*CreateSettings (#6761)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-12 17:04:07 -08:00
Bogdan Drutu 7cb2d7622d
Remove deprecated comonent.Config.[ID|SetIDName]; Deprecate config.*Settings (#6718)
* Remove deprecated comonent.Config.[ID|SetIDName]; Deprecate config.*Settings

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

* Update .chloggen/rmcfgid-1.yaml

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
2022-12-12 14:35:45 -08:00
Daniel Jaglowski fdef8b181a
Deprecate `Processor` related structs and functions in favor of `processor` package (#6709) 2022-12-09 08:09:27 -08:00
Daniel Jaglowski a470d8a8f3
Deprecate component.Receiver* in favor of new receiver.* (#6687)
* Deprecate component.Receiver* in favor of new receiver.*

* Update component/receiver.go

Co-authored-by: Bogdan Drutu <lazy@splunk.com>

* Update component/receiver.go

Co-authored-by: Bogdan Drutu <lazy@splunk.com>

* Update component/receiver.go

Co-authored-by: Bogdan Drutu <lazy@splunk.com>

Co-authored-by: Bogdan Drutu <lazy@splunk.com>
2022-12-08 14:26:14 -08:00
Bogdan Drutu c56b7d3d21
Mark as deprecated componenttest exporter related funcs (#6707)
* Mark as deprecated componenttest exporter related funcs

This was a miss from https://github.com/open-telemetry/opentelemetry-collector/pull/6672

Skipping changelog since covered in https://github.com/open-telemetry/opentelemetry-collector/blob/main/.chloggen/deprecatecompexp.yaml

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

* Update deprecatecompexp.yaml

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-07 19:44:49 -08:00
Bogdan Drutu 0b4bbf506c
[chore] remove some deprecate API calls in componenttest (#6706)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-07 19:17:39 -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
Bogdan Drutu c0495807aa
[chore] move tests to non deprecated packages, fix chloggen (#6673)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-05 08:24:30 -08:00
Bogdan Drutu 03370c7ff5
Move Extension/ExtensionFactory to extension package (#6642)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-01 10:39:09 -08:00
Bogdan Drutu 1028e3d2a2
Deprecate special Configs for each component type, use a standard opaque Config (#6617)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-23 15:02:54 -08:00
Bogdan Drutu aaaa356a38
Minimum changes to component.Host, to allow split of the component package (#6553)
* Draft minimum changes to component.Host

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

* Update .chloggen/draftminhost.yaml

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
2022-11-18 09:44:06 -08:00
Bogdan fbf1e2a09c Revert changes to config.[Receiver|Processor|Exporter|Extension]Settings
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-11-05 10:04:50 -07:00
Bogdan d6ed8246b6 Deprecate all types and funcs in config package
The main reason is to remove the circular dependency between the config (including sub-packages) and component. Here is the current state:
* component depends on config
* config/sub-package[grpc, http, etc.] depends on config & component

Because of this "circular" dependency, we cannot split for example "config" into its own module, only if all the other config sub-packages are also split.

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-11-05 10:04:49 -07:00
Bogdan Drutu fdf4885c90
Remove deprecated funcs from component (#5917)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-16 10:48:19 -07:00
Bogdan Drutu 186077db7a
Define a new API for components stability level to match extensions as well (#5762)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-03 10:13:31 -07:00
Bogdan Drutu 495c1db39e
Replace deprecate With[Traces|Metrics|Logs][Receiver|Processor|Exporter] with the new definition (#5759)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-07-29 11:38:34 -07:00
Alex Boten 6133c820fd
[chore] update dependencies (#5672)
As per dependabot recommendations.
2022-07-11 09:00:57 -07:00
Alex Boten 9f0d97ca57
add stability level to component factory (#5580)
* add stability level to component factory

* update docstring

* use a map instead of a single stability level

* apply review feedback

* add tests

* fix impi, add changelog

* add processors, receivers

* fix inconsistency

* set noop to stable

* update calls in deprecated func
2022-07-05 14:02:23 -07:00
Bogdan Drutu 1a4361c49a
Remove unnecessary and unused testdata (#5599)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-06-27 09:43:33 -07:00
Bogdan Drutu ed0b1a008c
Remove unused go template files in testdata (#5489)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-06-07 11:51:16 -07:00
Bogdan Drutu e6b5cd54d1
Deprecate componenterror package, move to component (#5383)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-05-17 17:18:08 -07:00
Bogdan Drutu e8dd9536f5
Enable errorlint and fix all warnings (#5364)
On top of the errorlint errors, also changes `fmt.Errorf("string literal")` with `errors.New("string literal")`.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-05-16 10:36:41 -07:00
Dmitrii Anoshin 734e25e8de
Split `model` by signal type and move it to the new `pdata` module (#5168)
Split all `pdata` related code by type and move it from `model` to the new module `pdata`.

- `model/pdata` and `model/otlp` are moved to `pdata/plog`, `pdata/pmetric` and `pdata/ptrace`.
- `model/otlpgrpc` is moved to `pdata/plogotlp`, `pdata/pmetricotlp` and `pdata/ptraceotlp`.

Now all the API in `model` except for `model/semconv` is deprecated.
2022-04-11 16:00:26 -07:00
Alex Boten 9330552508
dependabot updates Mon Mar 28 08:14:19 PDT 2022 (#5105)
Bump go.opentelemetry.io/contrib/zpages from 0.29.0 to 0.30.0
Bump google.golang.org/protobuf from 1.27.1 to 1.28.0 in /model
Bump go.opentelemetry.io/otel/metric from 0.27.0 to 0.28.0
Bump go.opentelemetry.io/otel/sdk from 1.5.0 to 1.6.1
Bump go.opentelemetry.io/otel/sdk/metric from 0.27.0 to 0.28.0
Bump go.opentelemetry.io/otel/exporters/prometheus from 0.27.0 to 0.28.0
Bump github.com/ory/go-acc from 0.2.7 to 0.2.8 in /internal/tools
2022-03-28 14:16:12 -07:00
Haleygo 317c08ea87
Refactor some new factory func under component/componenttest (#4940)
* refactor new factory func

* Update service_test.go

Co-authored-by: Bogdan Drutu <lazy@splunk.com>
2022-03-14 06:27:47 -07:00
Bogdan Drutu c9c253193a
Move everything from exporterhelper to component. (#4899) (#4891)
Updates https://github.com/open-telemetry/opentelemetry-collector/issues/4681

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-02-22 16:19:41 -08:00
Bogdan Drutu 83c6ed1366
Move everything from exporterhelper to component. (#4899)
Updates https://github.com/open-telemetry/opentelemetry-collector/issues/4681

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-02-22 15:29:58 -08:00
Bogdan Drutu 004dd4da35
Move everything from processorhelper to component. (#4889)
Updates https://github.com/open-telemetry/opentelemetry-collector/issues/4681

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-02-22 14:23:40 -08:00
Bogdan Drutu 89e0d42c11
Move everything from extensionhelper to component. (#4805)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-02-19 10:48:50 -08:00
Bogdan Drutu c4134ba6f3
Add the StartFunc/ShutdownFunc to component directly (#4803)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-02-18 11:29:49 -08:00
Bogdan Drutu 7cdf8c7f1c
Small improvements in componenttest (#4802)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-02-03 12:03:21 -08:00
Bogdan Drutu 0ef0a9ce7b
Use directly the consumer helper funcs in the other helpers packages. (#4719)
Try to understand if the Component helper is necessary, or only having the helper funcs is enough.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-01-26 10:59:26 -08:00
Anthony Mirabella e080cae46f
Enable configuring telemetry through service config file (#4069)
* consolidate flags for configuring telemetry

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Enable configuring metrics via service config

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Make components take MetricsLevel from TelemetrySettings

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fix lint errors

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Remove configuration for metrics prefix and adding instance ID

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Make entire Collector available to telemetry initialization, use it to set metrics prefix to buildInfo.Command

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* fix metrics prefix tests

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fix lint errors

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* config/telemetry: parseLevel() no longer needs to be exported

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* config/telemetry: remove intanceID and prefix flags

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Apply PR feedback

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* address PR feedback

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Avoid linter complaining about use of deprecated functions

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-12-16 10:29:28 -08:00
Pablo Baeyens 9631ceabb7
Make `component.Factory` inherit `internalinterface.InternalInterface` (#4338)
* Make `component.Factory` inherit `internalinterface.InternalInterface`

* Add changelog entry

* Add comment on `component.Factory`
2021-11-02 12:09:32 -07:00
Pablo Baeyens 883afc505d
Remove BaseProcessorFactory, force using helper (#4175)
* Add internalinterface package

This adds a general InternalInterface to make an interface impossible
to implement.

* Use internalinterface.InternalInterface for Processor as a test

* Add Changelog note

* need to use -> must use

* Add small unit test

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-01 17:54:12 -07:00
José Carlos Chávez 9d3a8a4608
Adds vanity import check (#4180)
* chore: adds porto and fixes vanity imports.

* chore: fixes target overriding.

* chore: fixes install of porto.

* chore: includes porto as a tool.

* chore: upgrades porto to check internals.

* chore: rebase and update vanity import.

* chore: removes unnecessary space.

* chore: rollsback vanity import in generated files.
2021-10-12 13:47:36 -07:00
Bogdan Drutu 4bd1262f00
Bump otel dependencies to latest (#4167)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-10-04 08:48:06 -07:00
James 85b8094e26
Rename `config.NewID` to `config.NewComponentID` and `config.NewIDFromString` to `config.NewComponentIDFromString` (#4137)
This PR is to rename `config.NewID` to `config.NewComponentID` and `config.NewIDFromString` to `config.NewComponentIDFromString` for naming consistency.  

**Link to tracking Issue:** 
Fixes #4105
2021-09-29 10:28:07 -04:00
Carlos Alberto Cortez 3f75254ebb
Rename DefaultBuildInfo() to NewDefaultBuildInfo() (#4129)
* Rename DefaultBuildInfo() to NewDefaultBuildInfo()

* Update CHANGELOG.

* Update CHANGELOG.md

Co-authored-by: Bogdan Drutu <lazy@splunk.com>
2021-09-27 09:09:19 -07:00
alrex ad5b3235d1
add MeterProvider to TelemetrySettings (#4031) 2021-09-14 11:17:33 +03:00
alrex e8bd3be6d4
rename TelemetryCreateSettings -> TelemetrySettings (#3986) 2021-09-08 10:22:38 -07:00
alrex 9560f0e779
add TelemetryCreateSettings (#3984) 2021-09-08 00:00:09 -07:00
Bogdan Drutu baf89f11bf
Pass a TracerProvider via construct settings to all the components (#3592)
Followup PR will use the passed tracer to construct obsreport.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-12 11:01:06 -07:00
Bogdan Drutu 9a7bccea3e
Change SpansCount to SpanCount everywhere (#3550)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-01 16:57:42 -07:00
Bogdan Drutu c63d0c68cd
Move pdata in the new package (#3483)
The new module go.opentelemetry.io/collector/model will be created later when the internal data will
also be moved.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-25 01:17:31 +03:00
Bogdan Drutu e2929a9b2e
Add componenttest.NewNop*CreateSettings to simplify tests (#3375)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-08 10:49:35 -04:00
Patryk Matyjasek 017aa1dad7
Standarize Settings, Params and Parameters in Processors (#3181)
* Replace ProcessorCreateParams with ProcessorCreateSettings.
Replace all dependencies in Processors.

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

* Update changelog

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

# Conflicts:
#	CHANGELOG.md

# Conflicts:
#	CHANGELOG.md

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-06-02 06:49:04 -07:00
Patryk Matyjasek 86d40883b4
Standarize Settings, Params and Parameters in Receiver (#3167)
* Replace ReceiverCreateParams with ReceiverCreateSettings.
Replace all dependencies in Receivers.

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

# Conflicts:
#	component/receiver.go

# Conflicts:
#	exporter/opencensusexporter/opencensus_test.go
#	exporter/prometheusexporter/end_to_end_test.go

* Update changelog

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

# Conflicts:
#	CHANGELOG.md

# Conflicts:
#	CHANGELOG.md

# Conflicts:
#	CHANGELOG.md

* Add missing file

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>
2021-06-02 06:48:49 -07:00
Patryk Matyjasek 1f7ffab2ca
Replace ExporterCreateParams with ExporterCreateSettings. (#3164)
Replace all dependencies in Exporters.

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

# Conflicts:
#	exporter/prometheusremotewriteexporter/factory.go

# Conflicts:
#	exporter/fileexporter/factory.go
#	exporter/opencensusexporter/factory_test.go
#	exporter/otlpexporter/factory_test.go
#	exporter/prometheusremotewriteexporter/factory_test.go

# Conflicts:
#	CHANGELOG.md
#	exporter/kafkaexporter/factory.go
#	exporter/opencensusexporter/factory.go
#	exporter/otlpexporter/factory.go
#	exporter/otlphttpexporter/factory.go
#	exporter/zipkinexporter/factory.go

# Conflicts:
#	CHANGELOG.md
#	component/exporter.go
#	exporter/opencensusexporter/factory_test.go
2021-06-02 06:03:35 -07:00
Patryk Matyjasek 827f5e1702
Standarize Settings, Params and Parameters in Extensions (#3294)
* Replace ExtensionCreateParams with ExtensionCreateSettings.
Replace all dependencies in Extensions.

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

* Update changelog

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>

# Conflicts:
#	CHANGELOG.md

* Add missing files

Signed-off-by: Patryk Matyjasek <pmatyjasek@sumologic.com>
2021-06-01 22:08:31 -07:00
Bogdan Drutu 2d48457b64
Rename [Trace|Log]Data to Traces|Logs in internal package testdata (#3205)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-17 15:01:33 -07:00
Pablo Baeyens 29b576e7d3
Fix some errcheck errors (#2881)
* Check testbed errors

* Check some more errors

* Empty commit to retrigger CI

* Address comments on hostmetricsreceiver

* Rewrite some errchecking code

* Inline ifs

* Inline ifs and change log.Fatalf + Error() calls by log.Fatal
2021-05-14 15:04:18 -07:00
Bogdan Drutu d1ee31e93c
Small nit fixes, remove unnecessary mock and overrides (#3150)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-12 14:16:36 -07:00
Dhruv Vora d5891ec866
Update function descriptions (#3025)
* Made changes to componenttest package

* Changes to nop_exporter_test

* Reverted the changes in exporter and nop_exporter

* Updated comments for the Factory

* reverted usage of singletons
2021-05-12 11:35:22 -07:00
Bogdan Drutu ffb332b37b
Add capabilities to consumer, remove from processor (#2770)
* Add capabilities to consumer, remove from processor

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

* Rename baseConsumer

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-11 16:13:47 -07:00
Bogdan Drutu e54cbb44df
Use config.ID for Exporters config (#3084)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-04 08:09:37 -07:00
Bogdan Drutu 26bcc26f24
Use config.ID for Extensions config (#3083)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-03 16:09:49 -07:00
Bogdan Drutu 665e9657ac
Use config.ID for Processors config (#3077)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-03 14:46:10 -07:00
Bogdan Drutu faa78aa7f6
Use config.ComponentID for Receivers config (#2870)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-04-30 16:29:10 -07:00
Bogdan Drutu d6a0f9ab76
Fix comments for exported funcs/vars/consts (#2938)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-04-14 14:55:23 -07:00
Bogdan Drutu c6c758c1cf
Fix all TraceProcessor usages, use TracesProcessor (#2935)
* Fix all TraceProcessor usages, use TracesProcessor

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

* Update changelog

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-04-14 14:04:27 -07:00
Bogdan Drutu 80a415db43
Move configerror.ErrDataTypeIsNotSupported to componenterror.ErrDataTypeIsNotSupported (#2886)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-04-06 07:36:46 -07:00
Bogdan Drutu 53832b5246
Add convenience interface in consumertest that implements all consumers (#2878)
* Add convenience interface in consumertest that implements all consumers

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

* Add changelog entry, fix license

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-04-02 15:00:23 -07:00
Bogdan Drutu 42708751ec
Allow adding new signals in ProcessorFactory by forcing everyone to embed BaseProcessorFactory (#2885)
* Allow adding new signals in ProcessorFactory by forcing everyone to embed BaseProcessorFactory

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

* Update component/processor.go

Co-authored-by: Jay Camp <jay.r.camp@gmail.com>

Co-authored-by: Jay Camp <jay.r.camp@gmail.com>
2021-04-02 14:23:27 -07:00
Pablo Baeyens 08a18d5b9f
Add missing documentation (#2837)
* Add comment linter

For now I am excluding
- Internal packages
- Testbed packages
- Constant blocks (since the type docs is usually enough)

* Document consumer folder

* Document processor folder

* Document component folder

* Document config folder

* Document service folder

* Add nosec directive for testbed

* Document testutil folder

* Document receiver folder

* Document exporter folder

* Document cmd/schemagen folder

* Document translator folder

* Document cmd/mdatagen

* Document obsreport folder

* Remove outdated package config comment

* Update .golangci.yml

* Update .golangci.yml

Co-authored-by: Bogdan Drutu <lazy@splunk.com>
2021-03-31 16:38:40 -07:00
Bogdan Drutu fe86ab5cba
Implement Validate() in ReceiverSettings, easy transition (#2865)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-31 08:57:14 -07:00
Bogdan Drutu 2605ec4a87
Refactor ConfigValidator (#2856)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-30 15:18:02 -07:00
Min Xia 2c170341f6
Add validate interface in configmodels to force each component do configuration validation (#2802) 2021-03-30 10:20:01 -07:00
Bogdan Drutu e7c74eb2fd
Move configmodels to config (#2808)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-26 12:14:35 -07:00
Bogdan Drutu 90d7a27040
Remove ErrorWaitingHost from componenttest (#2582)
Updates https://github.com/open-telemetry/opentelemetry-collector/issues/2540

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-25 14:54:32 -07:00
Bogdan Drutu 4ae0fc1149
Use Option pattern for componenthelper (#2778)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-24 13:43:00 -07:00
Bogdan Drutu 0c6757ec71
Rename [Traces|Metrics|Logs]Consumer to [Traces|Metrics|Logs] (#2761)
* Rename [Traces|Metrics|Logs]Consumer to [Traces|Metrics|Logs]

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

* Update internal/testcomponents/example_exporter.go

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
2021-03-23 08:04:44 -07:00
Min Xia 5887856a04
Clean up CheckDocs from componenttest which has not been used anymore (#2719) 2021-03-16 17:54:50 -07:00
Min Xia cadd84d04e
Create binary to run CheckDocs in componenttest and remove it from unit test in service module (#2703) 2021-03-15 15:15:57 -07:00
Bogdan Drutu 4e7df02067
Move example components to internal package (#2666)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-11 08:40:21 -08:00
Bogdan Drutu c4cf7ebef3
Add new clean nop components and use them in config tests (#2655)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-10 10:45:18 -08:00
Bogdan Drutu 6ed98714aa
Remove unused code from componenttest (#2659)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-10 10:44:12 -08:00
Bogdan Drutu 06770d1452
Remove multiproto receiver test example component (#2593)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-09 20:57:33 -08:00
Bogdan Drutu ac9ad4c371
Split example components by component type (#2626)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-09 15:51:57 -08:00
Bogdan Drutu 68871bdd7d
Remove support for deprecated unmarshaler (#2591)
Updates https://github.com/open-telemetry/opentelemetry-collector/issues/2540

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-05 14:03:40 -08:00
Bogdan Drutu 2f38767f72
Remove TestApplicationStartInfo, add a DefaultApplicationStartInfo (#2595)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-05 12:52:23 -08:00
Bogdan Drutu 006d7b5988
Do not expose entire config in the Host API (#2589)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-05 12:11:24 -08:00
Bogdan Drutu 7cdbd1caab
Rename ServiceExtension to just Extension (#2581)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-05 11:26:49 -08:00
Bogdan Drutu bf6dc58854
Do not expose NopHost struct (#2585)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-05 11:04:12 -08:00
Tigran Najaryan 0961efb54f
Fix Shutdown behavior for batchprocessor (#2537)
I added a Shutdown() test that does basic verification of the behavior of the
Shutdown() function. More verifications can be added later.

The test revealed a bug in batchprocessor Shutdown() function which would
not wait until all pending data was drained.
2021-03-02 13:43:58 -05:00
Bogdan Drutu 9383e82f9a
Update docs and code comments to not refer to old consumerdata (#2511)
* Update docs and code comments to not refer to old consumerdata

Updates https://github.com/open-telemetry/opentelemetry-collector/issues/2482

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

* Update processor/README.md

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
2021-02-22 14:38:33 -08:00
Bogdan Drutu 2c8915a349
Rename component.TraceExporter to component.TracesExporter (#2027)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-29 12:53:17 -04:00
Bogdan Drutu 1d38caf3b7
Rename component.TraceReceiver to component.TracesReceiver (#1990)
Fixes #1975

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-28 17:12:37 -07:00
Bogdan Drutu a3fa0a9166
Rename processor component.TraceProcessor to component.TracesProcessor, and equivalent Create method feature request (#2026)
Fixes #1975

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-28 18:11:25 -04:00
Bogdan Drutu d7b1122ea2
Use assert.True and assert.False when possible (#2006)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-27 12:01:23 -07:00
Bogdan Drutu 99cb5b244a
Rename consumer.TraceConsumer to consumer.TracesConsumer (#1981)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-20 10:56:30 -07:00
Bogdan Drutu b3a5ceaefa
Change CreateTraceProcessor and CreateMetricsProcessor to be consistent with receivers/logs processor and exporters. (#1785)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-15 12:39:38 -07:00
Bogdan Drutu 8422992a20
Allow passing context inside the components builder, add more tests (#1635)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-08-25 11:02:17 -07:00
James Bebbington c8641eea6e
Pass version (& other app info) into components in params struct (#1582)
* Pass Version into components in params struct

* Add TestApplicationStartInfo function
2020-08-24 20:03:07 -07:00
Bogdan Drutu 4be72e8666
Remove logs factories and merge with normal factories (#1569)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-08-24 18:47:52 -07:00
Jay Camp 1e65674799
Update copyright (#1597)
* Update copyright

* rebase
2020-08-19 18:25:44 -07:00
Bogdan Drutu 2e0cfdac15
Remove old receiver factories and receiver base factory (#1583)
* Remove old receiver factories and receiver base factory

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

* Update CHANGELOG.md

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
2020-08-18 11:32:44 -07:00
Dmitrii Anoshin 8e5c6065eb
Migrate componenttest factories to new the interface (#1558) 2020-08-15 13:51:13 -07:00
Bogdan Drutu 8af0a90dcf
Cleanup: Use ReceiverSettings when possible (#1476)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-08-04 14:25:52 -07:00
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
Ben Keith 4896d31e1e
Make Logs Type Non-internal (#1456)
This allows Logs to be used in the contrib repo.

Most of the references were fixed by sed + 'make fmt'.
2020-07-29 16:58:32 -04:00
Bogdan Drutu 2c3bca6dca
Move example factories to componenttest (#1300)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-22 14:08:41 -07:00
Bogdan Drutu e29ed74617
Add tests to componenttest to make codecov happy (#1231)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-29 15:20:17 -07:00
JBD b3429cf7b2
Merge componentdocs into componenttest (#1199)
* Merge componentdocs into componenttest

componentdocs is used for testing reasons, merging the docs validation code into the test package helps other developers to discover the existence of it.

Rename VerifyComponentDocumentation for CheckDocs to help verbosity and have consistency with the other checker functions in the module.

Signed-off-by: JBD <jbd@google.com>

* Fix lint error
2020-06-26 11:31:28 -07:00
Tomasz Piekarczyk 2826531738
Use stretchr/testify/require instead of t.Fatal (#266) (#1190) 2020-06-25 09:24:19 -07:00
Akash Suresh 01ce74db9c
Add test to ensure existence of component docs (#1090)
Add a simple go test to ensure existence of documentation for enabled components.

**Link to tracking Issue:** #1025
2020-06-12 14:43:20 -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
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 e21cdcf428
Consolidate test host implementations under componenttest (#785)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-08 10:26:18 -07:00