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

Browser Rendering API Breaks When Instrumenting #73

Closed apeacock1991 closed 8 months ago

apeacock1991 commented 8 months ago
TypeError: Invalid URL string. at Object.apply (worker.js:7500:20) at proxyHandler.apply (worker.js:6232:22) at PuppeteerWorkers.launch (worker.js:21848:32) at sendLiveNotifications (worker.js:21866:48) at scheduled (worker.js:21965:15) at worker.js:7619:13 at AsyncLocalStorageContextManager.with (worker.js:6467:36) at ContextAPI2.with (worker.js:3730:53) at WorkerTracer.startActiveSpan (worker.js:6686:24) at executeScheduledHandler (worker.js:7615:27)

The API is in beta, but it does break and when I remove the instrument line, it works, so I assume there's something funky going on with the Otel library and they aren't playing nice together.

evanderkoogh commented 8 months ago

Could you double check what version of the library you are using? The browser rendering API does indeed do some funky stuff by sending through an invalid URL that we try to parse. But I "fixed" it a little while ago by trying to detect both the Browser Rendering API and the AI binding and not instrumenting them for now until I can have a chat with the teams involved.

evanderkoogh commented 8 months ago

Oh wait.. I might have made an error in the last iteration of that.. gimme a sec

evanderkoogh commented 8 months ago

Could you try version 1.0.0-rc.20 that I just released? That should disable the Browser Rendering API for being automatically instrumented. I need to talk to the team to figure out how we are going to solve it properly.

apeacock1991 commented 8 months ago

Hey @evanderkoogh yup that fixed it, working fine now - thank you!

evanderkoogh commented 8 months ago

Well, it doesn’t actually instrument the rendering API, but it is better than outright failing 😂