Logging is here!

Directory

Agent Check Agent Check

Supported OS: Linux Mac OS Windows

Overview

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

Setup

Installation

The directory check is included in the Datadog Agent package, so you don’t need to install anything else on your server.

Configuration

  1. Edit the directory.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s directory to start collecting Directory performance data.
    See the sample directory.d/conf.yaml for all available configuration options.

      init_config:
    
      instances:
        - 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.
          ignore_missing: False           # set to True to not raise exceptions on missing or inaccessible directories

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

  2. Restart the Agent.

Validation

Run the Agent’s status subcommand and look for directory under the Checks section.

Data Collected

Metrics

system.disk.directory.file.bytes
(gauge)
Total size of the file
shown as byte
system.disk.directory.file.modified_sec_ago
(gauge)
Duration since last modification
shown as second
system.disk.directory.file.created_sec_ago
(gauge)
Duration since creation
shown as second
system.disk.directory.files
(gauge)
Number of files in the directory
shown as file
system.disk.directory.bytes
(gauge)
Total size of the directory
shown as byte

Events

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

Service Checks

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

Troubleshooting

Need help? Contact Datadog Support.

Further Reading

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