1st attempt at making a low-frequency prometheus endpoint #6
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.
Since, in prometheus, it's very tedious to ignore metrics when scraping, and since I usually have metrics that I would like to sample at high frequency, such as boat position and boat attitude -- whilst other data I'd prefer at lower frequency, such as saloon temperature and humidity -- then I've made some changes to the code such that you can specify a list of regular expressions and any SignalK metric that matches any of these will not published on the /prometheus endpoint, but rather a new /prometheus/lf endpoint.
Then, in prometheus, I can specify two scrape configs, one being high frequency and the other being low frequency.
This might not be the right place to solve this, but it was easy for me to do. This might not be the best solution, some might need more separations; but at least this can be a start :-)