Skip to content

Commit ca131ce

Browse files
authored
[AGNTLOG-618] Default file_scan_period to 1s (#49896)
### What does this PR do? - Changes the default value of `logs_config.file_scan_period` from **10** seconds to **1** second. - Updates `pkg/config/schema/core_schema.yaml` to match the new default. - Adds a release note describing the change and how to opt out (slower scan) on hosts that need it. ### Motivation The file log launcher uses this setting to schedule periodic filesystem scans for file-based log sources (new files, wildcards, rotation, and open-files selection). A 1 second default shortens the worst-case delay before the Agent discovers and starts tailing a new or rotated file. Deployments on slow or network-backed filesystems that need to limit metadata load can set `logs_config.file_scan_period` to a higher value in configuration. ### Describe how you validated your changes - `inv test --targets=./pkg/config/setup` (all tests passed). ### Additional Notes - This only affects the **file** log launcher’s scan cadence, not the idle read interval for an already open file. - Users with an explicit `logs_config.file_scan_period` in `datadog.yaml` (or equivalent) are unchanged. Co-authored-by: ryan.hall <ryan.hall@datadoghq.com>
1 parent 878331b commit ca131ce

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/config/schema/core_schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2253,7 +2253,7 @@ properties:
22532253
file_scan_period:
22542254
node_type: setting
22552255
type: number
2256-
default: 10
2256+
default: 1
22572257
tags:
22582258
- golang_type:float64
22592259
fingerprint_config:

pkg/config/setup/common_settings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ func logsagent(config pkgconfigmodel.Setup) {
18931893
// could happen while serializing large objects on log lines.
18941894
config.BindEnvAndSetDefault("logs_config.aggregation_timeout", 1000)
18951895
// Time in seconds
1896-
config.BindEnvAndSetDefault("logs_config.file_scan_period", 10.0)
1896+
config.BindEnvAndSetDefault("logs_config.file_scan_period", 1.0)
18971897

18981898
// Controls how wildcard file log source are prioritized when there are more files
18991899
// that match wildcard log configurations than the `logs_config.open_files_limit`
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
enhancements:
3+
- |
4+
The default for ``logs_config.file_scan_period`` is now **1** second instead of 10, so the Agent discovers new and rotated log files on disk more quickly. Set ``logs_config.file_scan_period`` explicitly if you need a slower scan to reduce filesystem load (for example on network file systems).

0 commit comments

Comments
 (0)