evanderkoogh / otel-cf-workers

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

Add more DO storage instrumentation #107

Closed DaniFoldi closed 3 months ago

DaniFoldi commented 3 months ago

Fixes # [insert GH issue number(s)].

What this PR solves / how to test:

Previously, DO instrumentation copied all options to attributes. This PR implements special support for most methods (transaction is the only currently existing method on DurableObjectStorage that isn't handled properly, as it has a rollback method we should ideally proxy/track).

I also fixed a bug in put, pretty sure that the "entries" overload would've caused an exception previously as the instrumentation wasn't prepared for it.