Comment

Comment by bluelightning2k

You wrap it but there must be some kind of call you're making to your API. So are you saying that call fires immediately, races the main wrapped execution, and is therefore done when the execution is finished, therefore neglible latency except for cold starts on extremely short functions?

How does the probe function technically. Inspector API I believe is unavailable on CloudFlare etc.

I once wrote something like this which could work on serverless platforms without the Inspector API. It used Typescript AST transforms to insert no-op listeners at every line, so they would dynamically eval or dump breakpoint style if a listenToLine parameter equalled their line, otherwise no-op. So trivial but not technically zero runtime cost.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton