Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring of directories #24

Open
nischalstha9 opened this issue Jun 21, 2022 · 4 comments
Open

Monitoring of directories #24

nischalstha9 opened this issue Jun 21, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@nischalstha9
Copy link

Is there any way to monitor directories with this exporter??
I tried following patterns but it didn't work:

  • .
  • *
  • **
  • /**/
@michael-doubez
Copy link
Owner

Not as such. You can compute metrics from the files inside a directory: count() for the number of files, sum() on file size for directory size and max() on timestamp for last modification.

@ottoayoub
Copy link

Hello michael, how about monitoring files in 2 separated directories?
is there a way to monitor two directories with the same configfile.yml?

@carolili
Copy link

I was able to use the following configuration from the example in the README, in case it helps. You would need to find a list of file extensions or patterns to monitor in order to catch files in your directory. If you don't have a pattern among the files it would be more difficult.

      files:
        - patterns: ["directory1/myfile-*"]
        - patterns: ["directory2/otherfile-*"]

@nischalstha9
Copy link
Author

nischalstha9 commented Jun 28, 2022

Just in case if you want to monitor just the size of directory. Created my custom exporter
https://github.com/nischalstha9/prometheus-directory-size-exporter

@michael-doubez michael-doubez self-assigned this Mar 1, 2023
@michael-doubez michael-doubez added the enhancement New feature or request label Mar 1, 2023
@michael-doubez michael-doubez added this to the v0.3.7 milestone Mar 1, 2023
@michael-doubez michael-doubez modified the milestones: v0.3.7, v0.3.8 Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants