---
title: Dynatrace Integration With JMeter
description: Loadium blog
image: https://cdn-images-1.medium.com/max/800/1*ZQADkjNjsk1wZh433LtqEQ.jpeg
---

[Skip to content](https://explore.loadium.com/loadium-blog/dynatrace-integration-with-jmeter#main-content)

 Sep 8, 2025 11:18:34 AM

# Dynatrace Integration With JMeter

![Picture of Erdem KIRMIZI](https://explore.loadium.com/hs-fs/hubfs/bio.jpg?width=50&name=bio.jpg) [Erdem KIRMIZI](https://explore.loadium.com/loadium-blog/authors/erdem-kirmizi)

Share: [facebook-f icon](http://www.facebook.com/share.php?u=https://explore.loadium.com/loadium-blog/dynatrace-integration-with-jmeter) [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://explore.loadium.com/loadium-blog/dynatrace-integration-with-jmeter) [Twitter icon](https://twitter.com/intent/tweet?url=https://explore.loadium.com/loadium-blog/dynatrace-integration-with-jmeter) [pinterest-p icon](http://pinterest.com/pin/create/link/?url=https://explore.loadium.com/loadium-blog/dynatrace-integration-with-jmeter) [envelope icon](mailto:?body=https://explore.loadium.com/loadium-blog/dynatrace-integration-with-jmeter)

![](https://cdn-images-1.medium.com/max/800/1*ZQADkjNjsk1wZh433LtqEQ.jpeg)

In this article we will learn how to integrate JMeter with Dynatrace.

#### **What is Dynatrace**

![](https://cdn-images-1.medium.com/max/800/0*DPjnceszo0nFluqQ.jpg)

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 provide sufficient information at the network level, sometimes it is desirable to analyze what is happening at the application level. With load testing tools such as JMeter, we can have general 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 [dynatarece document](https://docs.dynatrace.com/docs/platform-modules/automations/cloud-automation/test-automation), there are 6 parameters we need to use to filter our requests. For this, we have to add those parameters to our requests’ custom-header. We can use HTTP Header Manager for this. Let’s take a look at the values which are all configured under a custom-header called X*-Dynatrace-Test*.

![](https://cdn-images-1.medium.com/max/800/1*-Y9xW2mN-XiWw48hkDjp_Q.png)

#### **Creating a Script with Header Parameters**

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

```
import org.apache.JMeter.protocol.http.control.Header;def vu = ctx.getThreadGroup().getName() + "-" + ctx.getThreadNum();def si = "JMeter" + org.apache.JMeter.util.JMeterUtils.getJMeterVersion();def tsn = sampler.getName()def ltndef lsntry { lsn = (args.length > 0) ? args[0] : "No name for Test Plan" //To Configure Test Plan name, add ${__TestPlanName} in Parameters as first argument ltn = vars.get("LoadTestName") ?: "No name for Load Test" //To Configure Load Test Name, add a variable `LoadTestName` and the value in Test Plan or User Defined Variables dtcustom-headers = "SI="+ si + ";LSN="+ lsn + ";TSN=" + tsn + ";LTN=" + ltn + ";VU=" + vu + ";"; sampler.custom-headerManager.removeHeaderNamed('X-Dynatrace-Test') sampler.custom-headerManager.add(new Header('X-Dynatrace-Test', dtcustom-headers))}catch(Exception e) { log.info("Caught " + e) //Catching the exception}
```

![](https://cdn-images-1.medium.com/max/800/1*M3OHNz6StCbnAE3z9cxDGA.png)

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

![](https://cdn-images-1.medium.com/max/800/1*EqZle9A-H8mSx7BiET-mPg.png)

Before we can perform the operations in this article, we need to install the Dynatrace Agent in our system. You can use the [link](https://docs.dynatrace.com/docs/setup-and-configuration) for this.

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.

![](https://cdn-images-1.medium.com/max/800/1*dACn5IGg-eAZLz8BOZNdBA.png)

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.

![](https://cdn-images-1.medium.com/max/800/1*vMoZ3QzCdY5Ez0x5ZRtXAA.png)

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.

![](https://cdn-images-1.medium.com/max/800/1*WW2Hk6BsuO9Wh9p-qrF3mg.png)

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

![](https://cdn-images-1.medium.com/max/800/1*54VFk5vqM65VP8o6z3oqEQ.png)

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 datas with yesterday’s datas. For this we should click to Comparison on the opening screen.

![](https://cdn-images-1.medium.com/max/800/1*wgaIevm7Fma-rKdvUKDHfQ.png)

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.

![](https://cdn-images-1.medium.com/max/800/1*w26S5TZgWYJSR0RL4Uq_RA.png)

![](https://cdn-images-1.medium.com/max/800/1*sh7dTKyGc1xCeUFrQm_WfA.png)

Thank you for reading this article. To stay updated with our latest posts, follow our [blog](https://loadium.com/blog) and visit our [social media accounts](https://www.linkedin.com/company/loadium/).

 

[JMeter](https://explore.loadium.com/blog/tag/jmeter) , [Test Integrations](https://explore.loadium.com/blog/tag/test-integrations)

## Related posts

[![](https://cdn-images-1.medium.com/max/800/1*9R94RWdfrp3r3Elrlt4ibA.jpeg)](https://explore.loadium.com/loadium-blog/how-to-send-jmeter-post-requests)

[JMeter](https://explore.loadium.com/loadium-blog/tag/jmeter)

## [How To Send JMeter POST Requests](https://explore.loadium.com/loadium-blog/how-to-send-jmeter-post-requests)

![Picture of Erdem KIRMIZI](https://explore.loadium.com/hs-fs/hubfs/bio.jpg?width=50&name=bio.jpg) [Erdem KIRMIZI](https://explore.loadium.com/loadium-blog/authors/erdem-kirmizi) 

 Sep 8, 2025 10:43:15 AM

How To Send JMeter POST Requests In many cases, even an ordinary load test contains lots of...

[Read more](https://explore.loadium.com/loadium-blog/how-to-send-jmeter-post-requests)

[![](https://cdn-images-1.medium.com/max/800/1*QJDmW8UJBXQyGNUyQtLjfA.png)](https://explore.loadium.com/loadium-blog/how-to-add-a-variable-number-of-parameters-in-apache-jmeter)

[JMeter](https://explore.loadium.com/loadium-blog/tag/jmeter), [Best Practices](https://explore.loadium.com/loadium-blog/tag/best-practices), [Examples](https://explore.loadium.com/loadium-blog/tag/examples)

## [How to Add a Variable Number of Parameters in Apache JMeter](https://explore.loadium.com/loadium-blog/how-to-add-a-variable-number-of-parameters-in-apache-jmeter)

![Picture of Erdem KIRMIZI](https://explore.loadium.com/hs-fs/hubfs/bio.jpg?width=50&name=bio.jpg) [Erdem KIRMIZI](https://explore.loadium.com/loadium-blog/authors/erdem-kirmizi) 

 Sep 8, 2025 10:56:40 AM

Some requests have more than one parameter, and the number of parameters may change. You can also...

[Read more](https://explore.loadium.com/loadium-blog/how-to-add-a-variable-number-of-parameters-in-apache-jmeter)

[![](https://cdn-images-1.medium.com/max/800/1*3iHTnUzWn8yJfNIMr7tq9Q.jpeg)](https://explore.loadium.com/loadium-blog/loadium-record-play)

[Tools](https://explore.loadium.com/loadium-blog/tag/tools), [Best Practices](https://explore.loadium.com/loadium-blog/tag/best-practices), [Loadium Product](https://explore.loadium.com/loadium-blog/tag/loadium-product)

## [Loadium Record & Play](https://explore.loadium.com/loadium-blog/loadium-record-play)

![Picture of Erdem KIRMIZI](https://explore.loadium.com/hs-fs/hubfs/bio.jpg?width=50&name=bio.jpg) [Erdem KIRMIZI](https://explore.loadium.com/loadium-blog/authors/erdem-kirmizi) 

 Sep 8, 2025 10:57:32 AM

Loadium Record&Play is a feature developed by our team to ease and quicken your load test...

[Read more](https://explore.loadium.com/loadium-blog/loadium-record-play)

---

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Erdem KIRMIZI",
    "url" : "https://explore.loadium.com/loadium-blog/author/erdem-kirmizi"
  },
  "dateModified" : "2025-09-17T12:02:36.792Z",
  "datePublished" : "2025-09-08T08:18:34.000Z",
  "headline" : "Dynatrace Integration With JMeter",
  "image" : [ "https://cdn-images-1.medium.com/max/800/1*ZQADkjNjsk1wZh433LtqEQ.jpeg" ],
  "mainEntityOfPage" : {
    "@id" : "https://explore.loadium.com/loadium-blog/dynatrace-integration-with-jmeter",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://explore.loadium.com/hubfs/Logo-1.png"
    },
    "name" : "Loadium"
  }
}
```