Dynatrace and LoadRunner integration

The LoadRunner Request Tagging tool for Dynatrace is a command line tool that automatically adds the relevant HTTP headers to requests generated by LoadRunner's Virtual User Generator (Web - HTTP/HTML project types). See Dynatrace and load testing tools integration for more details on load testing integration with Dynatrace.

Load Runner integration

The LoadRunner Request Tagging tool inserts a short method addDynatraceHeaderTest in your globals.h or globals.js file that populates the x-dynatrace-test header. It also parses your .c or .js files and automatically adds a call to this method before one of the key LoadRunner methods is called. Both C and JavaScript scripting languages are supported.

The addDynatraceHeaderTest method is called before the following methods: web_url, web_link, web_image, web_submit_form, web_submit_data, web_custom_request, web_browser, web_button, web_check_box, web_edit_field, web_elementweb_file, web_image_link, web_image_submit, web_list, web_map_area, web_radio_group, web_reg_dialog, web_static_image, web_table, web_text_area and web_text_link.

Modify LoadRunner scripts for Dynatrace

  1. Record a LoadRunner Virtual User Generator (VUGEN) script and adapt it as needed. Refer to LoadRunner documentation for details.

  2. Download the latest release of the LoadRunner Request Tagging tool for Dynatrace

  3. Patch or unpatch the LoadRunner scripts.

The LoadRunner Request Tagging tool uses the following syntax:

java -jar Dt-LoadRunner-request-tagging.jar <mode> <path parameter> <optional parameters>

mode

  • insert: Adds the Dynatrace HTTP header to the selected LoadRunner scripts.
  • delete: Removes all modifications made previously by the LoadRunner Request Tagging tool.

path parameter

Pick either -path or -body and -header

  • -path <filepath>: Use for scanning all directories and subdirectories for script files and inserting/deleting scripts into them.
  • -body <files> -header <files>: Use to specify if header or body files should be processed. The file separator between files is &.

optional parameters

  • -LSN <value>: Sets the load script name to a value passed after -LSN. If skipped, the script name will be taken from the *.usr file
  • -c: Sets C as the scripting language (the default)
  • -js: Sets JavaScript as the scripting language
  • -help: Prints usage.

Insert the HTTP headers in the C script directory

java -jar Dt-LoadRunner-request-tagging.jar insert -path C:\LoadRunnerScripts\EasyTravelBookingProcess

Remove the HTTP headers from the C script directory

java -jar Dt-LoadRunner-request-tagging.jar delete -path C:\LoadRunnerScripts\EasyTravelBookingProcess

Insert HTTP headers using file names, using & as a file separator

java -jar Dt-LoadRunner-request-tagging.jar insert -header C:\LoadRunnerScripts\EasyTravelBookingProcess\globals.h
-body C:\LoadRunnerScripts\EasyTravelBookingProcess\action.c&C:\LoadRunnerScripts\EasyTravelBookingProcess\action2.c&C:\LoadRunnerScripts\EasyTravelBookingProcess\action3.c

Insert HTTP headers with script name

java -jar Dt-LoadRunner-request-tagging.jar insert -LSN "EasyTravelBookingProcessVersion2" -path C:\LoadRunnerScripts\EasyTravelBookingProcess

Insert HTTP headers in a JavaScript directory**

java -jar Dt-LoadRunner-request-tagging.jar insert -js -path C:\LoadRunnerScripts\EasyTravelBookingProcess
  1. Verify that the method addDynatraceHeaderTest has been added to your script

LoadRunner integration

Configure request attributes

The header x-dynatrace-test is populated by the LoadRunner Request Tagging tool with the key/value pair 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 one you're interested in for targeted analysis of your load tests.

Key
Description
Value
TSN
Test Step Name is a logical test step within your load testing 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 testing script.
Either the name of the *.usr file or the value of the optional parameter -LSN
LTN
The Load Test Name uniquely identifies a test execution.
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 following functions: web_url, web_link, web_image, web_submit_form, web_submit_data, web_custom_request.
SI
Source ID identifies the product that triggered the request.
LoadRunner (fixed value)

Here is an example of how to configure the request attribute for the test step name (TSN):

  1. In Dynatrace, configure the extraction rules for the custom HTTP Headers via Settings > Server-side service monitoring > Request attributes.

  2. 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 TSN from the x-dynatrace-test can be configured as seen below.

Request attributes

  1. Run your load test from LoadRunner. The requests and distributed traces will be tagged in Dynatrace with the configured request attributes for targeted diagnostics and analysis.

LoadRunner

There are different ways to analyze the data. Your approach should be based on the type of performance analysis 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. In this example, they are used to analyze the response time of the test step search journey paris:

LoadRunner

Further reading