lb777
lb777

Reputation: 73

How to capture variables from Nodejs and send then to Sentry?

How can I automatically capture local variables from Nodejs for sending to Sentry, like in the Python client?
I'm using Nodejs v12 and Express framework.
And how can I automatically capture local variables from Front-End, React.js?

Upvotes: 2

Views: 1083

Answers (2)

Maxim Lopin
Maxim Lopin

Reputation: 129

19 Feb 2024 update

As simple as:

Sentry.init({
    dsn: '...',
    includeLocalVariables: true
  })

Source: https://blog.sentry.io/local-variables-for-nodejs-in-sentry/

Upvotes: 1

Tim Babych
Tim Babych

Reputation: 3454

Sentry has a ticket on this, https://github.com/getsentry/sentry-javascript/issues/990. They made no progress on it because getting names and values of local variables in JS is barely possible. Getting All Variables In Scope

Upvotes: 1

Related Questions