influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.63k stars 5.58k forks source link

old internal metric still exist when plugin config remove #14293

Closed like-inspur closed 11 months ago

like-inspur commented 11 months ago

Relevant telegraf.conf

normal config include one plugin

Logs from Telegraf

logs output normally

System info

Telegraf 1.26.0 Docker 19.03.14

Docker

No response

Steps to reproduce

  1. remove one plugin config and wait config reload
  2. internal metric stil include plugin which has been removed
  3. ...

Expected behavior

internal metric not include plugin which has been removed

Actual behavior

internal metric stil include plugin which has been removed

Additional info

No response

Hipska commented 11 months ago

Can you show sample metrics you are getting but don't expect and a relevant part of your config please?

powersj commented 11 months ago

Hi,

The internal metrics are registered when plugins are created during start up (e.g. in models/running_*.go). When a user reloads telegraf due to a config change, new plugins, or additions, will get registered during the reload. Plugins that were removed are not handled. We do not have any state of what metrics previously existed but no longer. We also would not want to remove all internal metrics during a reload as that would break backwards compatibility and reset all of a user's metrics.

I think this will need to stay as-is, and as such I will close this.