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

fix(agent): Fix buffer directory config and document #15661

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 6 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1513,8 +1513,10 @@ func (c *Config) buildOutput(name string, tbl *ast.Table) (*models.OutputConfig,
return nil, err
}
oc := &models.OutputConfig{
Name: name,
Filter: filter,
Name: name,
Filter: filter,
BufferStrategy: c.Agent.BufferStrategy,
BufferDirectory: c.Agent.BufferDirectory,
}

// TODO: support FieldPass/FieldDrop on outputs
Expand All @@ -1529,8 +1531,6 @@ func (c *Config) buildOutput(name string, tbl *ast.Table) (*models.OutputConfig,
c.getFieldString(tbl, "name_suffix", &oc.NameSuffix)
c.getFieldString(tbl, "name_prefix", &oc.NamePrefix)
c.getFieldString(tbl, "startup_error_behavior", &oc.StartupErrorBehavior)
c.getFieldString(tbl, "buffer_strategy", &oc.BufferStrategy)
c.getFieldString(tbl, "buffer_directory", &oc.BufferDirectory)

if c.hasErrs() {
return nil, c.firstErr()
Expand Down Expand Up @@ -1559,7 +1559,8 @@ func (c *Config) missingTomlField(_ reflect.Type, key string) error {
"name_override", "name_prefix", "name_suffix", "namedrop", "namedrop_separator", "namepass", "namepass_separator",
"order",
"pass", "period", "precision",
"tagdrop", "tagexclude", "taginclude", "tagpass", "tags", "startup_error_behavior":
"tagdrop", "tagexclude", "taginclude", "tagpass", "tags", "startup_error_behavior",
"buffer_strategy", "buffer_directory":
DStrand1 marked this conversation as resolved.
Show resolved Hide resolved

// Secret-store options to ignore
case "id":
Expand Down
7 changes: 6 additions & 1 deletion docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,12 @@ The agent table configures Telegraf and the defaults used across all plugins.
The type of buffer to use for telegraf output plugins. Supported modes are
`memory`, the default and original buffer type, and `disk`, an experimental
disk-backed buffer which will serialize all metrics to disk as needed to
improve data durability and reduce the chance for data loss.
improve data durability and reduce the chance for data loss. This is only
supported at the agent level.

- **buffer_directory**:
The directory to use when in `disk` buffer mode. Each output plugin will make
another subdirectory in this directory with the output plugin's name.

## Plugins

Expand Down
Loading