Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLoad rule files from directory or glob. #741
Comments
beorn7
added
the
feature-request
label
May 27, 2015
beorn7
assigned
fabxc
May 27, 2015
This comment has been minimized.
This comment has been minimized.
|
BTW: I prefer the |
This comment has been minimized.
This comment has been minimized.
|
Me too – it's also more consistent with the |
This comment has been minimized.
This comment has been minimized.
|
You actually mean the opposite. ;) |
This comment has been minimized.
This comment has been minimized.
|
See my comment in the PR. Glob is simply used to expand the files in the directory (plus allowing prefixes and suffixes on file level). Globing directories is not possible through the config. |
This comment has been minimized.
This comment has been minimized.
|
Yes. But my idea was, like in the textfile exporter, to not allow globs at all, but only either a complete file name or a directory. In the former case, everything stays as it is (so no breaking change). In the latter case, only files with a hardcoded suffix (e.g. I like my idea best (hear hear...), but I prefer consistency within the same binary. So we should go with exactly the same approach as the file-based SD. |
This comment has been minimized.
This comment has been minimized.
|
I think the current solution is closer to your idea than to full-fledged globing – at least I hope so :) We could of course enforce |
This comment has been minimized.
This comment has been minimized.
But perhaps globbing is not desirable per se. Also, we don't need to enforce But as said, unless we now want to change file-based SD, too, we should just stay with the approach you have chosen. |
This comment has been minimized.
This comment has been minimized.
|
FWIW, taking everything from a directory is not incompatible with atomic renames either – as long as it's on the same filesystem, whether the |
This comment has been minimized.
This comment has been minimized.
|
Yes, if you have a set of fixed file extensions that are considered only, On Thu, May 28, 2015 at 12:56 PM Matthias Rampke notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
On Thu, May 28, 2015 at 12:56 PM, Matthias Rampke
Sure. Technically, it's not a problem, but we are expecting human Björn Rabenstein, Engineer SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany |
This comment has been minimized.
This comment has been minimized.
|
Renaming being atomic is not a general assumption we can make anyway, On Thu, May 28, 2015 at 1:17 PM Björn Rabenstein notifications@github.com
|
fabxc
closed this
Jun 1, 2015
This comment has been minimized.
This comment has been minimized.
davidkarlsen
commented
Oct 7, 2016
|
The issue is closed - but was this ever implemented? |
This comment has been minimized.
This comment has been minimized.
|
Yes, it's globbing. Line 389 in 42c05dd We should document the behavior. |
This comment has been minimized.
This comment has been minimized.
simonpasquier
pushed a commit
to simonpasquier/prometheus
that referenced
this issue
Oct 12, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
beorn7 commentedMay 27, 2015
In the config, rules files have to be specified explicitly at the moment. It should be possible to either specify a glob or a directory. Upon startup and upon a SIGHUP, all files matching the specified glob or all files matching
*.rulesin the specified directory, respectively, will be loaded.Note that the latter corresponds to the way the textfile module of the node exporter works.
Both ways allows applying atomic renaming to avoid parsing of incomplete files (i.e. we do not want an implementation that simply loads all files in a specified directory).