Commit Graph

6 Commits

Author SHA1 Message Date
Antoine Toulme fce1d4619d
[chore] rely on strict input parsing to error out on invalid unsigned int values (#10609)
This removes a hook for confmap that was used to handle invalid uint
values, now that
https://github.com/open-telemetry/opentelemetry-collector/issues/9532 is
fixed.

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-08-20 10:48:58 +02:00
Tyler Helmuth 4e44e32280
[service] Remove getBallastSize from service (#10696)
#### Description

This PR removes all ballast logic from service. This effectively
deprecates the ballastextension as including the extension with this
service would do nothing.

Related to
https://github.com/open-telemetry/opentelemetry-collector/pull/10671

#### Link to tracking issue
Closes
https://github.com/open-telemetry/opentelemetry-collector/issues/8342

#### Testing
Unit tests.
2024-07-23 14:59:53 -07:00
Antoine Toulme 9a21643a54
[config] Deprecate component.UnmarshalConfig (#9750)
**Description:**
This PR removes the top level if/else in `component.UnmarshalConfig`,
handling recursive state in the confmap.Conf object instead.
This PR deprecates `component.UnmarshalConfig` in favor of calling
directly `Unmarshal` on the confmap.Conf object.

**Link to tracking Issue:**
Fixes #7102
Fixes #7101

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
2024-05-29 11:07:52 +02:00
Curtis Robert 4a5809293b
[confmap] Return error when decoding negative values into uints (#9169)
**Description:**
This adds a decode hook for unmarshalling negative integers into uint
types. This will now return an error instead of converting negative
values into large uint values.

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

**Testing:**
Added unit tests for confmap functionality, functional tests in memory
limiter processor (the original component this issue was filed against)
2024-04-19 13:48:32 +02: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
splunkertimn a85b37df73
[extension/memorylimiter] add memory limiter extension, a copy of memorylimiter processor (#8964)
**Description:**

Following
https://github.com/open-telemetry/opentelemetry-collector/issues/8632,
this change introduces memory limiter as an extension. This allows
us to place the component to reject incoming connections due to limited
memory, providing better protection from running out of memory.

missing feature: receiver fairness. issue where a receiver hogs all the
resource can happen.

**Link to tracking Issue:** <Issue number if applicable>
 https://github.com/open-telemetry/opentelemetry-collector/issues/8632

---------

Co-authored-by: Dmitry Anoshin <anoshindx@gmail.com>
2024-01-23 10:44:46 -08:00