Skip to content

Commit

Permalink
[AMLII-1976] Disk Management for Logs From Integrations (#28079)
Browse files Browse the repository at this point in the history
Co-authored-by: carlosroman <[email protected]>
Co-authored-by: gh123man <[email protected]>
  • Loading branch information
3 people authored Oct 1, 2024
1 parent 0123bf2 commit 86d8c29
Show file tree
Hide file tree
Showing 4 changed files with 548 additions and 80 deletions.
14 changes: 10 additions & 4 deletions pkg/config/config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1015,12 +1015,18 @@ api_key:
#
# max_message_size_bytes: 256000

## @param integrations_logs_files_max_size - integer - optional - default: 100
## @env DD_LOGS_CONFIG_INTEGRATIONS_LOGS_FILES_MAX_SIZE - integer - optional - default: 100
## The combined size in MB of all the integration logs files the Agent is allowed to write.
## @param integrations_logs_files_max_size - integer - optional - default: 10
## @env DD_LOGS_CONFIG_INTEGRATIONS_LOGS_FILES_MAX_SIZE - integer - optional - default: 10
## The max size in MB that an integration logs file is allowed to use
#
# integrations_logs_files_max_size

## @param integrations_logs_total_usage - integer - optional - default: 100
## @env DD_LOGS_CONFIG_INTEGRATIONS_LOGS_TOTAL_USAGE - integer - optional - default: 100
## The total combined usage all integrations logs files can use
#
# integrations_logs_total_usage

{{ end -}}
{{- if .TraceAgent }}

Expand Down Expand Up @@ -1736,7 +1742,7 @@ api_key:
# enabled: false
{{- if (eq .OS "linux")}}


# container_image:
# enabled: false
{{ end -}}
Expand Down
10 changes: 7 additions & 3 deletions pkg/config/setup/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1566,12 +1566,16 @@ func logsagent(config pkgconfigmodel.Setup) {
// more disk I/O at the wildcard log paths
config.BindEnvAndSetDefault("logs_config.file_wildcard_selection_mode", "by_name")

// Max size in MB an integration logs file can use
config.BindEnvAndSetDefault("logs_config.integrations_logs_files_max_size", 10)
// Max disk usage in MB all integrations logs files are allowed to use in total
config.BindEnvAndSetDefault("logs_config.integrations_logs_total_usage", 100)
// Do not store logs on disk when the disk usage exceeds 80% of the disk capacity.
config.BindEnvAndSetDefault("logs_config.integrations_logs_disk_ratio", 0.80)

// SDS logs blocking mechanism
config.BindEnvAndSetDefault("logs_config.sds.wait_for_configuration", "")
config.BindEnvAndSetDefault("logs_config.sds.buffer_max_size", 0)

// Max size in MB to allow for integrations logs files
config.BindEnvAndSetDefault("logs_config.integrations_logs_files_max_size", 100)
}

func vector(config pkgconfigmodel.Setup) {
Expand Down
Loading

0 comments on commit 86d8c29

Please sign in to comment.