how to get the worker duration in a tail worker

would it be possible to have TailItems include the start/end timestamp for the worker? (or did i miss a field?)
4 Replies
DaniFoldi
DaniFoldi•4mo ago
There's an eventTimestamp (in millis, https://workers-types.pages.dev/#TraceItem) that can get you halfway there, I believe it marks the start of the event, so if you add a console.log just before sending your response (waitUntil not included) you should be able to get a wall-time estimate
luna
luna•4mo ago
so there's no way to get that without adding something to the app worker? 🤔 would be nice if this was added to the event.
DaniFoldi
DaniFoldi•4mo ago
I believe that it's part of the spectre mitigations to not tell you exactly how long a request took :/
luna
luna•4mo ago
ugh. that makes sense but also sucks.
Want results from more Discord servers?
Add your server
More Posts