vercel / otel

OTEL tracing for Vercel
https://vercel.com/docs/observability/otel-overview
40 stars 9 forks source link

Failed to prepare server Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@vercel/otel' #118

Open oldbettie opened 2 months ago

oldbettie commented 2 months ago

I have been working through getting this setup with out project. I thought I made some progress I have been able to connect it to our otel provider when I run it locally but I cannot for the life of me get it to work in any remote environment.

I have even tried with the manual implementation. Here is the full error logs I get, any help would be great. i was able to get auto and manual working locally by setting the OTEL env variables but thats not documented anywhere on your site so took some digging through the code to figure out thats how it's done.

Now this looks like an edge time error but this is with your edge time supprted version 1.10 If I manually instrument it and set it to nodejs only it does not send any logs at all to honeycomb

[ERR_MODULE_NOT_FOUND]
An error occurred while loading instrumentation hook: Cannot find package '@vercel/otel' imported from /var/task/.next/server/instrumentation.js
[index.handler](https://console.sst.dev/vaxxa/vaxxa-2024/staging/resources/logs/qfuhepx8spj4hptf6mp9g1bm)
Stack Trace
new NodeError (node:internal/errors:405:5)
packageResolve (node:internal/modules/esm/resolve:965:9)
moduleResolve (node:internal/modules/esm/resolve:1022:20)
moduleResolveWithNodePath (node:internal/modules/esm/resolve:876:12)
defaultResolve (node:internal/modules/esm/resolve:1255:79)
ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
ModuleLoader.resolve (node:internal/modules/esm/loader:373:25)
ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38)
ModuleLoader.import (node:internal/modules/esm/loader:336:34)
importModuleDynamically (node:internal/modules/cjs/loader:1256:33)
Logs — 11 Sept 2024
22:08:30.516
Failed to prepare server Error [ERR_MODULE_NOT_FOUND]: An error occurred while loading instrumentation hook: Cannot find package '@vercel/otel' imported from /var/task/.next/server/instrumentation.js
    at new NodeError (node:internal/errors:405:5)
    at packageResolve (node:internal/modules/esm/resolve:965:9)
    at moduleResolve (node:internal/modules/esm/resolve:1022:20)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:876:12)
    at defaultResolve (node:internal/modules/esm/resolve:1255:79)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38)
    at ModuleLoader.import (node:internal/modules/esm/loader:336:34)
    at importModuleDynamically (node:internal/modules/cjs/loader:1256:33) {
  code: 'ERR_MODULE_NOT_FOUND'
}
22:08:31.801
NextJS request failed. Error [ERR_MODULE_NOT_FOUND]: An error occurred while loading instrumentation hook: Cannot find package '@vercel/otel' imported from /var/task/.next/server/instrumentation.js
    at new NodeError (node:internal/errors:405:5)
    at packageResolve (node:internal/modules/esm/resolve:965:9)
    at moduleResolve (node:internal/modules/esm/resolve:1022:20)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:876:12)
    at defaultResolve (node:internal/modules/esm/resolve:1255:79)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38)
    at ModuleLoader.import (node:internal/modules/esm/loader:336:34)
    at importModuleDynamically (node:internal/modules/cjs/loader:1256:33) {
  code: 'ERR_MODULE_NOT_FOUND'
}
22:08:31.834
NextJS request failed. Error [ERR_MODULE_NOT_FOUND]: An error occurred while loading instrumentation hook: Cannot find package '@vercel/otel' imported from /var/task/.next/server/instrumentation.js
    at new NodeError (node:internal/errors:405:5)
    at packageResolve (node:internal/modules/esm/resolve:965:9)
    at moduleResolve (node:internal/modules/esm/resolve:1022:20)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:876:12)
    at defaultResolve (node:internal/modules/esm/resolve:1255:79)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38)
    at ModuleLoader.import (node:internal/modules/esm/loader:336:34)
    at importModuleDynamically (node:internal/modules/cjs/loader:1256:33) {
  code: 'ERR_MODULE_NOT_FOUND'
}