I have been investigating APM for Workers over the last couple of days as their solution is very build your own at the moment.
I'm fairly new to the Elastic stack as well so I may have missed something but I thought my learnings might still be valuable for anyone reading this going forward.
Cloudflare Workers uses a modified version of Web Workers to run sandboxed javascript from what I can tell. They also mention using existing NodeJS packages using NPM and Webpack.
So my first throught was to bundle up the NodeJS APM agent, but that didn't work so well as we are missing core NodeJS libraries like async hooks, js and net etc.
Next I had a look at the base JavaScript agent which I thought may do part of what I wanted but it's a tool aimed at user monitor not servers, and after packaging it up with Webpack and deploying, I received an APM: Platform is not supported! console log, so that's out.
I think after all that I'm going to fall back on some basic HTTP input with Logstash.