Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.0] TBS: change default disk usage threshold to 0.8 (backport #15524) #15525

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions changelogs/all-breaking-changes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ The following breaking changes are introduced in APM version 9.0.0:

- Change `sampling.tail.storage_limit` default to `0`.
While `0` means unlimited local tail-sampling database size,
it now enforces a max 90% disk usage on the disk where the data directory is located.
it now enforces a max 80% disk usage on the disk where the data directory is located.
Any tail sampling writes after this threshold will be rejected,
similar to what happens when tail-sampling database size exceeds a non-0 storage limit.
Setting `sampling.tail.storage_limit` to non-0 maintains the existing behavior
which limits the tail-sampling database size to `sampling.tail.storage_limit`
and does not have the new disk usage threshold check.
For more details, see https://github.com/elastic/apm-server/pull/15467[PR #15467]
For more details, see https://github.com/elastic/apm-server/pull/15467[PR #15467] and
https://github.com/elastic/apm-server/pull/15524[PR #15524]
// end::90-bc[]

// tag::811-bc[]
Expand Down
2 changes: 1 addition & 1 deletion changelogs/head.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ https://github.com/elastic/apm-server/compare/8.16\...8.x[View commits]

[float]
==== Breaking Changes
- Change `sampling.tail.storage_limit` default to `0`. While `0` means unlimited local tail-sampling database size, it now enforces a max 90% disk usage on the disk where the data directory is located. Any tail sampling writes after this threshold will be rejected, similar to what happens when tail-sampling database size exceeds a non-0 storage limit. Setting `sampling.tail.storage_limit` to non-0 maintains the existing behavior which limits the tail-sampling database size to `sampling.tail.storage_limit` and does not have the new disk usage threshold check. {pull}15467[15467]
- Change `sampling.tail.storage_limit` default to `0`. While `0` means unlimited local tail-sampling database size, it now enforces a max 80% disk usage on the disk where the data directory is located. Any tail sampling writes after this threshold will be rejected, similar to what happens when tail-sampling database size exceeds a non-0 storage limit. Setting `sampling.tail.storage_limit` to non-0 maintains the existing behavior which limits the tail-sampling database size to `sampling.tail.storage_limit` and does not have the new disk usage threshold check. {pull}15467[15467] {pull}15524[15524]

[float]
==== Deprecations
Expand Down
2 changes: 1 addition & 1 deletion internal/beater/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func TestUnpackConfig(t *testing.T) {
IngestRateDecayFactor: 0.25,
StorageLimit: "0",
StorageLimitParsed: 0,
DiskUsageThreshold: 0.9,
DiskUsageThreshold: 0.8,
TTL: 30 * time.Minute,
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/beater/config/sampling.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func defaultTailSamplingConfig() TailSamplingConfig {
IngestRateDecayFactor: 0.25,
TTL: 30 * time.Minute,
StorageLimit: "0",
DiskUsageThreshold: 0.9,
DiskUsageThreshold: 0.8,
DiscardOnWriteFailure: false,
}
parsed, err := humanize.ParseBytes(cfg.StorageLimit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func (sm *StorageManager) NewReadWriter(storageLimit uint64, diskUsageThreshold
return uint64(float64(sm.cachedDiskStat.total.Load()) * diskUsageThreshold)
}
// the total disk space could change in runtime, but it is still useful to print it out in logs.
sm.logger.Infof("setting disk usage threshold to %.2f of total disk space of %0.1fgb", diskUsageThreshold, float64(sm.cachedDiskStat.total.Load())/gb)
sm.logger.Infof("setting disk usage threshold to %.0f%% of total disk space of %0.1fgb", diskUsageThreshold*100, float64(sm.cachedDiskStat.total.Load())/gb)
diskThresholdChecker := NewStorageLimitCheckerFunc(sm.diskUsed, diskThreshold)
rw = NewStorageLimitReadWriter(
fmt.Sprintf("disk usage threshold %.2f", diskUsageThreshold),
Expand Down
Loading