Enhanced debug header details

Here’s an example of an enhanced debug request header:

curl http://www.example.com -H 'Pragma: akamai-x-ew-debug' -H 'Akamai-EW-Trace: exp=1600166650~acl=/*~hmac=db4018160fab828da87d3fd8685bfbb9e0f1020885a9cce9403bcf3f5182477d' -k -sD - -o /dev/null

This example shows the trace response headers with successful execution of all event handlers:

HTTP/1.1 302 Moved Temporarily
Location: /us/en/
Content-Type: text/html
Content-Length: 0
Date: Tue, 10 Sep 2019 02:31:17 GMT
Connection: keep-alive
X-Akamai-EdgeWorker-onClientResponse-Info: ew=9 v7.0:EW for example.com; status=Success; status_msg=-; res_tier=200; init_wall_time=0; wall_time=0; init_cpu_time=0; cpu_time=0; memory_usage=672;
X-Akamai-EdgeWorker-onClientRequest-Info: ew=9 v7.0: EW for example.com; status=Success; status_msg=-; res_tier=200; init_wall_time=9.99; wall_time=6.349; init_cpu_time=6.19; cpu_time=6.349;memory_usage=14572;
X-Akamai-EdgeWorker-onOriginResponse-Info: ew=9 v7.0:EW for example.com; status=Success; status_msg=-; res_tier=200; init_wall_time=0; wall_time=0; init_cpu_time=0; cpu_time=0; memory_usage=472;
X-Akamai-EdgeWorker-onOriginRequest-Info: ew=9 v7.0: EW for example.com; status=Success; status_msg=-; res_tier=200; init_wall_time=0; wall_time=0; init_cpu_time=0; cpu_time=0; memory_usage=372;

X-Powered-By: Akamai EdgeWorkers

Here's a curl request that passes the Pragma akamai-x-ew-onclientrequest request header:

curl "http://www.example.com" -H "Pragma: akamai-x-ew-onclientrequest" -H 'Akamai-EW-Trace: exp=1600166650~acl=/*~hmac=db4018160fab828da87d3fd8685bfbb9e0f1020885a9cce9403bcf3f5182477d' -k -sD - -o /dev/null

This example shows the trace response header with an execution error:

HTTP/1.1 500 Internal Server Error
Server: AkamaiGHost
Mime-Version: 1.0
Content-Type: text/html
Content-Length: 174
Expires: Thu, 12 Sep 2019 15:11:24 GMT
Date: Thu, 12 Sep 2019 15:11:24 GMT
Connection: close
X-Akamai-EdgeWorker-onClientRequest-Info: ew=9 v7.0:EW for example.com; status=ExecutionError; status_msg=main.js:runtime_error:5:2,main.js:red_team:16:3,main.js:onClientRequest:39:3+ReferenceError:+calling_undefined_fn+is+not+defined; res_tier=200; init_wall_time=0; wall_time=0; init_cpu_time=0; cpu_time=0; memory_usage=21560

Enhanced debug headers include a status message and the amount of wall time, CPU time, and memory consumed by the event handler.

Response Header fields Details Description
EdgeWorker details

ew=<id> <version>:<name>

<id>EdgeWorker ID
<version>EdgeWorker version number
<name>EdgeWorker name
Status type

status=<status type>

<status type>Possible values include:
  • Success - the EdgeWorker successfully executed.

  • GenericError - a compile error, such as a syntax error occurred.

  • ExecutionError - an execution error, such as a JavaScript exception or error occurred.

  • RuntimeError - an error occurred at runtime/environment preventing the EdgeWorker from executing.

  • UnknownEdgeWorker - the EdgeWorker ID cannot be loaded because it doesn't exist.

  • UnimplementedHandler - the requested event handler wasn't implemented by the EdgeWorker.

  • TimeoutError - the execution time surpassed an upper limit restriction.

  • WallTimeoutError - the wall time consumed by the event handler exceeded the limit during the JavaScript execution.

  • InitWallTimeoutError - the wall time consumed by the event handler exceeded the limit during the JavaScript initialization.

  • CpuTimeoutError - the amount of CPU time consumed by the event handler exceeded the limit during the JavaScript execution.

  • InitCpuTimeoutError - the amount of CPU time consumed by the event handler exceeded the limit during the JavaScript initialization.

  • ResourceLimit - the upper bound of a resource limit was reached.

Status Message

status_msg=(<function-name>:<line-number>:<column>) + <error-description>

<function-name>Optional URL encoded function name where the error occurred.
<line-number>Optional line number where the error occurred.
<column>Column number where the error occurred.
<error-description>Error message for the exception.
Resource tier

res_tier=<res_tier>

<res_tier>The resource tier selected for the EdgeWorker ID, either 200 for Dynamic Compute or 100 for Basic compute.
Initialization Wall Time

init_wall_time=<init_wall_time>

<init_wall_time>The total amount of time consumed by the event handler in milliseconds for the initialization of the event.
Wall Time

wall_time=<wall_time>

<wall_time>The total amount of time consumed by the event handler in milliseconds.
Initialization CPU Time

init_cpu_time=<init_cpu_time>

<init_cpu_time>The amount of CPU time consumed by the event handler in milliseconds for the initialization of the event.
CPU Time

cpu_time=<cpu_time>

<cpu_time>The amount of CPU time consumed by the event handler in milliseconds.
Memory Usage

memory_usage=<memory_usage>

<memory_usage> The amount of memory consumed by the event handler in bytes.

ūüďė

The trace response header format may change in the future to include new fields.


Did this page help you?