Cloudflare can now profile live Workers and Durable Objects, in production, down to the exact function burning CPU or memory.
The company added on-demand CPU and memory profiling, accessible from the Workers dashboard or the CLI. Pick a worker version, set a capture duration, and Cloudflare returns an interactive flamegraph where each box is a function call and its width shows CPU time or memory used. You can click into specific functions or switch to a table view, and the raw profile is downloadable for tools like pprof. Unlike the existing Chrome DevTools option, this captures workers while they handle real production traffic, not synthetic local requests.
That production angle is the hard part. Workers are deliberately spread across many data centers and physical servers to stay close to users, and Durable Objects can migrate between locations. Before Cloudflare could profile anything, it had to solve a routing problem: locate the right worker version, in the right data center, on the isolate that is actually live. That is a different engineering challenge than bolting a profiler onto a single long-running server, which is presumably why this took until now.
The examples Cloudflare published are the most interesting part. Profiling the R2 binding worker found a JSON-replacer function recursively re-walking nodes it had already processed, burning over 5% of CPU for nothing, plus a duplicated metrics call costing another 1%. An internal worker kept hitting its 128MB memory ceiling because old Prometheus instrumentation was only partially disabled. None of that shows up in logs or aggregate metrics. It shows up once you can actually see which function is doing the work - which is the entire argument for shipping this tool in the first place.