-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Feature: Add Puppet Classes view #799
Feature: Add Puppet Classes view #799
Conversation
The Class view is disabled by default.
- Install library for memcached backend to store cached objects. - Use `--preload` flag to tell Gunicorn to load the app before forking the worker processes It creates the scheduler instance in order to trigger scheduled jobs at startup.
…rvalsi It pre-compute the results to display in the classes view/ The result contains the events associated with the last reports and is stored in the cache.
…rce events by status
It displays a table with the list of nodes having at least one event on a resource declared in a given class. For each node, it also displays the status of the node as well as the status of the class (aka the status of the resources that are declared in this class).
…o display in the Class view
Classes view displays a list of classes that had at least one event on a declared resource. For each class, we have the number of nodes having executed this class (with at least one change on a resource declared in the class), the number of events by status ('failure', 'success', 'noop').
- Added screenshots - Defined new App settings
- Flask-APScheduler is used to create scheduled jobs, triggered at regular intervals in order to pre-computed data for the Classes view - Flask-Caching is used to store some results into a cache
This view displays the classes having had at least one event on one of their declared resources. We have to parse the last report of each node to group the events by class. For each class, we display the number of nodes having executed this class as well as the number of events by status ('failure', 'success' and 'noop'). When we click on a class we display the class view which allows to list the nodes having executed this class (with at least one status change of a resource of this class).
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #799 +/- ##
==========================================
- Coverage 85.55% 77.27% -8.29%
==========================================
Files 19 20 +1
Lines 1087 1307 +220
==========================================
+ Hits 930 1010 +80
- Misses 157 297 +140
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Hi @lcharreau! Thank you for your contribution. I think that it’s ok to merge it if the added feature is behind a feature flag and if it requires Memcache config to start the app only if this feature flag is enabled. Does it work this way? |
Hello @gdubicki, thank you for your support. The default cache backend is "SimpleCache" (in memory), which is acceptable when you have only one worker. As I explained in my previous post, you can also add a scheduled task to pre-compute the results at regular intervals ( To have the complete detail of the variables related to this functionality, you can refer to the variables defined in the |
Released in v4.3.0 a moment ago. 😊 |
Hello,
Recently, in order to better monitor our Puppet nodes, we needed to add a Class view in Puppetboard.
This view lists the Puppet classes that have had at least one of their resources changed (event). It consists of extracting the resource events from the last report of each node and grouping these events by class.
For each class, we display the number of nodes having executed a resource declared in this class, as well as the number of events by status ('failure', 'success' and 'noop').
The main drawback of this view (which is disabled by default) is that it is potentially resource-consuming since it requires parsing the last report of each node and classifying the events by class.
This heavy processing pushed us to add a cache system to store the results but also a scheduler to pre-compute these results so that they are available more quickly to the user.
If you have more than one worker, it is recommended to use a shared backend like Memcached (that's what we do).
To display the class view, we retrieve the pre-computed result (by a scheduled job triggered at regular intervals, every 5mn in our case) from the cache and we parse only the new reports (i.e. those generated after the caching and which are therefore not present in the cache). We take advantage of this to update the cache. For information, we automatically run Puppet agent every 4 hours.
When we click on a class, we display the view by class. This view allows listing all the nodes whose last report has executed (event) at least one resource declared in the class. The status of the node is also displayed as well as the status of the class (which corresponds to a global status of the resource events).
I submit this new feature without knowing if it can interest the Puppet community.
Screenshot (Classes view)
Screenshot (Class view)
docker-compose configuration used to test this new view: