reports: Update to use report_prefix #73
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit removes the report_filename config parameter and adds a report_prefix parameter. AFAICT the current code suggests that it will write all host data to the same file. However the code writes the old data to the prom file giving all values -1 which is incorrect
I looked at why this was and i can't find much information on the original issue[1] and PR[2]. further to this the current implementation is very racy if one sets REPORT_FILENAME
This also updates the clean stale function to only act on files with the report_prefix and avoid deleting files which may have been placed there by none puppetserver process
more then happy to split this up into separate patches but wanted to get a bit more feedback on why things got set to -1 and if im missing something
[1]#5 [2]#7