Cloudflare adds CPU and heap profiling for Worker Previews
Brief
Worker Previews and their Durable Objects can now be profiled before changes are merged, with production left untouched.
Profile Preview deployments
- Capture a CPU or heap profile from a Preview deployment and inspect it as a flamegraph or table, or download the raw pprof file.
- Use the Cloudflare CLI, API, or dashboard to capture a profile; the CLI and API examples use a 5,000 ms duration.
Durable Objects and deployment tracking
- Each Preview has its own Durable Object namespaces, and objects can be profiled by ID.
- Each Preview deployment has its own ID, so profiles correspond to an exact version of the code.
Generated by AI from the original article. Check the source for full details.