donal
2018-04-23 fd42cfea4b38efc3dfda824033d13f31f97167b6
commit | author | age
bfabf3 1 # Return of the Application Monitoring
5a16fd 2
bfabf3 3 > In this exercise we will create a build monitor to radiate vital build information and statistics
5a16fd 4 _____
D 5
6 ## Learning Outcomes
7 As a learner you will be able to
bfabf3 8 - Create dashboards in Jenkins to display build status
D 9
5a16fd 10
D 11 ## Tools and Frameworks
12 > Name of tool - short description and link to docs or website
13
bfabf3 14 1. [Build Monitor plugin](https://wiki.jenkins.io/display/JENKINS/Build+Monitor+Plugin) - Build Monitor Plugin provides a highly visible view of the status of selected Jenkins jobs. It easily accommodates different computer screen sizes and is ideal as an Extreme Feedback Device to be displayed on a screen on your office wall. (Inspired by the no longer maintained RadiatorView plugin).
D 15 1. [Build Fail Analyser](https://wiki.jenkins.io/display/JENKINS/Build+Failure+Analyzer) - This plugin analyzes the causes of failed builds and presents the causes on the build page. It does this by using a knowledge base of build failure causes that is built up from scratch. Saving statistics about failure causes is also possible.
6bd3ef 16 1. [Pipeline Aggregator View](https://wiki.jenkins.io/display/JENKINS/Pipeline+Aggregator+View) - Allows the users to view the history of their pipelines with stage information (failed/In Progress/Passed) and the changes monitored)
5a16fd 17
D 18 ## Big Picture
19 This exercise begins cluster containing blah blah
20
21 _____
22
23 ## 10,000 Ft View
bfabf3 24 > The goal of this exercise is to introduce Build Monitors to radiate teams progress on Dashboards.
5a16fd 25
bfabf3 26 2. Create a new Dashboard for our Builds using the plugin above. Use Regex to add jobs to it. Use the BuildFail Analyser to add meaningful data to the reason for failures.
5a16fd 27
bfabf3 28 2. Use the pipeline views in OpenShift and Jenkins to produce dashboards that teams can use. 
5a16fd 29
D 30 ## Step by Step Instructions
31 > This is a fairly structured guide with references to exact filenames and sections of text to be added. Include pictures and code snippets where appropriate. Rule of thumb is learners are dumb.... so over describe _why_ we're doing things
32
bfabf3 33 ### Part 1 - Create a build monitor
6bd3ef 34 > _In this exercise we will create a new build monitor to show key information about our builds_
5a16fd 35
6bd3ef 36 2. On Jenkins home page; create a new view by hitting the plus icon on the home screen (should be beside the `all` above the jobs list)
bfabf3 37
6bd3ef 38 2. Give the job a sensible name such as `todolist-monitor` and select `Build Monitor View` 
D 39 ![new-monitor](../images/exercise6/new-monitor.png)
bfabf3 40
6bd3ef 41 2. On the configuration page; select `Recurse in subfolders`
D 42 ![config-recursive](../images/exercise6/config-recursive.png)
43
44 2. Check the box to use Regular Expression and set the value to be something that should scrape our apps such as `.*todolist.*` 
45 ![config-regex](../images/exercise6/config-regex.png)
46
fd42cf 47 2. Finally; select `Display committers` and set the Failure Analyser to `Description`. This allows us to write regex for when fails occur in Jenkins and have the reasons plotted on the graph. For example; number of test scores or common compilation errors. 
6bd3ef 48 ![config-commiters](../images/exercise6/config-commiters.png)
D 49
50 2. Save your configuration to see your Build Monitor! 
51 ![](../images/exercise6/.png)
52
fd42cf 53 2. Let's create another view for Jenkins using the `Pipeline Aggregator View` plugin. This view is great because it shows lots of valuable information in a clean; easy to visualise way. Create a new view called `todolist-pipelines` and select `Pipeline Aggregator View`
D 54 ![config-pipeline-view](../images/exercise6/config-pipeline-view.png)
55
56 2. On the configure page; set the regex to `todolist.*`
57 ![config-pipeline-regex](../images/exercise6/config-pipeline-regex.png)
58
59 2. Set the view to `Only display last build` for simplicity of the view.
60 ![config-pipeline-ui-settings](../images/exercise6/config-pipeline-ui-settings.png)
61
62 2. Save your configuration to see your Build Monitor! 
63 ![pipeline-monitor](../images/exercise6/pipeline-monitor.png)
6bd3ef 64
D 65 ### Part 2 - Seed Jenkins Dashboards
66 > _TODO - Add instructions for creating dashboards as part of s2i in Jenkins setup using DSL_
67
68 2. Open the s2i in `enablement-ci-cd` .....
5a16fd 69
D 70 _____
71
72 ## Extension Tasks
73 > _Ideas for go-getters. Advanced topic for doers to get on with if they finish early. These will usually not have a solution and are provided for additional scope._
74
bfabf3 75 Additional Alerting
D 76  - Add `Slack` integration to the Pipeline by setting up a WebHook to call the slack endpoint with Build Stats
77  - Add `Twillio` text integration to send you text messages when the build fails.
78 Additional Monitoring
79  - Explore the Application's FEK stack inside OpenShift
5a16fd 80
D 81 ## Additional Reading
82 > List of links or other reading that might be of use / reference for the exercise
83
84 ## Slide links
85 > link back to the deck for the supporting material