如何从Nodejs中捕获变量并发送给Sentry?

问题描述 投票:0回答:2

如何像在 Python 客户端中一样自动从 Nodejs 捕获局部变量并发送到 Sentry?
我正在使用 Nodejs v12 和 Express 框架。
如何自动从前端、React.js 捕获局部变量?

node.js sentry
2个回答
1
投票

Sentry 对此有一张票,https://github.com/getsentry/sentry-javascript/issues/990。他们在这方面没有取得任何进展,因为在 JS 中获取局部变量的名称和值几乎是不可能的。 获取作用域内的所有变量


0
投票

2024 年 2 月 19 日更新

很简单:

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

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

© www.soinside.com 2019 - 2024. All rights reserved.