Commit Graph

75 Commits

Author SHA1 Message Date
Alex Boten 9907ba50df
[processor] deprecate CreateSettings -> Settings (#10336)
This deprecates CreateSettings in favour of Settings.
NewNopCreateSettings is also being deprecated in favour of
NewNopSettings
    
Part of #9428

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-06 09:34:53 -07:00
Alex Boten 8da8d0a27d
[chore] update batch processor tests to use generated utility (#10256)
This updates the tests for the batch processor. This allows us to remove
a bunch of custom test code.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-29 13:48:42 -07:00
Alex Boten 567a175ed9
[batchprocessor] ensure attributes are set on metadata metric (#10245)
Fixing this bug required a change in mdatagen to ensure attributes could
be passed in to the telemetry builder.
    
Fixes #9674

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-29 09:10:01 -07:00
Alex Boten 1d8c53ff0f
[batchprocessor] use mdatagen for async metric (#10233)
Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/10232,
use mdatagen for async counter

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-28 11:15:55 -07:00
Alex Boten fc28929061
move internal/testdata to pdata/testdata (#9885)
This reduces dependencies from the consumer package while making
testdata available across repos. It will allow us to remove duplicated
code and its a fairly small surface area.

Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/9886

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-04-08 08:36:57 -07: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
Curtis Robert fbfbe04fbd
[chore][processor/batchprocessor] Enable goleak check (#9224)
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Add `goleak` to detect leaks in tests. Leaking goroutines were detected
that were caused by a dependency that we can ignore
(`go.opencensus.io/stats/view.(*worker).start`), some `Shutdown` calls
were also added that were missing.

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

**Testing:** <Describe what testing was performed and which tests were
added.>
Added check is passing as well as existing tests.
2024-01-09 12:23:37 -08:00
Alex Boten 6312e62ea4
add benchmark test for multi batch processing (#7717)
* add benchmark test for multi batch processing

This refactors the batch processor tests to make testing multiple configuration
scenarios easier. It adds a testcase for a batch processor w/ metadata keys.

Signed-off-by: Alex Boten <aboten@lightstep.com>

* use RunParallel

Signed-off-by: Alex Boten <aboten@lightstep.com>

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-23 15:12:47 -07:00
Bogdan Drutu bf6ca2bc95
Fix start/stop logic for batch processor (#7708)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-05-22 13:39:04 -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
Joshua MacDonald aa206e399c
Add batchprocessor support for client metadata (#7578) 2023-05-16 11:41:33 -07:00
Joshua MacDonald 27d3efb1e0
Batch processor support for split-only configuration (#7509)
Implement the fixes proposed in #7508. Otherwise, using a batchprocessor with Config{} passes validation but acts badly at runtime there is both a zero-duration timer and the call to sendItems never returns, constantly sending empty batches.
2023-04-07 15:35:55 -07:00
Bogdan Drutu 430fb80141
[chore] limit usage of the use otel feature gate, pass the bool directly to simplify usage (#6985)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-01-19 18:29:21 -08:00
Bogdan Drutu 1699701fd6
Deprecate featuregate.GetRegistry in favor of GlobalRegistry (#6979)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-01-19 15:08:13 -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
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
Gustavo Paiva 2da68656b8
Instrument `batch` processor with Otel Go (#6423)
- Instrument batch processor with OpenTelemetry Go.
- Also fixed a small typo on the bucket definition of the batch_send_size_bytes view of OpenCensus.
2022-11-16 15:08:28 -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 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 7740c7b387
Remove usages of deprecated pdata Clone methods (#6170) 2022-09-28 18:25:22 -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 1a4361c49a
Remove unnecessary and unused testdata (#5599)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-06-27 09:43:33 -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
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
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
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
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
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
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
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 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
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
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
Bogdan Drutu 8fed8a6070
Remove testdata GetEmpty for all signals (#3202)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-05-17 11:58:50 -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 9df19a1b45
Fix batchprocessor to avoid reordering and send max size (#3029)
* The reordering could happen if during processing of an item other items were added to the newItems channel. This is fixed by avoiding to re-add the left items to the channel.
* The logic of spliting was wrong by forcing sendBatchSize instead of sendBatchMaxSize when split was called.
* Fix logic if a very large message is received > 2x sendBatchMaxSize to call export multiple times instead of once and reset the timer.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-04-26 16:01:08 -07:00
Bogdan Drutu 25da8cfb98
Small cleanups in batchprocessor (#3013)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-04-26 13:52:33 -07:00
Pablo Baeyens 9b382e6cbf
Error checking on unit tests (#2959)
* Error checking on unit tests

* Add back license text

* Retrigger CI

* Wrap defer calls with `func`
Arguments are evaluated immediately on defer calls

* Update config/configauth/oidc_server_test.go

* Use t.Cleanup

* Change ioutil.ReadAll by resp.Body.Close()

* Retrigger CI (flaky tests)
2021-04-20 10:32:48 -07:00
Bogdan Drutu 1edaf40ced
Add New funcs for extension, exporter, processor config settings (#2872)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-31 16:50:05 -07:00
Bogdan Drutu 94a6cdde67
Rename pdata Size to OtlpProtoSize, fix some other comments (#2726)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-19 14:30:25 -04:00
Bogdan Drutu 85804ff257
Rename pdata.Logs.SizeBytes to Size, consistent with metrics/traces (#2694)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-17 15:21:25 -07: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