Uptrends and your CI/CD processes

If you’ve been following along, the last two articles explained the CI/CD (Continuous Integration/Continuous Delivery) processes. In this article, we look at how Uptrends fits into those processes. Uptrends can fit into your CI/CD process in several different ways. For example, you may want to use Uptrends for the testing and monitoring portions, include your monitor updates as part of your automation processes, or both.

A short review of the CI/CD processes

CI/CD processes are systematic approaches to the writing and publishing of software in short cycles or sprints. The processes get functionality to the user quickly using a pipeline like structure. At the center of the processes, you find automation. Automation takes care of building, testing, monitoring, and publishing the software. Automation frees up time spent on routine tasks allowing teams to focus on other tasks.

The CI/CD process is a continuous loop of planning, coding, releasing, deploying, operating, monitoring, and providing feedback that helps guide the planning phase. See the diagram below.

The CI/CD process loop

Uptrends and the CI/CD process

The CI/CD process relies heavily on automation for deploying, testing, and monitoring. Using the Uptrends API, you can include your monitoring in your automated processes. By using the Uptrends API, you can

  • Modify monitor settings
  • Retrieve monitor statuses
  • Toggle alerting and active status
  • Upload transaction scripts
  • Retrieve transaction scripts
  • Update your Git repository (or other versioning systems) with your transaction scripts

Uptrends behind your firewall

Your dev environment is probably behind your firewall and not accessible to Uptrends; however, you can still include Uptrends in your development processes. By adding a Private Checkpoint to your network, Uptrends can safely and actively monitor and test your secured environments, such as your development, staging, or testing environments. You can still automate your script and monitor updates from these environments without a Private Checkpoint, but you need a Private Checkpoint to test changes to your code in secured environments.

CI/CD automation with Uptrends

As you adjust your web application’s or API’s code, you may need to update your Uptrends monitors at the same time. Otherwise, having to adjust your monitoring manually may lead to gaps in your monitoring or generate unwanted errors. By automating your monitor updates, you’ll know right away if new functionality continues to work after the deployment.

You may automate monitoring changes for various reasons, such as updating alerting conditions and content checks, or you may just need to disable monitors and alerts during the deploy stages. The most frequently implemented automation is the updating of transaction scripts.

Automating your script updates

Uptrends’ checkpoints use your transaction scripts to step through your user click paths to verify content and functionality. When your web application changes, you may need to update your transaction scripts. Ideally, you want to update your scripts at the same time as your site update, so incorporating the changes into your CI/CD process makes sense.

1. Store your transaction scripts in your version control application.

You need to make sure that you store your JSON transaction scripts in your version control application. Saving your scripts alongside with your code in a versioning repository, such as Git, enables you to have reproducible builds and keeps everything in your CI/CD process synchronized. You can copy your script from your monitor settings or use a GET command to retrieve them using Uptrends API.

2. Make your application and monitoring script changes.

When you modify your web application, your transaction script needs updating at the same time. Make your code changes and update the script file. Your change to your code and the transaction script will trigger a build cycle when you updated the files in the version control system.

3. Add the script updates to your build process.

Once you have the new transaction script checked into the code repository, you need to make sure that the monitor update is also part of your build process. How you do this depends on your build tool, but the steps described below apply to any build tool. To update the script, you make API calls from your deployment scripts, but before you make that first API call, you need to make sure you’ve set up an API account with Uptrends API. We have instructions in our Knowledge Base.

  1. Update the monitor with the new transaction JSON script. Capture the current time for comparison in the next step.
  2. Check the monitor status. You need to wait for Uptrends to make a check using the new transaction script. Either add a timeout or sleep in the build step. You can use a loop with a delay to continuously check for a recent test. In the loop, make a call to the MonitorCheck API and compare the time of the last check with the time captured the first step.
  3. If the check completed successfully, your code and script updates succeeded. If the check errored, you might want to cancel the deploy, find the problem, and try again.

The above is a high-level overview of the integration of a Web Application Monitoring script into your CI/CD processes. Of course, you can automate other monitoring tasks such as managing alerting during the deploy processes using a similar structure.

We have resources to get your questions answered.

Every CI/CD process is different, and you may have specific questions about fitting Uptrends into your CI/CD process. We have some resources for you, and we will add detailed examples to our Knowledge Base soon.

Uptrends API

Our API is on its 4th version and rapidly growing. You can find detailed information about accessing and using API V4 in our Knowledge Base, and we also have a Swagger environment for you to use as well.

More on Private Checkpoints

You can use Private Checkpoints for more than monitoring your CI/CD processes. Besides letting Uptrends verify the availability, performance, and functionality of your non-Internet facing assets, Private Checkpoints can make sure your internal web-based infrastructure is available and working.

Private Checkpoints can also monitor connectivity between data centers and verify that external SaaS applications and APIs remain accessible from behind your firewall. Keeping an eye on the performance and availability of these tools can protect productivity for the entire company.

The really wonderful thing is that the Private Checkpoint is yours. Each Private Checkpoint is actually four checkpoints (actual or virtual servers) that reside in your data center or across multiple data centers. Uptrends maintains the software, and you maintain the hardware. Contact support if you would like detailed information about system requirements and options for getting your own checkpoint.

Ask Uptrends Support

Our knowledgeable support team has experience helping companies incorporate Uptrends into their CI/CD systems. They can help you find a solution that works for you. Open a support ticket and start a conversation today to get you on your way.