Commit Graph

31 Commits

Author SHA1 Message Date
Israel Blancas 4397725dff
[processor/memorylimiter] Add profiles support to memorylimiter processor (#12454)
#### Description
Add profiles support to the memorylimiter processor.

#### Link to tracking issue
Fixes #12453

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
2025-02-27 12:53:19 +00:00
Chao Weng 6de29ce169 Add `component.Type` parameter to `NewNopSettings` And deprecate `NewNopSettingsWithType` (#12452)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add `component.Type` parameter to `NewNopSettings` And deprecate
`NewNopSettingsWithType` cc @mx-psi

<!-- Issue number if applicable -->
#### Link to tracking issue
Relevant to #12305 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Updated

<!--Describe the documentation added.-->
#### Documentation
Added

<!--Please delete paragraphs that you did not use before submitting.-->
2025-02-21 11:17:45 +00:00
Pablo Baeyens a4ae175111
[*test] Add NewNopSettingsWithType everywhere (#12357)
<!--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 -->

Creates `NewNopSettingsWithType` function on test modules and deprecates
the `NewNopSettings` functions on those modules. Replace all usages of
`NewNopSettings` with `NewNopSettingsWithType`.

Part of #12305 but applied to all component kinds.

#### Link to tracking issue
Updates #12221
2025-02-13 16:56:20 +00:00
Bogdan Drutu abdfdc8d5f
[chore] Remove unused private funcs from generated code with mdatagen (#12339)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-02-11 00:25:13 +00:00
Alex Boten 7d603aa46b
Remove deprecated funcs (#12304)
Removing all v0.119.0 deprecated funcs.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-02-06 03:57:26 +00:00
Bogdan Drutu 0a40b4e00b
Deprecate metadatatest.Telemetry in favor of componenttest.Telemetry (#12218)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-31 21:31:34 +00:00
Bogdan Drutu d9b97ffb43
[metadatatest] Generate NewSettings that accepts componenttest.Telemetry (#12216)
This is the last functionality needed to replace
`metadatatest.Telemetry` with `componenttest.Telemetry`.

The `metadatatest.Telemetry` will be deprecated next release to give
time to change contrib since it is a large change.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-30 21:42:20 +00:00
Bogdan Drutu fb8bb93121
Add helper to get a metric for componentest.Telemetry (#12215)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-30 19:04:27 +00:00
Bogdan Drutu 3203167e9a
Make registration of callback for async metric always optional (#12204)
This PR also solves one more issues with the new interface, which is the
ability to record multiple observations for a single async metric using
one callback.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-29 23:58:43 +00:00
Chao Weng c2f1599df9
Generate assert function for each metric in mdatagen (#12179)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Completion of #12167 , cc @bogdandrutu 

Updated one test to verify the change, will update the rest ones after
this PR merges.
<!-- Issue number if applicable -->
#### Link to tracking issue
n/a

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added

<!--Describe the documentation added.-->
#### Documentation
Added
<!--Please delete paragraphs that you did not use before submitting.-->
2025-01-25 16:52:04 +00:00
Bogdan Drutu 7db2f90d79
Allow passing trace/metric SDK options to componenttest.Telemetry (#12166)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-23 10:54:13 +00:00
Bogdan Drutu c6a0986813
Extract componenttest.Telemetry as generic struct for telemetry testing (#12151)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-22 20:27:45 +00:00
Pablo Baeyens b844bb7146
[cmd/mdatagen] Remove level field from metrics (#12145)
<!--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 -->

Removes `level` field. This will be added back in the future once #11754
is completed.

#### Link to tracking issue

Updates #11061
2025-01-22 14:09:03 +00:00
Chao Weng c14d4f96d6
Add tracing support in metadatatest (#12106)
#### Description
Add tracing support in metadatatest

cc @bogdandrutu  
#### Documentation
Added
2025-01-17 08:52:24 +00:00
Matthieu MOREL 07ed31a3fc
[chore]: enable early-return from revive (#12061)
#### Description 


[early-return](https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return):
In Go it is idiomatic to minimize nesting statements, a typical example
is to avoid if-then-else constructions.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-01-10 01:17:43 +00:00
Bogdan Drutu 306c939415
Deprecate component_test in favor of metadatatest (#11812)
The main idea behind this is that the test helpers were generated in the
main package, hard to find and understand and also impossible to use
outside the main package, see the
[service/internal/proctelemetry/process_telemetry_test.go](https://github.com/open-telemetry/opentelemetry-collector/compare/main...bogdandrutu:opentelemetry-collector:dep-comp-test?expand=1#diff-ed642eb1c968a9308a07e87292f77af1e0830a7af2d87111c5abacde4fc87446).

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-06 18:06:46 +00:00
Bogdan Drutu 9ea2f531f5
Remove deprecated LeveledMeter from the generated code (#11696)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-11-19 10:50:15 -08:00
Bogdan Drutu 8e522ad950
Revert public API changes in #10931, preserve logic (#11415)
This PR removes APIs that expose `configtelemetry.Level`. Internal
functionality still uses the Level, but will be soon changed to use the
new Instrument.Enabled.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-11-15 16:49:51 -08:00
Bogdan Drutu 2748e5358d
[chore] Use NopTelemetrySettings instead of mock providers (#11539)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-25 14:57:43 -07:00
Bogdan Drutu d1286186b7
Remove deprecated funcs form processorhelper.ObsReport (#11289)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-09-27 16:13:45 -07:00
Alex Boten ef07ea0735
[mdatagen] move ScopeName to generated_status (#10848)
This will make it available to most components, as the
generated_telemetry is only generated for components that have internal
telemetry configured. Arguably the scope name should be moved to its own
file, but i'd rather not add yet another file if possible.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-08-09 12:10:11 -07:00
Alex Boten c555005fcc
[mdatagen] only generate telemetry as needed (#10129)
This prevent unnecessary files from being generated if metadata.yaml
doesn't include any internal telemetry for a component.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-09 12:05:32 -07:00
Alex Boten ce09d9773a
[mdatagen] move telemetry into its own file (#10037)
This is in preparation for using mdatagen for component telemetry.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-04-29 12:11:55 -07:00
Antoine Toulme 2a6a3f9eab
[chore] rework memorylimiter test to avoid flaky tests (#9733)
Peeling this set of changes from #9584 as a separate PR.

These changes allow a reduction of issues when working with ARM64, which
seems to fail on some of the resource locking used in those tests.
2024-03-19 10:14:15 -07:00
Dmitrii Anoshin 78692b78c3
[chore] [cmd/mdatagen] Update status.go template (#9713)
To produce the same output as mdatagen in contrib. It makes it easy to
compare the diff for the mdatagen migration.
2024-03-05 13:35:54 -08:00
Alex Boten aa764826e1
[mdatagen] produce scope name with full url (#9556)
This is part of #9494

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-02-14 07:49:56 -08: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 dbaec76447
[chore] use mdatagen for memorylimiter processor (#9182)
Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-12-22 09:24:37 -08: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
Dmitrii Anoshin fb8eccacff
[chore] [processor/memorylimiter] Fix data race in a test (#7561) 2023-04-25 08:12:25 -07:00
Tigran Najaryan b1426afc1b
Clarify that memory limiter refuses data, doesn't drop it (#7459)
Contributes to https://github.com/open-telemetry/opentelemetry-collector/issues/1084

- Clarify what the memory limiter does.
- Set expectations from receivers, how they are supposed to react
  when the memory limiter refuses the data.
- Add a test that demonstrates that memory limiter does not lose data
  if the receiver and exporter behave according to the contract.

All receivers must adhere to this contract. See for example
an issue opened against filelog receiver:
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/20511

Note that there are no functional changes to the memory limiter.

Future work: one additional thing we can do is implement a backoff
logic in the memory limiter. When in memory limited mode the processor
can introduce pauses before it returns from the ConsumeLogs/Traces/Metrics
call. This will allow to slow down the inflow of data into the Collector
and give time for the pipeline to clear and memory usage to return to the
normal. This needs to be explored further.
2023-04-03 08:45:25 -07:00