For the Plivo tech team, DevOps is not just a more efficient way of building products, it’s a way of life. To make things more efficient, we’re always trying out new things to see what works and what doesn’t. Release process is one area where we see a lot of scope for innovation. Today we’re sharing one best practice that’s working well for us.
At Plivo, we use Jenkins as our CI/CD tool. Specifically, we use Jenkins Pipeline DSL to write build jobs as code. Using CI/CD, we deploy code several times a day across many microservices. To ensure that our services are performing optimally within the defined system parameters, we monitor a variety of metrics across releases immediately after the deployment, and annotate Grafana panels via Jenkins Pipeline.
Our CI/CD pipeline has multiple stages:
During the Deploy stage, we annotate Grafana panels via their annotate REST API using the POST /api/annotations API.
We use the Grafana API credentials (GRAFANA_APIKEY) from the Jenkins credentials store. The payload to the /api/annotations API is sent as a JSON object, as shown in this Grafana docs example.
Once the annotations are sent to Grafana, we add them to the Grafana panels manually. We will use the optional dashboardId and panelId fields in the future to build dashboards on the fly with Grafana 5.0, removing the need to manually add annotations.
The code above produces Grafana annotation like this.
This Grafana panel for an imaginary service has an annotation between 12:16 and 12:22, which is the duration of the deployment, and it contains a description and tags. The description includes the version and the person responsible for the deployment as well as the approver for the release. The description and the tags are defined using variables earlier in our pipeline code.
Get Volume Pricing
Thousands of businesses in more than 220 countries trust Plivo’s cloud communications platform