In this article we will learn how to integrate Jmeter with Dynatrace. First of all, let’s talk about what Dynatrace is, briefly. Then, we will take a look at the Dynatrace Integration with JMeter.

What is Dynatrace?

Dynatrace is an APM solution that monitors Web, Mobile and Cloud-Based applications, infrastructure, network and critical processes, and also provides performance management of all technology layers used, from the selection of users on the website to the application code running on the main system, with real user monitoring.

Why Should We Use Dynatrace?

While load testing tools provides a wealth of information at the network level, sometimes it is desirable to analyze what is going on at the application level. With load testing tools such as JMeter, we can have superficial information about the services, but we cannot observe the behavior of SQL queries under the services. For this reason, we cannot see in detail why the services are not working properly. Thanks to APM tools such as Dynatrace, we can observe the behavior of the queries under the services in detail and see in which situations the bottleneck occurs. This is exactly what is made possible by APM tools such as Dynatrace when integrated with JMeter, which is the most popular load testing tool for analyzing and measuring the performance of a variety of services.

Custom Header Parameters

According to the Dynatrace document, there are 6 parameters we need to use to filter our requests. For this, we have to add those parameters to our requests’ header. We can use HTTP Header Manager for this. Let’s take a look at the values which are all configured under a header called X-Dynatrace-Test.

VUVirtual User ID of the unique user who sent the request.
SISource ID identifies the product that triggered the request (JMeter, LoadRunner, Neotys, or other).
TSNTest Step Name is a logical test step within your load testing script.
LSNLoad Script Name – name of the load testing script. This groups a set of test steps that make up a multistep transaction.
LTNThe Load Test Name uniquely identifies a test execution.
PCPage Context provides information about the document that is loaded in the currently processed page.

Creating a Script with Header Parameters

With the following code, we can add all headers to our requests instead of the adding one by one.

dynatrace 1

As you can see, headers added automatically after I run the test.

Dynatrace 3

After logging in to your Dynatrace account, you must first deploy Dynatrace where you want to monitor the traffic in order to track your traffic. Then, we go to the Services page under Applications & Microservices from the menu on the left of the homepage.

On this page, there are services whose traffic I can monitor. When I run the script I prepared with JMeter and select the Requests executed in the background threads of ApacheJMeter.jar from the screen, I can see the general information about the relevant service. To monitor the traffic, we click on the View Requests option on the page that opens.

Don’t forget to set the time interval in the top right to the interval we want to observe the traffic. I set it to 5 minutes because I want to observe the traffic in the last 5 minutes.

Dynatrace 4

The bars in the graph show the requests we made, and the line shows the response times of our requests. In the contributors field, we can see our services in the script we run.

As you can see, we were able to observe the load within 5 minutes from the time we ran the script.

Dynatrace 5

To monitor service-based traffic, we can choose the service we want from the services under contributors.

Dynatrace 6

If we want to have some more information about service, we should click on the three dots on the left and select what we need. Let’s say we want to compare today’s data with yesterday’s data. For this we should click to Comparison on the opening screen.

Dynatrace 7
Dynatrace 8

In this screen, we can see the information of the two selected data. such as response times of the selected service, errors received by the service, CPU usage and load on the server.

Keep following and reading Loadium blog posts, to stay up-to-date and to learn technical details about load testing…