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

node: Support no-code init via --import or --require and env variables #11997

Closed
timfish opened this issue May 13, 2024 · 0 comments · Fixed by #11999
Closed

node: Support no-code init via --import or --require and env variables #11997

timfish opened this issue May 13, 2024 · 0 comments · Fixed by #11999

Comments

@timfish
Copy link
Collaborator

timfish commented May 13, 2024

Problem Statement

@sentry/node already supports much of the basic configuration via environment variables. These are great because you can change often change settings without re-deploying your code. However, users are still required to create a JavaScript file to call Sentry.init().

Solution Brainstorm

If we add an init export (@sentry/node/init) that calls Sentry.init() users can then initialise Sentry and get all the auto-instrumentation magic without writing any code:

> SENTRY_DSN=https://[email protected]/0 node --import=@sentry/node/init app.mjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant