Skip to content

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

Description

@timfish

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://examplePublicKey@o0.ingest.sentry.io/0 node --import=@sentry/node/init app.mjs

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions