-
We are looking to update a bunch of our infrastructure to OpenTelemetry. I've made a public repo: https://github.com/gas-buddy/gasbuddy The problem is pino does not appear to be getting instrumented. I'm wondering if it has to do with ESM. Here's what it prints:
Those last two lines should have a trace/span in them, right? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 6 replies
-
Have you ensured that autoinstrumentations are registered before any of the modules to instrument are actually loaded/required? Maybe do this by moving it from |
Beta Was this translation helpful? Give feedback.
-
Usually it will give you a warning if you load the module first, and I'm not getting any warnings (and trying to be careful about load order). I did split it out into its own call, and I added a console.log in pino, and this is what it does:
Why is pino special?? I wonder if this could have to do with being in a monorepo? Is the auto instrumentation looking for node_modules content or doing require tomfoolery? I also tried requiring pino via a cjs file, but that didn't work either. |
Beta Was this translation helpful? Give feedback.
-
I see there are three build-dirs for @opentelemetry/instrumentation - esm, esnext and src. I have verified I'm running in the "src" path, for whatever that is worth. |
Beta Was this translation helpful? Give feedback.
-
I logged during an active express request, that was/is also missing the span/trace. I agree that the app is ESM and pino is not, but what continues to confuse me is why the other instrumentations work (http, express) but pino does not. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to use OpenTelemetry without the require tricks? I'm fine specifying the "transforms" I want. |
Beta Was this translation helpful? Give feedback.
-
I've abandoned ESM, it's just not ready for prime time. But, I still see this (seeming) error on startup:
Yet everything goes on to be patched. |
Beta Was this translation helpful? Give feedback.
I've abandoned ESM, it's just not ready for prime time. But, I still see this (seeming) error on startup:
Yet everything goes on to be patched.