Skip to content

Commit

Permalink
memorylimiterprocessor: Remove deprecated config (already no-op) ball…
Browse files Browse the repository at this point in the history
…ast_size_mib (#4365)

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Nov 4, 2021
1 parent 484e315 commit 0b4e5ec
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## 🛑 Breaking changes 🛑

- Remove deprecated config (already no-op) `ballast_size_mib` in memorylimiterprocessor (#4365)
- Remove `config.Receivers`, `config.Exporters`, `config.Processors`, and `config.Extensions`. Use map directly (#4344)
- Remove `component.BaseProcessorFactory`, use `processorhelper.NewFactory` instead (#4175)
- Force usage of `exporterhelper.NewFactory` to implement `component.ExporterFactory` (#4338)
Expand Down
5 changes: 0 additions & 5 deletions processor/memorylimiterprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ value (otherwise memory usage may exceed the hard limit - even if temporarily).
A good starting point for `spike_limit_mib` is 20% of the hard limit. Bigger
`spike_limit_mib` values may be necessary for spiky traffic or for longer check intervals.

In addition, if the ballast size is specified in [ballastextension](../../extension/ballastextension),
the same value that is provided via the `ballastextension` will be used in `memory_limitor` for
calculating the total allocated memory for the collector.
The `memory_limiter.ballast_size_mib` config has been deprecated and will be removed soon.

Note that while the processor can help mitigate out of memory situations,
it is not a replacement for properly sizing and configuring the
collector. Keep in mind that if the soft limit is crossed, the collector will
Expand Down
6 changes: 1 addition & 5 deletions processor/memorylimiterprocessor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,10 @@ type Config struct {
// measurements of memory usage.
MemorySpikeLimitMiB uint32 `mapstructure:"spike_limit_mib"`

// BallastSizeMiB is the size, in MiB, of the ballast size being used by the
// process.
// Deprecated: use the ballast size configuration in `ballastextension` component instead.
BallastSizeMiB uint32 `mapstructure:"ballast_size_mib"`

// MemoryLimitPercentage is the maximum amount of memory, in %, targeted to be
// allocated by the process. The fixed memory settings MemoryLimitMiB has a higher precedence.
MemoryLimitPercentage uint32 `mapstructure:"limit_percentage"`

// MemorySpikePercentage is the maximum, in percents against the total memory,
// spike expected between the measurements of memory usage.
MemorySpikePercentage uint32 `mapstructure:"spike_limit_percentage"`
Expand Down
1 change: 0 additions & 1 deletion processor/memorylimiterprocessor/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ func TestLoadConfig(t *testing.T) {
CheckInterval: 5 * time.Second,
MemoryLimitMiB: 4000,
MemorySpikeLimitMiB: 500,
BallastSizeMiB: 2000,
})
}
1 change: 0 additions & 1 deletion processor/memorylimiterprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func TestCreateProcessor(t *testing.T) {
pCfg := cfg.(*Config)
pCfg.MemoryLimitMiB = 5722
pCfg.MemorySpikeLimitMiB = 1907
pCfg.BallastSizeMiB = 2048
pCfg.CheckInterval = 100 * time.Millisecond

tp, err = factory.CreateTracesProcessor(context.Background(), componenttest.NewNopProcessorCreateSettings(), cfg, consumertest.NewNop())
Expand Down
5 changes: 0 additions & 5 deletions processor/memorylimiterprocessor/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ processors:
# The maximum, in MiB, spike expected between the measurements of memory usage.
spike_limit_mib: 500

# BallastSizeMiB is the size, in MiB, of the ballast size being used by the process.
# This must match the value of mem-ballast-size-mib command line option (if used)
# otherwise the memory limiter will not work correctly.
ballast_size_mib: 2000

exporters:
nop:

Expand Down

0 comments on commit 0b4e5ec

Please sign in to comment.