Blog

Tricentis NeoLoad and Dynatrace Cloud Automation integrate to provide deep application performance insight

Performance testing

Learn more about continuous performance testing and how to deliver performance at scale.

Author:

Bryan Cole

Director of Customer Engineering

Date: Feb. 10, 2022

The cloud is complex, dynamic, and hyper fast. Unfortunately, cloud environments are also growing in complexity so quickly that they’re exceeding the capacity of the human brain to manage.

New microservices-based applications that self-heal when components fail and that provision additional copies of themselves in response to increased demand are driving this complexity. We can no longer manage or monitor these dynamic environments in real-time using traditional monitoring techniques.

What does it even mean from a quality assurance perspective when an application microservice fails, but the application infrastructure automatically remediated the failure? The business process was still successful, so was this even a failure? These and similar questions are driving a new generation of AI-powered deterministic engines to monitor and triage these complex environments.

Keptn is an open-source enterprise-grade control plane for cloud-native continuous delivery. That’s a complex way of saying that it manages the automation of deployments and tests and can extend your deployment visibility by enforcing quality gates and tying into monitoring platforms. As subsequent versions of an application are ready for deployment, Keptn provides a historical context of how the application changes, and ties that to the monitoring data.
This is extremely useful to teams when looking at the historical context of the data they have. If you examine only metrics from the servers like memory and CPU, you might see a sharp increase at a moment in time. When you link that data to the different versions being deployed within the cloud automation platform, you gain insight into the operational context of the applications and how they’re going to run in your infrastructure.

Why is Tricentis talking about this?

The simple truth is that prior to release into production environments, the ability to understand the performance characteristics of an application are sharply limited, because there are no production users. Using NeoLoad by Tricentis, we can simulate hundreds, thousands, or even millions of production users in the context of a performance test.

By leveraging the existing and seamless integration between the Dynatrace monitoring solutions and NeoLoad, we are now an active participant in the Cloud Automation story, allowing new builds to be automatically performance tested to simulate production-level traffic, and expose any weaknesses that may exist prior to release into a production environment. NeoLoad and Dynatrace have a long history of collaboration and integration, and your performance test data can be viewed in both NeoLoad reports as well as within the Dynatrace platform. This ensures that the stakeholders interested in reviewing the data can do so in their solution of choice.

Setup and configuration of a simple Cloud Automation instance

First, you’ll need to sign up for a free trial of Cloud Automation from Dynatrace. This will provide the dashboard and reporting views of your project and allow you to see how a sequence stage can automatically trigger a performance test.

Once inside your trial, you’ll be able to setup and configure new projects. First, however, you’ll need to get Keptn setup and configured!

Keptn is built into the Dynatrace Cloud Automation platform — no setup or installation required!
However, to interact with the Keptn backbone, you will need to set up and configure the Keptn Command Line Interface (CLI). The Keptn CLI is available from the Keptn website with the following command:

curl -sL https://get.keptn.sh | KEPTN_VERSION=0.10.0 sudo -E bash

If you are not running Keptn within your own Kubernetes environment, you will probably want to suppress Keptn CLI messages related to kubectl configuration. Basically, you don’t want to hear a lot of Keptn noise about your Kubernetes instance if you don’t have one! Do that with this command:

keptn set config KubeContextCheck false

Now run the version command to make sure everything is installed properly:

keptn version

Now that the CLI is installed, you need to link it to your Dynatrace Cloud Automation instance. To do this, log into your environment, and click on your profile picture. Select the copy to clipboard button for the keptn auth command:
This links your Keptn CLI to your Cloud Automation instance, allowing you to trigger sequences and events via command line. You will want to link your project to a GitHub repository you create for this purpose. Your Cloud Automation project files will be available there for viewing and editing, which is required if you want to alter how the project behaves. To do this, you need to make a blank GitHub project (entirely blank – not even a readme.md file!) and setup an access token. If you need help with this, you can find details on the keptn website.
Finally, you will need a project to work with in Cloud Automation. To do this, simply create a new Cloud Automation project by using the button. It will prompt you for a shipyard yaml file, which contains the specification of the sequences and gates you wish to have within your Cloud Automation project. The YAML file I used is copied below, or you can link to mine in GitHub here.

Your keptn environment and Cloud Automation configuration are all setup and ready to go!

Testing in Tricentis NeoLoad

NeoLoad is a world-class load and performance testing solution. Using a code-less test design to rapidly allow users to create performance tests, while also supporting tests-as-code for integration into pipelines for CI/CD solutions, NeoLoad provides a comprehensive ability to execute load and performance tests against your system.

To trigger a performance test within your Cloud Automation project, you will need to invoke NeoLoad. You can start a free trial of NeoLoad here, and be up and running within five minutes.

Once you have a NeoLoad SaaS environment, you can create a simple test by downloading the Controller component here.

The Controller lets you create new user paths and execute them by leveraging NeoLoad SaaS. To do this you will need an access token from NeoLoad SaaS. You’ll find this when you click on the Profile link at the bottom of the screen. Generate a new token and copy the value to the clipboard.

Then, in the NeoLoad Controller, select Edit –> Preferences, and in the access token edit field, paste the token value you created, and click test. If you have a proxy server to allow internet access, make sure you include those details as well!
If you want to leverage NeoLoad SaaS, you’ll need to get your hands on an already installed Controller and Load Generator – which you have, because you downloaded the Controller and installed it. To set these up, please follow the steps outlined in our documentation here:

If you’re new to performance testing, in the NeoLoad Controller simply open the Sample Project that ships with the product. Then select File –> Export Project to NeoLoad Web… to upload it into your SaaS account.

If you’ve setup your infrastructure and exported your project, you’ll next need your test ID and tenant ID from NeoLoad Web.
Your Test ID can be found by clicking on the test name you provided in the Export Project Wizard.

Your workspace ID can be found by clicking on the settings link in the bottom corner of the screen.
Now that you have a test, you need to configure Keptn to call NeoLoad’s API and trigger the test. To do this, first you need to select your project in the Cloud Automation environment, and then click on Uniform Page –> Secrets and click the Add Secret button. This adds the NeoLoad access credentials into Cloud Automation.
Create a new secret called neoload-webhook, with a scope of kepn-webhook-service, and a key-value pair entry with a key of accountToken and a value of your access token value from NeoLoad Web.

Almost done! To tell Cloud Automation that it needs to trigger a performance test when a keptn event arrives, we need to create a subscription to a webhook. Click on the Uniform link in Cloud Automation for your project, then click webhook-service. This will show the Add Subscription button at the bottom of the screen. Make sure you replace the WorkspaceID and the Test ID in the NeoLoad URL to the values from your NeoLoad instance!
In the Create subscription form section, fill out the following fields:

Task: Performance-test
Task suffix: triggered
In the Webhook configuration form section fill out the following:
Request Method: POST
URL: https://neoload-api.saas.neotys.com/v3/workspaces/<Your WorkspaceID>/tests/<Your TestID>/start?testResultName=Demo-test-result&testResultDescription=stage-{{.data.stage}}
Add a header:
name: accountToken
value: {{.secret.neoload-webhook.accountToken}}

Now Cloud Automation will listen for a keptn event (specifically, a sh.kepn.event.Performance-test.triggered event), and when it arrives will call the NeoLoad API to invoke a performance test. Since Cloud Automation can be tied into the full stack of Dynatrace monitoring along with NeoLoad, the triggered event, all collected data, and the performance metrics will be available to you in every solution in this chain – Dynatrace, Cloud Automation, and NeoLoad itself.
Finally – the last step! Trigger a keptn event to start a performance test. To do this, head back to your CLI and run the following command:

keptn send event -f mysequence-triggered.template

The template file outlines the scope of the event being triggered, and is included below. Make sure you change the project entry <yourprojectname> to the value you created within Cloud Automation!

You should see your keptn event arrive within Cloud Automation, and since you instructed Cloud Automation to execute a performance test when this type of event arrives, you should see a triggered performance test start in NeoLoad Web.

Isn’t this just a CI system? Can’t I do this in Jenkins?

The short answer is yes, you could. Like any software solution, both Jenkins and other CI systems have some overlap with what Cloud Automation is doing here. You’d just need to code in support for automatic deployments, triggered monitoring, and the dozens of other tasks that Cloud Automation is doing in the background to manage the deployment and release trains as they move into different environments.

Possible doesn’t always mean best! If you can use a solution fit for purpose that doesn’t require you to write dozens, hundreds, or even thousands of lines of code, that also offers more functionality and capability, we encourage you to take advantage of it!

We hope that you found this interesting and useful, and encourage you to reach out to both your Dynatrace and Tricentis contacts to continue to learn more about our strong partnership. NeoLoad performance test results can be viewed directly in the Dynatrace platform itself, and Dynatrace data can be viewed within the NeoLoad analysis reporting. The goal is to ensure rapid and highly performant code being delivered to production, and our joint partnership allows you to view performance data and metrics in your platform of choice.

Performance testing

Learn more about continuous performance testing and how to deliver performance at scale.

Author:

Bryan Cole

Director of Customer Engineering

Date: Feb. 10, 2022

Related resources