Commit Graph

502 Commits

Author SHA1 Message Date
Juraci Paixão Kröhling 2bdff61fa5
Split `confmap` into its own module (#6199)
* Split confmap into its own module

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Add confmap to builder test

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Add missing replace statement

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Set go version to 1.18 on confmap

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
2022-12-01 09:27:08 -08:00
Bogdan Drutu 5fbf38fde2
Change dependencies to v0.66.0 (#6636)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-30 09:45:55 -08:00
Bogdan Drutu d0fe772781
Deprecate component.Config.ID(), add helper for obsreporttest (#5870)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-29 14:35:49 -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 30c9c7154b
Deprecate Unmarshal[*]Config in favor of UnmarshalConfig (#6613)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-23 10:15:39 -08:00
Tigran Najaryan 8d425480b0
[chore] prepare release 0.65.0 (#6592)
* prepare release 0.65.0

* Prepare stable for version v0.65.0

* Prepare beta for version v0.65.0

* add multimod changes
2022-11-21 11:37:25 -08:00
github-actions[bot] 1f6f86540c
dependabot updates Mon Nov 21 16:06:08 UTC 2022 (#6589)
Bump github.com/cenkalti/backoff/v4 from 4.1.3 to 4.2.0
Bump google.golang.org/grpc from 1.50.1 to 1.51.0
Bump google.golang.org/grpc from 1.50.1 to 1.51.0 in /exporter/otlpexporter
Bump google.golang.org/grpc from 1.50.1 to 1.51.0 in /exporter/otlphttpexporter
Bump google.golang.org/grpc from 1.50.1 to 1.51.0 in /pdata
Bump google.golang.org/grpc from 1.50.1 to 1.51.0 in /receiver/otlpreceiver

Co-authored-by: bogdandrutu <bogdandrutu@users.noreply.github.com>
2022-11-21 09:32:24 -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
Alex Boten 4fcc46b2bb
[chore] update featuregate dep (#6574)
Signed-off-by: Alex Boten <aboten@lightstep.com>
2022-11-17 14:19:38 -08:00
Alex Boten 6a117bfc37
[featuregate] split into its own module (#6571)
Fixes #6526

Signed-off-by: Alex Boten <aboten@lightstep.com>
2022-11-17 13:45:36 -08:00
Alex Boten 99f4496252
[chore] update dep to make update-otel easier (#6568)
Signed-off-by: Alex Boten <aboten@lightstep.com>
2022-11-16 15:08:48 -08:00
Alex Boten 2454cfb9ab
[consumer] split consumer into its own module (#6557)
This is part of #6186

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
2022-11-16 13:20:02 -08:00
Alex Boten 937bc8ede5
[chore] update component module to v0.0.0 (#6554)
This makes updating otel core possible from contrib without having to write a bunch of replace statements.
2022-11-15 13:51:16 -08:00
Alex Boten 19db2f15c8
split component into its own module (#6543)
Fixes #6187
2022-11-15 13:28:26 -08:00
github-actions[bot] c939d8d9a2
dependabot updates Mon Nov 14 16:59:52 UTC 2022 (#6539)
Bump github.com/prometheus/client_golang from 1.13.1 to 1.14.0
Bump golang.org/x/sys from 0.1.0 to 0.2.0 in /exporter/loggingexporter
Bump golang.org/x/tools from 0.2.0 to 0.3.0 in /internal/tools

Co-authored-by: bogdandrutu <bogdandrutu@users.noreply.github.com>
2022-11-14 09:20:38 -08:00
Gustavo Paiva 20e3aac004
deprecate obsreport.Must functions in favor of obsreport.New (#6510)
* deprecate obsreport.Must functions in favor of obsreport.New

* add changelog

* fix lint

* split changelog in two

* Update .chloggen/return_error_for_obsreport_new_functions.yaml

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

Co-authored-by: Bogdan Drutu <lazy@splunk.com>
2022-11-10 14:26:31 -08:00
Bogdan Drutu 4c7d5172ce
[chore] prepare release v0.64.1 (#6517)
* prepare release 0.64.1

* Prepare stable for version v0.64.1

* Prepare beta for version v0.64.1

* add multimod changes
2022-11-10 10:01:15 -08:00
Juraci Paixão Kröhling 226dc13a52
Prepare v0.64.0 (#6503)
* prepare release 0.64.0

* Prepare stable for version v0.64.0

* Prepare beta for version v0.64.0

* add multimod changes

* changelog entries

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
2022-11-08 18:02:35 -08:00
bogdandrutu ccd109c29a dependabot updates Mon Nov 7 03:10:36 UTC 2022
Bump go.opencensus.io from 0.23.0 to 0.24.0
Bump go.opencensus.io from 0.23.0 to 0.24.0 in /processor/batchprocessor
2022-11-07 03:10:36 +00:00
bogdandrutu 1df5010da2 dependabot updates Sat Nov 5 18:13:16 UTC 2022
Bump github.com/prometheus/client_golang from 1.13.0 to 1.13.1
2022-11-05 18:13:16 +00:00
Bogdan 74e53c9475 Fix deprecated calls
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-11-05 10:25:02 -07: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 a167b006e8
[chore] remove dependency on ballastextension from main core module (#6466)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-11-03 09:19:31 -07:00
Alex Boten 4e29c769bb
splitting batch/memorylimiter processors into their own modules (#6427)
Fixes #6188, #6192, #6193
2022-11-03 08:32:19 -07:00
gustavo.paiva 5a548e8c75 deprecate obsreport New* methods in favor of MustNew* 2022-11-02 12:26:35 -03:00
Bogdan Drutu 9e90e25435
Deprecate New*ProcessorWithCreateSettings, update New*Processor to the new API (#5915)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-15 15:25:21 -07:00
Bogdan Drutu f64389d15f
[chore] change config tests to unmarshal only the config for that component (#5895)
The main motivation for this is to allow components (including tests) to not depend on the "service" configuration and be reusable without the otelcol service.

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-11 06:57:13 -07:00
Bogdan Drutu 7a41e2f47e
Deprecate processorhelper.New*Processor in favor of New*ProcessorWithCreateSettings (#5833)
Main motivation is to ensure that Settings are passed (to enable obsreport usage which requires settings to be passed) as well as the context.

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-10 10:54:59 -07:00
Bogdan Drutu c140304b27
Use the config pointer as the key for the memorylimiter instances instead of the ID (#5822)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-09 14:27:18 -07:00
Bogdan Drutu fe226f3d86
Deprecate obsreport.[Processor|Exporter]Settings.Level and use MetricsLevel from CreateSettings (#5824)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-08-05 07:12:23 -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 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
Alex Boten b180bd215c
[docs] add status for memorylimiter (#5393)
Fixes #5390
2022-05-18 08:41:42 -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
Bogdan Drutu 39b719f28d
Use atomic.Bool when int was used as a bool variable (#5218)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-04-14 10:17:09 -07:00
Pablo Baeyens 698fbae76b
Use `go.uber.org/atomic` everywhere (#5215)
* Add depguard to enforce usage of `go.uber.org/atomic`

* Use `go.uber.org/atomic` everywhere
2022-04-14 08:42:48 -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
Dani Louca 52d651861c
[processor/memorylimiter] Only drops traces, not logs or metrics
Signed-off-by: Dani Louca <dlouca@splunk.com>

**Description:** 

This change 062e64f1d7 caused the memory limiter to "only" start the `checkMemLimits` routine for the ml instance used by the traces processor . 
In other words, metrics and logs processor will NOT [drop/refuse](https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiterprocessor/memorylimiter.go#L206) data and will pass them down to the next consumer regardless of the current memory pressure as their instance of ml->forcingDrop will not be set.

The simplest solution, is to call start for each processor (metrics, logs, traces) , but this will not be efficient as we'll be running 3 instances of `checkMemLimits`, ie: multiple GC .
But at the same we need to allow multiple instances, with different configs, example: `memory_limiter/another` and `memory_limiter`

````
extensions:
  memory_ballast:
    size_mib: 4

receivers:
  otlp:
    protocols:
      grpc:
      http:
processors:
  memory_limiter:
    check_interval: 2s
    limit_mib: 10

  memory_limiter/another:
    check_interval: 1s
    limit_mib: 100
exporters:
  logging:
    logLevel: info

service:
  telemetry:
    logs:
      level: "info"
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [memory_limiter]
      exporters: [logging]
    metrics/default:
      receivers: [otlp]
      processors: [memory_limiter]
      exporters: [logging]
    traces:
      receivers: [otlp]
      processors: [memory_limiter/another]
      exporters: [logging]
  extensions: [memory_ballast]
````

The fix adds a global map to keep track of the different instance and add ~~sync once~~ mutex for the start and shutdown call, so only the first processor can launch the `checkMemLimits` routine and the last one to call `shutdown` to take it down.
If shutdown was called and no `checkMemLimits` has started, then we'll return an error message; unit tests were updated to handle this.


**Testing:** 
Tested with above config and using splunk otel instance with valid data.
Made sure only a single `checkMemLimits` is running when there is a single config for memory-limiter and more than one when we have multiple.
I also verified that under memory pressure, when we pass the soft limit, all data types, traces, logs and metrics are getting dropped.

One we agree on this solution, I will look into adding more unit test to validate the change
2022-02-24 13:13:32 -05: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 ab0e02b7be
Fix error message in memorylimiter processor related to ballast extension (#4697)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-01-18 18:05:35 +00:00
Bogdan Drutu 4a89a135da
Remove warning about already removed config value (#4696)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-01-18 18:04:58 +00:00
Shree Prakash 0e02722729
Otel-4633 Replace path.Join method with filepath.Join method (#4638)
* Otel-4633 Replace path.Join method with filepath.Join method

* Otel-4633 Replace path.Join method with filepath.Join method
2022-01-05 11:08:42 -08:00
Bogdan Drutu 7de98eb669
Move test funcs that load entire config to servicetest (#4606)
Updates https://github.com/open-telemetry/opentelemetry-collector/issues/4605

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-12-21 15:11:40 -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 a8ff2dd98c
Enable `errcheck` linter (#4462)
* Check or explicitly ignore all errors

* Enable errcheck

* Use `t.Cleanup` instead of `defer`

* Point to issue on `Set` ignored error
2021-11-23 12:27:32 -08:00
Bogdan Drutu 0b4e5ec792
memorylimiterprocessor: Remove deprecated config (already no-op) ballast_size_mib (#4365)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-04 16:49:54 -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
Anthony Mirabella ee7fa0eeed
obsreport: wire up ProcessorCreateSettings for processors using obsreport (#4148)
* obsreport: wire up ProcessorCreateSettings for processors using obsreport

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

* Add ToProcessorCreateSettings() to obsreporttest settings

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

* Fix lint issue

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-09-30 09:15:50 -07:00
alrex afad36e378
rename NewIDWithName -> NewComponentIDWithName (#4151) 2021-09-29 17:09:17 -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
alrex 3577bd05d4
rename memorylimiter -> memorylimiterprocessor (#4064) 2021-09-17 03:01:07 -07:00