How to rotate telegraph output plugin file

We would like to be able to run some custom transformations on the metrics that are output and then write the transformed metrics to a different log file.

However we do not want the metrics output file to keep on growing on. We would like to be able to configure telegraf such that the output metric file gets rotated based on time or size

Is there some thing that can be configured to achieve the same?

-suresh

We don’t have support for this in Telegraf but I think you could use a log rotation program, such as logrotate, to rotate the output.

We had run out of disk space a while back, at that time even after deleting the file the space occupied was not getting released. We had to restart the telegraf agent.

If we rotate the log file externally is there any chance that we may run into this disk space issue?
How would telegraf handle it if the file is all of sudden truncated by an external program?

If we rotate the log file externally is there any chance that we may run into this disk space issue?

It is possible still, but you can configure logrotate to be triggered when the file reaches a certain size.

How would telegraf handle it if the file is all of sudden truncated by an external program?

I forgot to clarify, bug you are using the file output right? I have not tested but I believe this will be fine, as Telegraf only appends to the file.