Commit Graph

130 Commits

Author SHA1 Message Date
Alex Boten 4e29c769bb
splitting batch/memorylimiter processors into their own modules (#6427)
Fixes #6188, #6192, #6193
2022-11-03 08:32:19 -07:00
Bogdan Drutu bb193a24d0
Deprecate New[JSON|Proto][Marshaler|Unmarshale], expose the structs (#6340)
The main motivation is because we want to be able to extend these Marshaler/Unmarshaler implementation with possible options.

Because of that we have 2 options: 1. add Option to each New func, OR 2. expose the structs so that later users can configure different options inside these structs, similar with `jsonpb.Marshaler`.

I implemented the version 2 since it is simpler, and less code, and also common in the industry.

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-10-18 15:29:37 -07:00
Dmitrii Anoshin e4cfde4758
[pdata] Rename MetricAggregationTemporality to AggregationTemporality (#6253)
As a new rule we want to rename all the structs for proto messages defined at the package level to not have the owner prefix in its name.
2022-10-07 09:37:47 -07:00
Dmitrii Anoshin 7740c7b387
Remove usages of deprecated pdata Clone methods (#6170) 2022-09-28 18:25:22 -07:00
Bogdan Drutu 937d1e6d25
Replace MetricDataType with MetricType (#6127)
* Dreprecate old APIs, add new APIs without "Data"

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

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

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-09-20 17:06:49 -07:00
Bogdan Drutu 35cf596fc1
Deprecate pmetric.Metric.SetDataType, in favor of empty setters (#5979)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-09-07 23:16:48 -07:00
Corbin Phelps f0d69d6822
[processor/batch] Removed casts to Sizer interface in batch processor (#5937)
* Removed casts to Sizer interface in batch processor

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

* Added changelog entry

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

* removed changelog

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>
2022-08-19 09:31:09 -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 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
qyqcswill 16aa10d582
[docs]fix some grammatical mistakes in readmes (#5607)
* fix
grammatical error

* fix
grammatical error

* recommit for user_id not match

* recommit for user_id not match
2022-07-05 11:58:00 -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 e46dfb9a02
Remove unused func from internal interface batch (#5462)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-06-02 15:21:35 -07:00
Nathan Vērzemnieks 65b7b1be5d
Send correct batch stats when SendBatchMaxSize is set (#5385)
The stat was getting sent before the max batch size was
taken into account.
2022-06-02 14:18:07 -07:00
Alex Boten 4b2a304adb
[docs] add status for batch processor (#5392)
Fixes #5391
2022-05-18 08:37:34 -07:00
Bogdan Drutu 0674425b8e
Remove usage of unnecessary omitempty (#5256)
omitempty has effect only if the config is used as a source to encode/decode from, but the config is always the destination in our case, so it has no effect.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-04-25 10:43:13 -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 1d5fdd1c1f
Deprecation of pdata methods following OTLP v0.15.0 (#5076)
* Deprecation of pdata methods following OTLP v0.15.0

Adding deprecation methods for the following pdata methods:
  - InstrumentationLibrary is now Scope
  - InstrumentationLibrarySpans is now ScopeSpans
  - InstrumentationLibraryLogs is now ScopeLogs
  - InstrumentationLibraryMetrics is now ScopeMetrics

* update changelog

* add deprecated method on resource spans/metrics/logs

* add InstrumentationLibrary deprecation method
2022-03-28 00:32:48 -07: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
Tigran Najaryan 18fb01178b
Remove usage of LogRecord.Name field (#4804)
The LogRecord Name field [is removed](https://github.com/open-telemetry/opentelemetry-specification/pull/2271) from the specification and is [going to be removed](https://github.com/open-telemetry/opentelemetry-proto/pull/357) from the OTLP.
2022-02-08 08:56:16 -08:00
Tigran Najaryan 5ee1fec9fe
Update to OTLP proto 0.12.0 (#4724)
- Removed all deprecated metric messages and corresponding conversion code and tests.
- Removed deprecated_code from span status and corresponding conversions and tests.
- Renamed logs field to log_records in InstrumentationLibraryLogs message.
2022-01-26 10:35:15 -08: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 1a58ddab2c
Update batch processor to handle ExponentialHistogram (#4405)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-12 09:25:31 -08:00
David Ashpole a9df2ae27b
unit test and changelog follow up to batch processor descriptor fix (#4396) 2021-11-10 16:34:45 -08:00
David Ashpole 719d371a56
copy aggregation temporality and monotonic to new metric batches (#4389) 2021-11-10 10:13:59 -08:00
Bogdan Drutu 6785e6fdd8
Fix small nits in the batchprocessor split logic (#4340)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-02 12:09:47 -07:00
Alex Boten 9cdb1da1c4
[test] fixing flaky TestBatchMetricsProcessor_Timeout (#4339)
The batch size was 100 and the number of datapoints being generated was also 100 so at times, the batch processor would be sending the data before the timeout was reached, which is what this particular test is trying to test. To fix this, I'm increasing the batch send size to 101.
2021-11-02 09:41:32 -07:00
Bogdan Drutu 87405ddaa4
Small cleanup for batchprocessor split logic (#4284)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-10-28 08:49:51 -07:00
Traian Schiau fd61bbbc9b
pdatagen - Add MoveTo method for struct types (#4240)
* [pdatagen] Add MoveTo method for struct types

* [pdatagen] Add MoveTo method for struct types - regenerate

* [batchprocessor] Split benchmarks rework

- Fix metric split benchmark
- Ignore clone counters in split benchmarks

* [batchprocessor] Use MoveTo in split

* [batchprocessor] Skip long running split benchmarks

* [batchprocessor] Improve coverage
2021-10-27 10:18: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
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
Alexis Perez bcbaeaf4b8
Move ValidateConfig from configcheck to configtest (#3956)
* Move Validateconfig to configtest

* Rename ValidateConfig to CheckConfigStruct

* fix: revert all the renamed variables

* fix: rename ValidateConfig to CheckConfigStruct

* fix: rename test names

Co-authored-by: Hyunuk Lim <hyunuk@amazon.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-16 03:44:59 -07:00
Nathan Dias aa450a0bf2
all: remove OtlpProtoSize in favor of Sizer interface (#3818)
* all: remove OtlpProtoSize in favor of Sizer interface

* add {Metrics|Traces|Logs}Sizer, fix test commenting

* move size tests to pb_test, fix metrics+logs parameter names

* uncommented batch_processor tests + adjusted them to use *Sizer

* I forgot BenchmarkTraceSizeBytes :(

* Add docs for NewProtobof*Sizer + update docs for NewProtobuf*Marshaler

* cast *Marshaler to *Sizer for now

* add casts to batch_processor_test
2021-08-17 11:10:33 -07:00
alrex 0163db7aca
update initSumIntMetric and initGaugeIntMetric (#3718) 2021-07-26 16:27:07 -07:00
alrex f46871afda
remove IntHistogram (#3676)
* remove IntHistogram

* fix test

* rename histogram in golden dataset
2021-07-20 14:58:59 -07:00
alrex c6f9f29fca
Rename DoubleDataPoint to NumberDataPoint (#3633) 2021-07-15 19:02:36 -07:00
Anthony Mirabella 9e8bded5b4
Deprecate Resize() from pdata slice APIs (#3573)
* Remove Resize() from pointer slice API

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

* model/pdata: refactor value slice interfaces

* Removed Resize()
* Added EnsureCapacity() and AppendEmptyN()

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

* -Fix function signature in cpu_scraper_linux.go

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

* Fix remaining Resize() calls

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

* Fix OS-specific processes scraper

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

* Remove tests for equality of value slices that aren't comparable

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

* Remove AppendEmptyN from pdata slice APIs

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

* batchprocessor: improve splitMetric() to avoid copying entire metric unless necessary

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

* model/pdata: restore Resize() for slice types, mark as deprecated

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

* Update metrics_test.go

* Update metrics_test.go

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Bogdan Drutu <lazy@splunk.com>
2021-07-12 19:01:24 -07:00
alrex f9dacb8402
rename DoubleGauge -> Gauge (#3599) 2021-07-12 16:59:08 -07:00
alrex aa60edff16
rename DoubleSum -> Sum (#3583)
* rename DoubleSum -> Sum

* update changelog

* revert pict changes
2021-07-12 15:21:51 -07:00
Bogdan Drutu 5544267e7d
Change MetricsSink to count data points not metrics (#3549)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-02 09:29:41 -07:00
Bogdan Drutu 32c2d0f131
Change LogRecordsCount to LogRecordCount everywhere (#3551)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-01 17:07:14 -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 d1fced9688
Refactor MetricAndDataPointCount to DataPointCount (#3547)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-07-01 13:43:31 -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
kisieland 6d44f0d303
Make the batch processor limit data points rather than metrics. (#3141)
**Link to tracking Issue:** #2754

This change introduces a BenchmarkBatchMetricProcessor that stress tests batching logic.
Results before:
`BenchmarkBatchMetricProcessor-12           20000             80614 ns/op`
Results after the change:
`BenchmarkBatchMetricProcessor-12           20000             96184 ns/op`
2021-06-02 10:52:24 -04:00