Example Dynatrace Header

Document created by Dave Murphy Employee on Jul 19, 2017Last modified by Dave Murphy Employee on Jul 19, 2017
Version 2Show Document
  • View in full screen mode

Below you will find an example dynatrace header that can be placed in each request. The example provides the location name, server name, a page name/transaction name via ISSEs and the unique number via JS.

 

dynaTrace: VU=1234;PC=Chicago - Savvis;ID=99999;NA=Keyword Search

 

· ID is a unique identifier for each request (this has to be a unique number.  Timestamp works best but it could also be a complex serial number.) 

 

· PC is used to identify the test location (PC is actually Page Context.  Typically, the page name, frame name, doc id, etc.) 

 

· We can use VU to identify the test machine (VU should be the virtual user id.  Ideally, you want this to be as specific as possible because it'll help in grouping/parsing your data.  Test machine might be too high up in some cases.)

 

· NA is the transaction name

 

EXAMPLE:
dynaTrace: VU={%% expr: $context.serverName %%};PC={%% expr: $context.locationName %%} - SOASTA;ID={%% prop : clip : userNum %%};NA={%% expr: $context.currentPage.name %%}

Another Unique Number option via an ISSE:
{%%Sys-Prop:Composition:StartTimeMillis%%}-{%%Sys-Prop:Track:VUNumber%%}-{%% expr: $context.currentTrackIndex %%}

JavaScript File for Unique Number:

var startTimeMilis = new Date().getTime();
var uniqueNumber = new String(startTimeMilis);
$context.result.postMessage($context.result.LEVEL_INFO, "uniqueNumber = "+uniqueNumber);

/**
* Generates a random integer (whole number) contained within the
* two extremes (inclusive on lower extreme, exclusive on upper).
*
* Example usage:
* var num = generateRandomNumber(0,5);
* This will generate a random number, either 0, 1, 2, 3 or 4
*
* var num = generateRandomNumber(5,8);
* This will generate a random number either 5, 6 or 7
*/
function generateRandomNumber(lowerExtreme, upperExtreme) {
return Math.floor((Math.random() * (upperExtreme - lowerExtreme)) + lowerExtreme);
}

// End Function

$prop.set("MessageClip", "userNum", uniqueNumber)

Outcomes