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

Nested `waitUntil` not correctly awaited #7

Closed hansottowirtz closed 1 year ago

hansottowirtz commented 1 year ago

Due to this line I believe nested waitUntils are not correctly awaited:

https://github.com/evanderkoogh/otel-cf-workers/blob/9b40f78e8a84b34fa31e8db1d26013c0844f74ed/src/instrumentation/common.ts#L22-L24

It's exactly the same issue as here: https://github.com/cloudflare/miniflare/issues/605

I'll open a PR implementing this code.

evanderkoogh commented 1 year ago

Doh!

awesome catch! I am hot on the tail of a fix for the wrangler 3 issue so once I fixed that I’ll merge this and get a release out. Thanks!