Skip to content

[input.file] Limit read data #18137

@tguenneguez

Description

@tguenneguez

Relevant telegraf.conf

[[inputs.filestat]]
  files = ["/tmp/test.log"]

Logs from Telegraf

2025-12-16T16:34:53Z I! [outputs.prometheus_client] Listening on https://0.0.0.0:4493/metrics
2025-12-16T16:35:55Z W! [inputs.file] Collection took longer than expected; not complete after interval of 31s
2025-12-16T16:36:26Z W! [inputs.file] Collection took longer than expected; not complete after interval of 31s
2025-12-16T16:36:57Z W! [inputs.file] Collection took longer than expected; not complete after interval of 31s
2025-12-16T16:37:28Z W! [inputs.file] Collection took longer than expected; not complete after interval of 31s

System info

Telegraf 1.37.0

Docker

RAS

Steps to reproduce

  1. Add file supervision
  2. Put big content in file (for example 1.7 Go)
  3. CPU used by agent is very height

Expected behavior

It will be greate to be abble to limit read size of file content to protect agent.

Actual behavior

Agent never read all content of file and use a lot of CPU.

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions