-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unable to configure Sentry 8.0.0 programmatically #12033
Comments
Assigning to @getsentry/support for routing ⏲️ |
Hi, thanks for writing in! We'll do our best to address your concerns and maybe we can find some fixes and improvements. I hope it's ok if I ask you some questions so that we better understand what's going on:
FWIW, and this may be important for your case, you don't strictly need to pre-import a file with We are still kinda figuring out withing the team how to document all of this because there is a bit of complexity to it with a compatibility matrix of Node.js versions and there are a lot of conflicting opinions with regards to complexity/correctness trade-offs. Just so you can follow our thought process a bit 😄 |
Thanks for the reply!
The documentation states that the first thing has to be a call to the configuration, before anything is imported, so I figured that meant I couldn't include the code for our config management system (which transitively picks up lots of things like AWS libraries etc) before we then configured Sentry without losing all the AWS integrations (if any?).
Absolutely. Yes I did mean the
I guess understanding what is and is not covered by the "you must have imported sentry first".
I'm still not following this. If I support Can you elaborate on what "first thing" really means?
Thanks |
For context, our app is open source so has to work both with and without sentry, and with user-configurabl sentry stuff. In our current 7.x setup:
The packaged release is run from a separate repo entirely which has the As you can see our existing design is far from "first thing" initialsation of Sentry :) |
Thanks for elaborating! I think all of your questions are answered by the following: We are simply a bit strict with our wording in the docs because we need to be terse. Generally speaking, you should call You are totally allowed to hard code your DSN, meaning you don't have to import other code before Does this answer your question? |
With https://github.com/getsentry/sentry-javascript/releases/tag/8.5.0 we've released the ability to defer calling Here's the PR that describes how the feature works: #12213 It will soon be documented! |
Thank you! |
This still needs a bunch of command-line parameter changes to my |
If you are running it in ESM, there is sadly no way around using |
I see. How did things work pre-8.0? I will schedule the changes we need to try and do a lock-step release of our software and the container that runs it (which provides the cmdline flags to node...) |
Environment
SaaS (https://sentry.io/)
What are you trying to accomplish?
Trying to update to 8.0.0 with configuration for the DSN read from our in-house configuration system. Currently we do that in 7.* by (early on) reading our secret store and then using that to get the DSN and configure sentry. Now trying to accomplish this in 8.*
How are you getting stuck?
8.* requires a pre-include (for ESM apps), which is:
Our program is open source so we need this to be configurable so that folks running our product locally don't post their errors to our DSN.
Where in the product are you?
Sign In
Link
No response
DSN
https://8e4614f649ad4e3faf3e7e8827b935f9@sentry.io/102028
Version
8.0.0
The text was updated successfully, but these errors were encountered: