Software systems are all about changes, which can be internal or external. Having observability around the changes and their impact on the systems makes it much easier for teams to understand what caused the incident or degradation and take action in real time without wasting precious time.
All changes are caused by events; these can be deployment events, scale-up events, traffic patterns shifting from BAU, or even configuration changes affecting the state of the system. What if our monitoring system can track these events and then keep that context while monitoring the systems? That context will help us understand why something happened faster than finding a needle in a haystack.
Typically, you will emit golden signals or RED metrics from applications to monitor and track their performance with a monitoring system.
In this blog post, I will show you a scenario of how Levitate - our managed time series warehouse- empowers you to do more and observe change events. We will track canary releases via ArgoCD rollouts with Levitate.
Levitate enables correlating events from various sources such as CI/CD, orchestrator, and external systems with other applications and infra metrics to provide contextual alerts and understand system behavior.
Setup
In this setup, I am using a typical canary rollout using Argo Rollouts via Helm charts, where the canary gets deployed progressively to more percentages of users like 20%, 40%, 60%, and so on. Anytime the performance of the canary degrades, I want to roll it back without affecting more users. Each rollout goes via two stages as follows. We start and stop the rollout before going to the next stage.
After rolling out the canary at each stage, we wait for a specified time to receive the requests from actual users and then analyze whether the step was successful. Typically, we want to ensure the users do not face any errors with the canary.
We already have RED metrics emitted from the application that goes to Levitate. These metrics tell us how the application performs at any rollout stage and during BAU.
Levitate provides an API to consume "Change Events" over HTTP. This endpoint allows pushing the events to Levitate.
Levitate converts them into metrics and retains specific metadata sent with the API call. The converted metrics can then be combined with other application metrics using PromQL to build dashboards and alerts.
Each event has two states - start and stop. So we can mark an event as started and stopped.
We can push these events to Levitate as the canary rollout is happening via plain old curl commands.
This can be extended to all rollouts of the canary, where we can track different error percentages for each rollout.
Connecting the dots
ArgoCD rollout has an analysis step after each rollout to determine whether the canary was a success. It can evaluate the canary depending on metrics present in a time series database. We leverage the contextual PromQLs prepared above to calculate whether the canary is successful.
That's all that is needed to track the status of the canary deployment. This setup is fully automated, and we don't need to do anything manually; we get the performance metrics of each rollout in Levitate for further analysis.
Here is a quick video showing the power of Levitate in tracking "Change Events" to measure the performance of the canary releases.
💡
Change Events are powerful. They can be CI/CD and configuration-related events with real-time metrics from application and infrastructure components. These metrics can then be used to make better decisions about software systems.