Setting up one click build, deployment, monitoring, alerting and visualization for your team !!

Transforming the way people build, test & deliver software

Setting up one click build, deployment, monitoring, alerting and visualization for your team !!

A few days back in one of my #post, I mentioned that we are currently moving in an era which demands the need of having a one click solution for setting up deployment, monitoring, alerting as well as visualisation for any of the applications that we develop & deliver.

Very recently, I was having a conversation with one of the lead technical architects in our company and he mentioned that with each passing day & with each newly added micro-service to the pool of every growing micro-services stack, the expectations from an application developer is increasing at an alarming scale. The developer today not only has to ensure that the application artefacts are environment agnostic to support continuous deployments but also they have to ensure that the right set of monitoring & alerting rules as per their application needs are being created, shared and managed so that we have continuous monitoring & alerting capabilities in place for ensuring high business availability.

Even as an application developer to understand and define the right set of rules, it requires them to be able to play around & spend sometime on the company selected technologies in those respective areas. A lot of time is then spent by each of these developers in provisioning an environment with all these components and then making sure that each of these components are connected to each other the way they are expected to be.

And this doesn’t end here, once all of these are marked ready for QA, the same challenges stand for the QA teams today, who are not only supposed to verify the functionality but also to ensure that correctness of the defined monitoring, alerting rules and visualisation dashboards.

Any company that today invests into a ‘Center of Excellence’ team for DevOps & Automation. One of the primary goal of the COE team is to ensure that the productivity across all teams within the organisation never drops below a certain level. This can only be ensured by finding out such areas like the one described in the above section and investing into tools, technologies & initiatives to automate them.

In this single article, I wont be able to touch upon all the internal details of each tool that I used to setup the one click solution. But this would definitely give anyone the idea about a set of tools that can facilitate such solutions.

Below is the list of technologies that were used together to develop the one_click solution,

 - MicroService developed in SpringBoot 2.0
 - Micrometer prometheus dependency for SpringBoot 2.0
 - Docker for containerising
 - Ansible for managing deployments & configuration
 - Prometheus for monitoring
 - Grafana for visualisation
 - Grafana Prometheus for alerting
 - Slack for receving alert notification

Finally to put this all together, you can choose to have either a simple shell script that you store locally in your repository for execution or you can have a JenkinsFile to tie all of this us together. Below mentioned is the stepwise execution plan,

Step 1: Create your application binary

mvn clean package

Step 2: Containerise your application binary using docker

docker build -t <image_name>:<image_tag> -f <dockerfile_location>

Step 3: Tag & Push the generated image from Step2 into a docker registry

docker tag <image_name>:<tag_name> <docker_registry>:<regisry_port>/<image_name>:<image_tag>

docker push <docker_registry>:<regisry_port>/<image_name>:<image_tag>

Step 4: Invoke ansible-playbook to deploy the service

ansible-playbook -i <inventory_file> <deploy_service_playbook> -e '<extra_params>'

Step 5: Invoke ansible-playbook to deploy prometheus, configure default rule and add the above deployed service as a monitoring target

ansible-playbook -i <inventory_file> <deploy_prometheus_playbook> -e '<extra_params>'

Step 6: Invoke ansible-playbook to deploy Grafana, configure Default DataSource pointing to the prometheus server from Step5, configure Default Dashboard to visualise and Default Alert Notification channel as Slack

ansible-playbook -i <inventory_file> <deploy_grafana_playbook> -e '<extra_params>'

Post the execution of the above steps, you should be able to get the complete stack with all the above tools up & running on any host system/platform

application running locally on port 8080
prometheus server running locally and monitoring the local application
local grafana server with default monitoring dashboard for local service
alert manager notification on slack

I hope that the above steps can help you understand and setup the one click solution for your teams and reduce the time which they spend in facilitating such environments.

This definitely isn’t the end of the technology advancement in this field but is definitely a time where each one of us should invest into highly flexible & extensible frameworks in the areas of Automation & DevOps to cater for the future !!

Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *