OpenTelemetry instrumentation

Did anyone have some luck making OpenTelemetry instrumentation libraries work on Deno? I've seen some examples on the internet of @opentelemetry/instrumentation-fetch working, but I've been unable to make mine work so far. I did manage to find a workaround for that, but now I'm trying to get instrumentation for my SQL queries. I'm currently using drizzle-orm and tried to install @opentelemetry/instrumentation-pg. But just like the fetch instrumentation, it doesn't seem to be doing anything at all. Is there something special required to make this work, or are Open Telemetry instrumentation libraries just completely broken on Deno?
Deno AI Helper31d ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided, there are a few things to consider: 1. Deno does not use the Node package manager (npm), and therefore packages like @opentelemetry/instrumentation-fetch or @opentelemetry/instrumentation-pg that are designed for Node.js might not work out of the box in Deno. Deno has its own set of APIs and standard library, and it uses URLs for importing modules. 2. If you are trying to use Node.js packages in Deno, you might encounter compatibility issues since Deno does not support the Node.js module system natively. You would typically need to find a Deno-specific module or a polyfill that provides similar functionality. 3. For SQL query instrumentation in Deno, you would need to look for Deno-specific libraries or adapt existing OpenTelemetry instrumentation to work with Deno's module system and runtime environment. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. Since Deno and Node.js have different ecosystems, it's important to look for Deno-compatible libraries or workarounds that fit within Deno's module system and runtime constraints.
realpha28d ago
I didn’t take a closer look yet, but IIRC all open telemetry packages depend on async hooks, which unfortunately are currently not supported on deno