fix(agent): Avoid panic by checking for skip_processors_after_aggregators (#16477)

This commit is contained in:
Sven Rebhan 2025-02-05 16:12:51 +01:00 committed by GitHub
parent 1b2e012f4b
commit d00ee7c0cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import (
"os"
"path/filepath"
"github.com/fatih/color"
"github.com/urfave/cli/v2"
"github.com/influxdata/telegraf/agent"
@ -85,6 +86,16 @@ func getConfigCommands(configHandlingFlags []cli.Flag, outputBuffer io.Writer) [
}
ag := agent.NewAgent(c)
// Set the default for processor skipping
if c.Agent.SkipProcessorsAfterAggregators == nil {
msg := `The default value of 'skip_processors_after_aggregators' will change to 'true' with Telegraf v1.40.0! `
msg += `If you need the current default behavior, please explicitly set the option to 'false'!`
log.Print("W! [agent] ", color.YellowString(msg))
skipProcessorsAfterAggregators := false
c.Agent.SkipProcessorsAfterAggregators = &skipProcessorsAfterAggregators
}
return ag.InitPlugins()
},
},