One of the most valuable aspects of the Datadog agent is its extensibility. Although the platform provides numerous out-of-the-box integrations, edge cases frequently emerge that demand custom solutions.
This article presents a straightforward custom check that monitors file existence. When a target file is found, the check reports success; if absent, it logs an error tagged with the filename. Additionally, the solution captures file.age and file.modified metrics when files exist, both tagged by filename for easy identification and aging tracking.
The implementation is available in the author’s GitHub repository at the file-check directory.