michael-doubez / filestat_exporter Goto Github PK
View Code? Open in Web Editor NEWPrometheus exporter gathering metrics about file size, modification time and other stats
License: Apache License 2.0
Prometheus exporter gathering metrics about file size, modification time and other stats
License: Apache License 2.0
Hi!
The docker hub image is still v0.3.5
whereas the v0.3.6
has already been released here.
Is there a possibility that you could update the docker hub image to v0.3.6
as well?
Hiya,
Appreciate the filestat exporter.
Would it be possible to add sparse file detection and its actual byte sizing?
Thanks
A
Nice exporter!
Is it possible to have shell expansions (command substitution) in the pattern of the config file?
I have tried but not got it to work.
If it isn't possible today, could you implement it?
For example to catch a file with todays date:
/tmp/*_`date +%Y%m%d`.log
Is there a way to monitor file backup availabe for last 24 hrs.
Since i was trying with
time() - file_stat_modif_time_seconds{instance="server:63387"} < 86400
This is one of those edge case things that might not affect many instances. By the way this exporter is a lifesaver for a very specific problem I have been dealing with.
Problem: The physical order of the patterns in the config file seems to affect the count.
Example: yaml
...
files:
- patterns:
- "/main_dir/*"
- "/main_dir/Troubled_file*"
...
Result:
main_dir count will be accurate, but the specific file pattern within main_dir are grossly under counted. While ls -l /main_dir/Troubled_file* | wc -l
would show around 500 of the specific files exporter would show ~0-1 sometimes 10.
Fix: yaml
...
files:
- patterns:
- "/main_dir/Troubled_file*"
- "/main_dir/*"
...
Result fix:
main_dir file count and specific file pattern within main_dir seem to be more accurate.
Probably not worth a code change, but maybe a note in the documentation.
[NEW Feature]
it's possible to add a scheduled monitoring feature to activate file monitoring at a specific time.
I'm using this exporter mostly to keep an eye on the number of files in a specific folder, and it works beautifully.
However, I don't need to have the file size of modified date to be recorded for every file that appears in a folder.
For folders that are used heavily this generates a huge amount of metrics generated that are never used and put a some strain on our Prometheus installation. It might be useful to have the ability to enable/disable specific metrics from being generated for use cases like this.
Hello , encountered the following problem, there are 3 files test.txt here is my filestat.yaml
exporter:
listen_address: ':9943'
metrics_path: /metrics
working_directory: "/app"
# Default enable/disable of metrics - overridden if not set by parameter '-metric.*'
enable_crc32_metric: true
# enable_nb_line_metric: false
# list of patterns to apply - metrics can be enable/disabled for each group
files:
- patterns: ["test1.txt","test2.txt","test23.txt"]
enable_nb_line_metric: true
enable_crc32_metric: true
The received metrics look like this and when changing the content of files hash change, but when deleting a file, for example test1.txt metrics do not change in any way. Also if you recreate the file test1.txt. the metrics will not change in any way.
HELP file_content_hash_crc32 CRC32 hash of file content using the IEEE polynomial
TYPE file_content_hash_crc32 gauge
file_content_hash_crc32{path="test1.txt"} 3.85946783e+09
file_content_hash_crc32{path="test2.txt"} 2.657284769e+09
file_content_hash_crc32{path="test23.txt"} 7.73236185e+08
I would be grateful to find a solution.
Is there any way to monitor directories with this exporter??
I tried following patterns but it didn't work:
.
*
**
/**/
I was trying to build the dist-windows-386
but the package is removed immediatly and building just with dist
only builds amd64 versions.
The 0.3.6 version starts to report an error
OS Version: CentOS Linux release 7.6.1810 (Core)
/usr/local/prometheus/filestat_exporter: /lib64/libc.so.6: version GLIBC_2.32' not found (required by /usr/local/prometheus/filestat_exporter) /usr/local/prometheus/filestat_exporter: /lib64/libc.so.6: version
GLIBC_2.34' not found (required by /usr/local/prometheus/filestat_exporter)
Is there any way to monitor files in different directories? For example
We want to be able to list all files matching a certain pattern in a directory or subdirectories of that directory. This is not possible in the current situation. Something like ** which works for Python globs would be a nice feature. For example when using "test/**/*.txt" as a pattern, this would look for all .txt files in the test directory and all its subdirectories.
It seems a final slash is missing on all the output:
filestat.yml:
exporter:
#! Working directory of exporter
working_directory: "/dir1/dir2/dir3/"
#! Network parameters
#listen_address: ':9943'
#metrics_path: /metrics
#! Uncomment one of the following to enable default config
#enable_crc32_metric: true
#enable_nb_line_metric: true
# list of patterns to apply
files:
- patterns: ["*/*/.ERROR"]
- patterns: ["*/*/*.ERROR"]
- patterns: ["*/*/*/*.ERROR"]
Metric output:
file_glob_match_number{pattern="*/*/*.ERROR"} 294
file_glob_match_number{pattern="*/*/*/*.ERROR"} 36
file_glob_match_number{pattern="*/*/.ERROR"} 0
file_stat_size_bytes{path="dir/dir/dir20201208164827.xml.ERROR"} 171
file_stat_size_bytes{path="dir/dir/dir20201208165023.xml.ERROR"} 17
The files are actually located at:
/dir1/dir2/dir3/dir/dir/dir/20201208164827.xml.ERROR
/dir1/dir2/dir3/dir/dir/dir/20201208165023.xml.ERROR
Between the filename and the last directory a slash seems missing.
Is this expected, an issue with configuration, a bug or me not understanding something?
Thanks!
crc32, unix time and other metrics should stay int so they can be compared, instead the output coes out as float. size in megabytes instead of bytes is less of an issue, but it would be nice to have it consistent.
Hi,
Appreciate the filestat exporter.
Would it be possible to get owner of the file?
Thanks
Ravi
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.