-
Notifications
You must be signed in to change notification settings - Fork 179
Add option and API to disable Sentry reporting on demand #21
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
Conversation
Would this have the same effect as simply setting the DSN to an empty value? |
Likely, but I was not able to find any documentation on what effect that has on the client exactly. This has an added value of being able to disable/enable reporting temporarily - for example, for integration tests, to verify that sentry is being invoked at all times it is meant to be invoked. Plus this is isolated in the bundle and does not rely on "external" API. Personally, I think having explicit API and flag is way better than mangling with DSN. :) What do you think? |
In every Sentry SDK setting a falsely value for he DSN disables reporting (it's a documented standard in our spec). Because that's all this does I think we shouldn't add a duplicate path for that. There is however an argument to be made on having a flag which completely avoids even creating the integration. |
You mean to not create the service in container? How do you feel would be better to approach this? |
also you can simple use this # app/config/config_test.yml
sentry:
skip_capture:
- "Exception" this will prevent store of any exception that extend |
Ok, closing this then. |
@dcramer, with all the respect, adding this option makes it look much better. My car has neutral gear and I can use it when I want engine on, but car not moving. Please consider reopen this PR. Thank you. |
@ryabenko-pro software has nothing to do with your cars gears, and we have a standard in place for "how to disable sending errors with Sentry" that is already followed. There's little to no value in adding a second mechanism to disable Sentry just because of personal preference. |
Thank you @dcramer, very clear and loud. Software and car building have a lot in common - both are usually done by engineers, but this is rather personal opinion. Personal opinion of your potential customer, btw. |
Here is real case - using .env provided by symfony sentry is crashing dev env, because I can't pass null there. I'm getting exception:
I've been trying following options:
result in same exception. I have to go and change Thank you. P.S.: If you have recipe how to make it working with very standard S3 DotEnv component, I'll leave this topic. |
My expectation is that |
@ryabenko-pro I think that you are misusing the Symfony Dotenv component. |
So the issue was localized. Bitbucket pipeline uses image with weird feature: empty value in .env file being parsed as string with one space " " (see screenshot). Sentry thinks that a space is not empty DSN, start parsing it and throws exception "Unsupported Sentry DSN scheme: ". Locally and on qa/prod servers any amount of spaces as a value results in empty string, so issue only appears on Bitbucket pipelines. If I put valid URL as DSN value - everything works perfectly. I write to Bitbucket support. |
Happy to see that you resolved it! |
unfortunately I did not yet resolved it. |
@ryabenko-pro just released the fix: https://github.com/getsentry/sentry-symfony/releases/tag/0.8.5 |
Thank you very much for fix, despite the tone of my comment. I edited my comment to remove bad behaviour example. |
This PR suggests adding an option and API to disable Sentry reporting - during tests, in testing environment's etc.
This change is