Directory check


Capture metrics from directories and files of your choosing. The Agent will collect:

  • number of files
  • file size
  • age of the last modification
  • age of the creation



The directory check is packaged with the Agent, so simply install the Agent anywhere you wish to use it.


  1. Edit your directory.yaml file in the Agent’s conf.d directory. See the sample directory.yaml for all available configuration options:

  - directory: "/path/to/directory" # the only required option
    name: "my_monitored_dir"        # What the Agent will tag this directory's metrics with. Defaults to "directory"
    pattern: "*.log"                # defaults to "*" (all files)
    recursive: True                 # default False
    countonly: False                # set to True to only collect the number of files matching 'pattern'. Useful for very large directories.

Ensure that the user running the Agent process (usually dd-agent) has read access to the directories, subdirectories, and files you configure.

  1. Restart the Agent.


Run the Agent’s info subcommand and look for directory under the Checks section:


      - instance #0 [OK]
      - Collected 26 metrics, 0 events & 1 service check



The directory check is compatible with all major platforms.

Data Collected

Total size of the file
shown as byte
Duration since last modification
shown as second
Duration since creation
shown as second
Number of files in the directory
shown as file
Total size of the directory
shown as byte


The Directory check does not include any event at this time.

Service Checks

The Directory check does not include any service check at this time.


Need help? Contact Datadog Support.

Further Reading

Learn more about infrastructure monitoring and all our integrations on our blog