Enhanced debug header details for subWorkers

To receive enhanced debugging information about EdgeWorkers executions on subWorker sub-requests:

  • Pass the akamai-x-ew-subworkers pragma header.
  • Include the other pragma headers required for Enhanced debug headers.
  • The debugging headers and pragmas are automatically forwarded on any sub-requests made by the EdgeWorker.
  • The debug response headers are collected and returned on the response.

When you specify akamai-x-ew-subworkers, the following set of pragmas and headers are automatically forwarded on sub-requests.

Forwarded request pragmas Response headers
*akamai-x-ew-subworkers
akamai-x-ew-debug
akamai-x-ew-onclientrequest
akamai-x-ew-onclientresponse
akamai-x-ew-onoriginrequest
akamai-x-ew-onoriginresponse
akamai-x-ew-debug-subs
akamai-x-ew-debug-rp
Debug response headers include the request ID.
The request ID identifies the headers associated with specific sub-requests.

x-akamai-edgeworker-onclientrequest-info
x-akamai-edgeworker-onclientresponse-info
x-akamai-edgeworker-onoriginrequest-info
x-akamai-edgeworker-onoriginresponse-info
x-akamai-edgeworker-onclientrequest-log
x-akamai-edgeworker-onclientresponse-log
x-akamai-edgeworker-onoriginrequest-log
x-akamai-edgeworker-onoriginrequest-log
x-akamai-edgeworker-subrequests

*The akamai-x-ew-subworkers pragma response includes the Akamai-EW-Trace and the Akamai-X-EW-Subworkers-Log forward request headers.

Here’s an example of an enhanced debug request header that specifies the akamai-x-ew-subworkers pragma header.

curl -i '<http://example.com'> -H 'Pragma: akamai-x-ew-subworkers,akamai-x-ew-debug,akamai-x-ew-debug-subs,akamai-x-get-request-id' -H 'Akamai-EW-Trace: eyJh...t0ZXrg'

This response shows that the main request returned three debug headers annotated with request ID 10f5e61. It indicates that the onClientRequest event ran successfully for EdgeWorker ID 1147649205. The onClientResponse event was not implemented.

HTTP/1.1 200 OK  
Content-Type: text/html  
Content-Length: 18  
Expires: Wed, 24 Jan 2024 20:32:30 GMT  
Cache-Control: max-age=0, no-cache, no-store  
Pragma: no-cache  
Date: Wed, 24 Jan 2024 20:32:30 GMT  
Connection: keep-alive  
X-Akamai-EdgeWorker-onClientResponse-Info-10f5e61: ew=1147649205 v:swparent; status=UnimplementedEventHandler  
X-Akamai-Edgeworker-Subrequests-10f5e61: ew=1147649205; evt=CReq; id=1; method=GET; url="<http://example.com/?x=sw_root_to_sw_child">; rsp=200; dur=4; req_id=10f5d16  
X-Akamai-EdgeWorker-onClientRequest-Info-10f5e61: ew=1147649205 vc14e39809f55f159475c12f9b06ba671_2:swparent; status=Success; status_msg=-; res_tier=200; init_wall_time=0; wall_time=5.453; init_cpu_time=0; cpu_time=0.316; memory_usage=1364  
x-akamai-edgeworker-onclientresponse-info-10f5d16.10f5e61: ew=258567741 v:swchild; status=UnimplementedEventHandler  
x-akamai-edgeworker-onclientrequest-info-10f5d16.10f5e61: ew=258567741 v2:swchild; status=Success; status_msg=-; res_tier=200; init_wall_time=0; wall_time=0.187; init_cpu_time=0; cpu_time=0.085; memory_usage=372  
X-Akamai-Request-ID: 10f5e61

Note that the Subrequests header shows a sub-request from the onClientRequest event.

It has a request ID of 10f5d16 and returned a 200 response. The sub-request also returned two debug headers annotated with request ID 10f5d16. The onClientRequest event ran successfully for EdgeWorker ID 258567741 and the onClientResponse event was not implemented.

X-Akamai-Edgeworker-Subrequests-10f5e61: ew=1147649205; evt=CReq; id=1; method=GET; url="<http://example.com/?x=sw_root_to_sw_child">; rsp=200; dur=4; req_id=10f5d16

Response header fields for subWorkers

In addition to the HTTP sub-request header fields the req-id field is also included when you add the akamai-x-ew-subworkers pragma header to a request.

Response header fieldDetailsDescription
subWorker request ID
req_id=<req_id>
<req_id>Identifier for the request that issued the subWorker.