#Possible to Access Worker Invocation/Request ID inside Worker?

7 messages · Page 1 of 1 (latest)

shell blaze
#

I have a worker that sits in front of some API endpoints to handle some business logic. The worker eventually forwards a JSON payload to the API endpoint via a queue.

TL;DR;
I want to append the invocation/request ID I see in the worker logs so I can better debug between CF and my API backend. Is this Request ID/Invocation ID accessible inside a worker? Thx in advance for the help.

lethal olive
#

Should be a header on the request named “cf-ray”

shell blaze
#

I was thinking it might be yeah. Though the docs describe that ray header as a different formatted string but it may be delimited with some other values for the colo it went through

lethal olive
shell blaze
#

thanks, ill give it a shot and see if it works