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

The global tracer is not of type WorkerTracer and can not export spans #75

Closed fforres closed 2 months ago

fforres commented 7 months ago

Hey folks! I keep on seeing the following issue pop up on a project I'm building.

With the most basic setup, I see the following on my logs: "The global tracer is not of type WorkerTracer and can not export spans"

This is our current PR. https://github.com/JSConfCL/gql_api/pull/94 (Even if I comment any parts related to getActiveSpan or setting span attributes, the issue persists. It's triggered by the addition of the instrument function that wraps everything. ๐Ÿค”

Not entirely sure if I'm making something wrong, but would love any pointers in the right direction ๐Ÿ™

evanderkoogh commented 7 months ago

Hmm.. at first blush you arenโ€™t doing anything wrong? So I will try to have a bit of a better look later today.

fforres commented 7 months ago

Appreciate it! If there's anything I can do to help, LMK ๐Ÿ™ Have the project running on a cloudflare worker if it helps ๐Ÿ™ (Or to sync on a call, etc)

evanderkoogh commented 7 months ago

Havenโ€™t had a chance to look at it in-depth, but would you be able to isolate the problem in a sample repo with just one worker that fails? That would be amazing!