Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue] possible issue with opentelemetry on deployment #811

Closed
matoni109 opened this issue Dec 14, 2022 · 7 comments
Closed

[issue] possible issue with opentelemetry on deployment #811

matoni109 opened this issue Dec 14, 2022 · 7 comments

Comments

@matoni109
Copy link

matoni109 commented Dec 14, 2022

Hello appSignal 👋,

Just trying to bump to your v3 node package, but I'm getting below which I think might be inherited from this issue over at OpenTelemetry:

remote: =====> Start of platform-gateway-staging container output (web.1)        
remote:        > federation-gateway@0.1.2 start        
remote:        > doppler run -- node --require ./src/plugins/appsignal.cjs src/server.js        
remote:        no original function accessSync to wrap        
remote:        no original function appendFileSync to wrap        
remote:        no original function chmodSync to wrap        
remote:        no original function chownSync to wrap        
remote:        no original function copyFileSync to wrap        
remote:        no original function cpSync to wrap        
remote:        no original function existsSync to wrap        
remote:        no original function lchownSync to wrap        
remote:        no original function linkSync to wrap        
remote:        no original function lstatSync to wrap        
remote:        no original function lutimesSync to wrap        
remote:        no original function mkdirSync to wrap        
remote:        no original function mkdtempSync to wrap        
remote:        no original function opendirSync to wrap        
remote:        no original function openSync to wrap        
remote:        no original function readdirSync to wrap        
remote:        no original function readFileSync to wrap        
remote:        no original function readlinkSync to wrap        
remote:        no original function realpathSync to wrap        
remote:        no original function renameSync to wrap        
remote:        no original function rmdirSync to wrap        
remote:        no original function rmSync to wrap        
remote:        no original function statSync to wrap        
remote:        no original function symlinkSync to wrap        
remote:        no original function truncateSync to wrap        
remote:        no original function unlinkSync to wrap        
remote:        no original function utimesSync to wrap        
remote:        no original function writeFileSync to wrap        
remote:        no original function exists to wrap        
remote:        /app/node_modules/@opentelemetry/instrumentation-fs/build/src/instrumentation.js:53        
remote:                                if (instrumentation_1.isWrapped(fs.promises[fName])) {        
remote:                                                                           ^        
remote:        TypeError: Cannot read properties of undefined (reading 'access')        
remote:            at InstrumentationNodeModuleDefinition.patch (/app/node_modules/@opentelemetry/instrumentation-fs/build/src/instrumentation.js:53:68)        
remote:            at FsInstrumentation._onRequire (/app/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js:79:35)        
remote:            at /app/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js:133:29        
remote:            at /app/node_modules/@opentelemetry/instrumentation/build/src/platform/node/RequireInTheMiddleSingleton.js:54:27        
remote:            at Hook._require.Module.require (/app/node_modules/require-in-the-middle/index.js:175:32)        
remote:            at require (node:internal/modules/cjs/helpers:102:18)        
remote:            at Object.<anonymous> (/app/node_modules/cacache/lib/entry-index.js:11:5)        
remote:            at Module._compile (node:internal/modules/cjs/loader:1112:14)        
remote:            at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)        
remote:            at Module.load (node:internal/modules/cjs/loader:988:32)        
remote:        Node.js v18.4.0        
  "type": "module",
  "engines": {
    "node": "18.4.0",
    "yarn": "^1.22.19"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "lint": "eslint src/ -c .eslintrc --ext js",
    "start": "doppler run -- node --require ./src/plugins/appsignal.cjs src/server.js",
    "dev-start": "doppler run -- nodemon --require ./src/plugins/appsignal.cjs src/server.js"
  },
// appsignal.cjs
const { Appsignal } = require('@appsignal/nodejs');

const appsignal = new Appsignal({
  active: process.env.NODE_ENV === 'production',
  name: `Platform Gateway`,
  revision: process.env.GIT_REV ? process.env.GIT_REV.slice(0, 7) : null,
  environment: process.env.LOG_ENV || 'development',
  pushApiKey: process.env.APPSIGNAL_PUSH_API_KEY,
});
@matoni109 matoni109 changed the title [issue] [issue] possible issue with opentelemetry on deployment Dec 14, 2022
@tombruijn
Copy link
Member

Hi @matoni109, thanks for notifying us of this issue!

It looks like the same issue to me too. Looks like the fix has not been released yet in the OpenTelemetry packages.

You can disable the fs instrumentation from our end for now by configuring the disableDefaultInstrumentations option to ["@opentelemetry/instrumentation-fs"] in the AppSignal config.

// appsignal.cjs
const { Appsignal } = require("@appsignal/nodejs");
 
new Appsignal({
  // ...
  disableDefaultInstrumentations: ["@opentelemetry/instrumentation-fs"]
});

@tombruijn
Copy link
Member

@matoni109
Copy link
Author

Thanks @tombruijn,

We will wait for the next release, and then try and push to staging then, we couldn't get this to replicate in local dev.

@luismiramirez
Copy link
Member

Waiting for an OpenTelemetry release with the fix

@tombruijn
Copy link
Member

We're going to remove the fs instrumentation by default in issue #845 until this is resolved.

@backlog-helper
Copy link

backlog-helper bot commented Feb 1, 2023

Closing this issue because it is archived on its parent project.

@backlog-helper backlog-helper bot closed this as completed Feb 1, 2023
@tombruijn tombruijn reopened this Feb 1, 2023
@tombruijn
Copy link
Member

We removed the instrumentation default in package version 3.0.7. Please upgrade and let us know if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants