Modern IT infrastructure requires a comprehensive approach to application performance monitoring and testing. More and more companies all over the globe use a combination of Application Performance Management (APM) and Performance Testing to implement successful DevOps processes and support the overall health of their IT environment.

While APM platforms like NewRelic and Dynatrace are often used to track and analyze key performance metrics of application servers, databases, and other components of IT infrastructure, load testing tools like LoadView are an excellent solution as part of pre- and post-production performance testing. Integration of load testing into a web development lifecycle gives DevOps teams comprehensive insights into changes in web service and application performance under significant user load as well as helps to spot bottlenecks in supporting infrastructure. In this article, we will guide you through Dynatrace and LoadView integration to demonstrate the major steps of APM and load testing tool integration setup.

Dynatrace and Loadview Integration Overview

The major principles of APM platform integration with load testing tools are described in the Dynatrace and load testing tools integration article on the Dynatrace official website. In a nutshell, while running a load test, a load testing tool generates thousands of HTTP requests to a target website or web application. You can mark your test requests with specific HTTP attributes and filter out the load test traffic by these attributes in Dynatrace.

We can break the process of LoadView & Dynatrace integration into the following steps:

  1. Configuring extraction rules for the custom HTTP headers in Dynatrace.
  2. Creating a web application load test script with LoadView.
  3. Tagging load test requests with additional HTTP headers to filter monitoring data by defined tags in Dynatrace.
  4. Running the load test in LoadView.
  5. Applying the filter and getting the relevant requests in Dynatrace for further drill-down analysis.

Step-by-step Loadview & Dynatrace Integration Guide

Let’s start with configuring extraction rules for the custom HTTP Headers.

In Dynatrace, go to Settings > Server-side service monitoring > Request attributes and set the extraction rule for a new request attribute “loadtest” and header parameter “x-dynatrace” as described on the Dynatrace official website.

Alternatively, to custom HTTP headers, you can filter your monitoring data by the User-Agent headers.

By default, all web application and website load tests that are executed in real browsers by LoadView contain the DMBrowser suffix in the UserAgent request header:

GET /?gws_rd=ssl HTTP/1.1
Host: www.google.com
Connection: keep-alive
...

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36DMBrowser/2.1 (UV)

Thus, you can use the DMBrowser attribute in a Dynatrace extraction rule to filter out requests from LoadView.

In the next stage, we need to create a load test with tagged test requests. Let’s create a basic web application load testing script in LoadView. To record the script, we use a desktop version of EveryStep Scripting Tool by Dotcom-Monitor. EveryStep Scripting Tool Desktop supports manual inline script editing as well as adding custom C# code and other advanced functionality. Learn how to record a script from our video tutorial EveryStep Scripting Tool Desktop Video Tutorial.

Once the script is recorded, let’s add a custom header to the script. To tag LoadView requests with a custom header, we add the following code section after tab0 variable line:

Tabs.SetRequestHeader(“x-dynatrace”,”loadtest”);

Now we are all set to continue with the load test scenario as described in How to Setup LoadView for Load and Stress Testing and can run the test in LoadView. LoadView requests will be tagged in Dynatrace with the specified request attribute for further analysis.