otel-cf-workers
otel-cf-workers copied to clipboard
feat: start adding support to cf pages
Fixes #96
What this PR solves / how to test:
This PR adds support for automatically instrumenting Cloudflare Pages. The code is very similar to the fetch
code. I'd initially intended to combine the similar bits into a shared core, but as I started to get into those weeds I realized I didn't have a ton of context on the full set of differences between Pages and Workers, and it started to seem like keeping the code paths separate would allow for a more organic growth on the Pages instrumentation.
To test this code yourself it's as simple as wrapping a Cloudflare Pages handler in instrumentPage
and passing it a valid TraceConfig
.