evanderkoogh / otel-cf-workers

An OpenTelemetry compatible library for instrumenting and exporting traces for Cloudflare Workers
BSD 3-Clause "New" or "Revised" License
210 stars 40 forks source link

Missing passThroughOnException on ExecutionContext #34

Closed jfsiii closed 11 months ago

jfsiii commented 11 months ago

The ctx argument passed to fetch is missing passThroughOnException

When I add this logging inside the instrumented fetch handler (e.g. here or here):

console.log('handler.fetch ctx', ctx, 'waitUntil?', ctx.waitUntil, 'passThroughOnException?', ctx.passThroughOnException)

I see

handler.fetch ctx Proxy(ExecutionContext) waitUntil? Proxy(Function) passThroughOnException? undefined

I also didn't see any references to passThroughOnException in this repo. Perhaps it's intentional, but I believe it's expected/required.

evanderkoogh commented 11 months ago

You are absolutely correct that that should be present. I forgot to add the "if not any of the properties I want to proxy, pass the request through to the actual ExecutionContext object" :)

Fix is commit and hopefully will have time to roll out a new release later tonight :)