newrelic / nri-flex

An application-agnostic, all-in-one New Relic integration integration
https://docs.newrelic.com/docs/introduction-new-relics-flex-integration
Apache License 2.0
107 stars 119 forks source link

Option to skip sample collection if file write time is too old #509

Open tt2468 opened 1 month ago

tt2468 commented 1 month ago

Description

I've searched as hard as I can and can't seem to find this functionality in nri-flex.

I have a file on disk which gets written to every 30 seconds. I would like to have nri-flex skip sampling from the file if it hasn't been modified within a configurable time. This is to prevent potentially inaccurate data from being sampled if, say, the program writing the file crashes.

Acceptance Criteria

Unknown

Describe Alternatives

In theory, I could use run: instead of file:, but that would mean I'm suddenly having to implement a bunch of handling that file: probably already takes care of. If I ping my program with HTTP and it has crashed, it obviously won't respond. But there's no reliable way to have such implicit behavior with writing files to disk outside of checking the last modified time.

Dependencies

Unknown

Additional context

None

Estimates

Unknown

workato-integration[bot] commented 1 month ago

https://new-relic.atlassian.net/browse/NR-288502