Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 1.14 KB

README.md

File metadata and controls

48 lines (33 loc) · 1.14 KB

Prometheus File Exporter

Feature(s)

Counts files in given directory

Usage

Flags

--observe -- sets directory path which should be monitored for file count

--exclude -- works with --observe. If path given in --observe contains path given in --exclude then that path is being ignored in file_count.

--port -- Configures listening port for exporter. Defaults to 9111

Example

Example with given tree:

a
|____b
| |____c
| | |____C
| |____B
|____A

Directory 'a' contains file 'A' and subdir 'b'. We can see that there are 3 total files represented by numbers. If we pass plain --observe=/a the result of path_file_count will be 3. In case we pass --exclude=/a/b/c --observe=/a value of path_file_count will be 2

Command

prometheus_file_exporter [--observe=<>] [--exclude=<>] [--port=<>]

Best Practice

!! DO NOT PUT DIRECTORY WITH LARGE NUMBER OF SUBDIRECTORIES IN A SINGLE --observe !!!

GOOD

prometheus_file_exporter --observe=/data/subdir-1 --observe=/data/subdir-2 --observe=/data/subdir-3 

BAD

prometheus_file_exporter --observe=/data/