Capture metrics from the files in given directories:
To capture Directory metrics you need to install the Stackstate Agent.
sts-agent) has read access to the monitored directory and files.
Configure the Agent to connect to your directories. Edit
directory.yaml in your
init_config: instances: # For each instance, the 'directory' parameter is required, all others are optional. # # Instances take the following parameters: # "directory" - string, the directory to monitor. Required. # "name" - string, tag metrics with specified name. defaults to the "directory" # "pattern" - string, the `fnmatch` pattern to use when reading the "directory"'s files. # default "*" # "recursive" - boolean, when true the stats will recurse into directories. default False # "countonly" - boolean, when true the stats will only count the number of files matching the pattern. Useful for very large directories. - directory: "/path/to/directory" name: "tag_name" pattern: "*.log" recursive: True
For more details about configuring this integration refer to the following file(s) on GitHub:
To validate that the check has passed run the agent info command. The output of the command should contain a section similar to the following:
Checks ====== [...] directory --------- - instance #0 [OK] - Collected 8 metrics & 0 events