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

fix Durable Object storage.list with no args #32

Closed rtbenfield closed 11 months ago

rtbenfield commented 11 months ago

When calling storage.list() with no arguments, the instrumented DurableObjectStorage instance throws an error due to attrs being undefined. This PR modifies the attribute creation to create the object first, then merges incoming attributes if applicable.

closes #33

rtbenfield commented 11 months ago

@evanderkoogh I've started writing some local tests with Vitest to verify fixes like this one. Is that something you'd like to incorporate into the repository? I could submit a PR that adds Vitest, a GitHub Actions check, and a few initial tests.

evanderkoogh commented 11 months ago

@evanderkoogh I've started writing some local tests with Vitest to verify fixes like this one. Is that something you'd like to incorporate into the repository? I could submit a PR that adds Vitest, a GitHub Actions check, and a few initial tests.

I wouldn't like it, I would love it!

Been on my to-do list for a while, but haven't had the time to set it all up properly trying to get some of the auto-instrumenting done :)