Skip to content

Command line option to avoid loading the local telegraf.conf and telegraf.d/** #18961

@poulhs

Description

@poulhs

Use Case

When using the telegraf-controller (or any other http-configuration end-point) the presence of /etc/telegraf/telegraf.conf (and telegraf.d/) may be in conflict with what is fetched from the http end-point.
e.g.:
W! Overlapping settings in multiple agent tables are not supported: may cause undefined behavior

Being able to avoid loading the default configuration would be appreciated, as managing configuration both central and local may be obfuscating, cause much more debugging and may produce unexpected behaviors.
(The telegraf.conf MUST be present for telegraf to start).
As the telegraf.service includes the
-config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d $TELEGRAF_OPTS
the preferred way may be to to include (in $TELEGRAF_OPTS) some flag indicating that the previous configuration flags should be ignored...

There will be cases where one has full control and wants both remote and local configuration.

Expected behavior

It should be possible to add a command line flag (or an environment variable) so that telegraf ignores the local configuration.

Actual behavior

when telegraf starts and fetches a remote configuration that contains the [agent] section it produces a warning:
W! Overlapping settings in multiple agent tables are not supported: may cause undefined behavior

Additional info

[agent]
  interval = "10s"
  round_interval = true

and all the other things in [agent] that one may want to override centally

Metadata

Metadata

Assignees

Labels

feature requestRequests for new plugin and for new features to existing plugins

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions