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

Pages function support #71

Closed arnarthor closed 8 months ago

arnarthor commented 8 months ago

Reading through the docs and issues I don't find any mention of Cloudflare Pages. Would it be possible to use this library for functions?

We use Pages instead of Workers at my job because of simplicity and automatic branch previews. I know that compiled pages are just a worker behind the scenes, so I'm wondering if I could somehow shoehorn it into my project.

I've been trying to use the official cloudflare pages plugin, but I'm not getting any logs or custom data through to Honeycomb so I started looking at alternatives.

evanderkoogh commented 8 months ago

Apologies for the delay.. been a week :)

But we currently do not support Pages Functions no.. I am currently very much focused on getting a 1.0 for the stuff that we currently have, but I am also trying to get some external help from companies using the library to help out with some of the remaining auto-instrumenting parts.

But if you are using Honeycomb, I am pretty sure my old library and the Pages plugin should work for that?

arnarthor commented 8 months ago

Yeah, I managed to figure out eventually how to use it with pages, there was some issue with my configuration to begin with.

I am missing the auto instrumentation though, that makes such a difference. For now we'll do with adding spans, logs and data where we feel it's relevant though.

vanstinator commented 3 months ago

Would you mind sharing how you were able to get this working with pages? I'm going to be manually instrumenting a service using pages as well and my current experiments are failing to emit any spans to my collector. I suspect it's because I'm holding the library wrong inside our pages function.