shiichan

Logpush subrequest merging is here, and your HTTP logs just got tidier!

Hey there, it's me! Today I found a nice little logging update to share with you.

Cloudflare Changelog developers.cloudflare.com

What was announced?

Over on the Cloudflare Changelog, there's news that Logpush now supports subrequest merging.

When a Worker handles a request, it can fire off extra outbound fetch calls along the way. Those extra calls are "subrequests," and with this update you can now fold them into a single parent request log entry.

The story so far

Until now, the parent request and its subrequests each showed up as their own separate log lines. So even for one request, a Worker that made lots of fetch calls would pile up that many extra lines. Figuring out "which parent does this child belong to?" could get a little tedious.

What changes

When you turn on subrequest merging, the subrequest logs get grouped inside the parent request record. Each subrequest lives as a nested array inside the parent, so you can see at a glance what a request called behind the scenes. Fewer log lines, easier aggregation and investigation.

Dive Deep

The setup is simple: just add this flag when you create or update an http_requests Logpush job.

{
  "merge_subrequests": true
}

With it enabled, the parent request record gains a nested subrequests array field, and each subrequest sits inside it using the standard http_requests fields. The full details are in the Subrequests documentation.

There are a few limits to keep in mind:

  • It only applies to the zone-scoped http_requests dataset
  • Up to 50 subrequests can merge into one parent request (extras stay as individual lines like before)
  • Subrequests need to complete within 5 minutes
  • Subrequests that do not qualify still appear as separate log entries

One more thing: this is a gradual rollout and is not available on all zones yet. For enablement, reach out to your account team.

Wrap-up

  • Logpush now has subrequest merging (merge_subrequests: true)
  • Your Workers' subrequests can be recorded inside the parent request's subrequests array
  • It targets http_requests, with a 50-subrequest cap and a 5-minute window
  • It's still rolling out gradually, and enablement goes through your account team

If you run Workers that make lots of outbound calls and want cleaner logs, this one's for you!