Standard debug headers
EdgeWorkers supports request-level debugging via the Pragma request header.
If a request passes a Pragma request header containing EdgeWorkers specific values, the related trace response headers are returned. These response headers contain information about the EdgeWorker executed during the request or response.
Tip: See Enable enhanced debug
headers for instructions on how to return more detailed response headers that
include a status message and the amount of initialization wall time, wall time,
initialization CPU time, CPU time, and memory usage consumed by the event handler. Enhanced
debug headers can also provide information about HTTP sub-requests.
The Pragma value can be one or more of the following:
Akamai Pragma Header | Returns debug information from |
---|---|
akamai-x-ew-debug | the onClientRequest, onClientResponse, onOriginRequest, and onOriginResponse event handlers |
akamai-x-ew-debug-rp | the ResponseProvider event handler Note: See Enable
and view JavaScript logging for repsonseProvider for more
information. |
akamai-x-ew-debug-subs | all event handlers when an HTTP sub-request is made |
akamai-x-ew-onclientrequest | only the onClientRequest event handler |
akamai-x-ew-onoriginrequest | only the onOriginRequest event handler |
akamai-x-ew-onoriginresponse | only the onOriginResponse event handler |
akamai-x-ew-onclientresponse | only the onClientResponse event handler |
Here's a curl request that passes the Pragma akamai-x-ew-debug request header:
curl "http://www.example.com" -H "Pragma: akamai-x-ew-debug" -sD -
This example shows the trace response headers with successful execution of all event
handlers:HTTP/1.1 200 Content-Type: text/html Content-Length: 1024 Date: Tue, 17 Sep 2020 02:31:17 GMT Connection: keep-alive X-Akamai-EdgeWorker-onClientResponse-Info: ew=9 v7.0:EW for example.com; status=Success X-Akamai-EdgeWorker-onClientRequest-Info: ew=9 v7.0: EW for example.com; status=Success X-Akamai-EdgeWorker-onOriginResponse-Info: ew=9 v7.0:EW for example.com; status=Success X-Akamai-EdgeWorker-onOriginRequest-Info: ew=9 v7.0: EW for example.com; status=Success X-Akamai-EdgeWorker-ResponseProvider-Info: ew=9 v7.0: EW for example.com; status=Success X-Powered-By: Akamai EdgeWorkers
Here's a curl request that passes the Pragma akamai-x-ew-onclientrequest response
header:
curl "http://www.example.com" -H "Pragma: akamai-x-ew-onclientrequest" -sD -
This example shows the trace response header with an error
response:
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=Failed AK_EIP_FORWARDER_IP:
The Standard debug header currently contains EdgeWorker details and the status
type.
Note: The trace response header format
may change in the future to include new fields.
Response Header fields | Details | Description |
---|---|---|
EdgeWorker details ew=<id> v<version>:<name> | <id> | EdgeWorker ID |
<version> | EdgeWorker version number | |
<name> | EdgeWorker name | |
Status type status=<status type> | <status type> | Possible values include:
|