We at Dynatrace love DevOps. We are fervent advocates of the unbreakable DevOps pipeline and like to think of performance engineering as a DevOps team sport. To help our LoadRunner users take a step further in this direction, we’re releasing LoadRunner request tagging for Dynatrace.
Load Testing with Dynatrace
While executing a load test from your load testing tool of choice (LoadRunner, JMeter, Neotys, etc) each simulated HTTP request can be tagged with additional HTTP Headers that contain test-transaction context information (for example, script name, test step name, and virtual user ID). Dynatrace analyzes the incoming HTTP headers and extracts the relevant information in the form of request attributes.
While it isn’t mandatory, having specific request attributes while running your load tests gives you more advanced filtering & charting options. Check out Dynatrace Help to learn more about Dynatrace load testing integration.
To help our LoadRunner users with the tagging of their requests, we’ve released the LoadRunner Request Tagging tool. This tool enables you to patch your existing LoadRunner Virtual User Generator (VuGen) scripts by adding the
x-dynatrace-test HTTP header and automatically populating it with your request attributes. Let see how this works.
LoadRunner request tagging
The LoadRunner Request Tagging tool works by inserting a short method (
addDynatraceHeaderTest) into the
globals.js file that populates the
x-dynatrace-test header. It also parses your
.js files and automatically adds a call to this method before the key methods are called. As you can see, both C and JavaScipt scripting languages are supported.
- Record a LoadRunner Virtual User Generator (VUGEN) script and adapt it as needed
- Download the latest version of the LoadRunner Request Tagging tool from GitHub.
- Open your command prompt and patch your LoadRunner script. The LoadRunner Request Tagging tool uses the following syntax (more details can be found in Dynatrace Help):
java -jar Dt-LoadRunner-request-tagging.jar <mode> <path parameter> <optional parameters>
java -jar Dt-LoadRunner-request-tagging.jar insert -path C:\LoadRunnerScripts\EasyTravelBookingProcess
After running the tool, you can verify that the method
addDynatraceHeaderTest has been added to your scripts before some of the key methods:
Configure request attributes
The HTTP header
x-dynatrace-test is populated by the LoadRunner Request Tagging tool with the key/value pairs listed below. These values can be captured by Dynatrace by defining request attributes. Not all key/value pairs need to be configured; only configure the pair you’re interested in for the targeted analysis of your load tests.
|TSN||Test Step Name – Logical test step within your load test script.||The name of the transaction defined in the LoadRunner script. In case of nested transactions, the transaction names are concatenated.|
|LSN||Load Script Name – Name of the load test script.||Either the name of the
|LTN||Load Test Name – Unique test execution identifier.||Value of the DynatraceLTN runtime attribute configured in LoadRunner|
|VU||Virtual User – ID of the unique user who sent the request.||Example: 1, 2, 3, …|
|PC||Page Context – Provides information about the document that is loaded in the currently processed page.||Contains the value of the first parameter passed to the following functions:
|SI||Source ID – Identifies the product that triggered the request.||
Here is an example of how to configure the request attribute for the test step name (
- In Dynatrace, configure the extraction rules for the custom HTTP Headers via Settings > Server-side service monitoring > Request attributes.
- Select HTTP request header as the request attribute source and enter the name of your custom HTTP header in the Parameter name field. Extraction of the test step name
x-dynatrace-testcan be configured as seen below.
Execute tests and analyze data
Run your load test from LoadRunner. The requests and PurePaths will be tagged in Dynatrace with the configured request attributes for targeted diagnostics and analysis. Request attributes will appear on the relevant Service overview page, under the Top request section.
There are different ways to analyze the data. Your approach should be based on the type of performance analysis that you want to do (for example, crashes, resource and performance hotspots, or scalability issues). The request attributes set for the load test will help you filter the data. Following is an example of how to analyze the response time of the test step search journey paris:
Tell us what you think about the LoadRunner Request Tagging tool and load testing integration with Dynatrace. We’d love to hear about your pre-production use cases. Please share your feedback with us at Dynatrace Answers.