Auto Create a Custom Property for Akamai Headers

Document created by Chris Sommerstad Employee on Jul 22, 2017
Version 1Show Document
  • View in full screen mode

The values of Akamai debug HTTP headers can be extracted, placed into a custom property, and then tracked in analytics using the following steps. This example defines a property set as part of a target after first adding the HTTP request headers to that target(s) in a target that is used in that test. 
Note:  As a general rule, it is quicker to add request headers in the Target Editor for the widest use case, as they will then apply to all messages that use the target; however, these steps can also be performed on one or more individual messages in the Message Editor instead. These headers should be added to every pertinent target in the test.

  1. Add the relevant header request to every HTTP operation that goes to Akamai. For example, get (as shown below).

Additional relevant Akamai Pragma cache headers include:

          Pragma: akamai-x-get-cache-key
          Pragma: akamai-x-cache-remote-on
          Pragma: akamai-x-get-true-cache-key

  1. Save the target after making this change.

The example above causes each message response to contain an X-Cache header with one of a number of possible values which, when placed into a CloudTest widget (as a custom property’s value) are easy to analyze. Two of the two most common X-cache response values are TCP_HIT and TCP_MISS.

The raw X-Cache header value will indicate a hit or miss for a given object (among a number of other possible responses). Additional X-Cache responses include: TCP_REFRESH_HIT, TCP_REFRESH_MISS, TCP_REFRESH_FAIL_HIT, TCP_IMS_HIT, TCP_NEGATIVE_HIT, TCP_MEM_HIT, TCP_DENIED, and TCP_COOKIE_DENY.

By defining a property set to extract the X-Cache header value, place it into a custom property, and save that value to analytics, CloudTest can easily chart the X_Cache values for a given test. 
X-Cache: TCP_MISS from a90-84-54-46 (AkamaiGHost/6.6.2-8814863) (-)

A TCP_HIT means that the object was fresh in cache and/or an object from disk cache. A TCP_MISS means that the object was not in cache, and that the server fetched the object from its origin.

  1. To add a property set, select the Property Sets node and click the Plus icon to add a new Property Sets form to the message.
  2. Change “The value of this field” from the default Field to Header.
  3. Since we only want that portion of the X-Cache header prior to “from” enter a space and then “from” in the Trailing Text field. Note that the space is included so that there won’t be a trailing space on every extracted value.

  1. In the "Will be stored in this property" section of the form, ensure that Type is set to Custom.
  2. Change Starting Element to "CurrentMessage".
  3. Enter a property path as a name for the custom property. This name will appear as a node in Property Value widgets with the response values shown.

  1. In the Automatic Creation drop-down, select Create and save value in Analytics.
  2. Click Save on the toolbar after making these changes.