Sentry Angular allow only manual exception #6974
-
I am on angular V14 project. Currently i am using sentry only for web socket disconnection in entire project. Using |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hey @Dhan3777 - thanks for writing in. To disable automatic instrumentation for errors you can remove the integrations that do this. See: https://docs.sentry.io/platforms/javascript/guides/angular/configuration/integrations/default/#removing-an-integration on how to remove an integration. Specifically you'll have to remove the Sentry.init({
// ...
integrations: function(integrations) {
// integrations will be all default integrations
return integrations.filter(function(integration) {
return integration.name !== "TryCatch" || integration.name !== "GlobalHandlers";
});
},
}); |
Beta Was this translation helpful? Give feedback.
-
@AbhiPrasad thx for replay. Unfortunately I didn't work. It is blocking every event even those which are triggered by Sentry.captureException and Sentry.captureMessage. Is there any other way |
Beta Was this translation helpful? Give feedback.
-
@AbhiPrasad sorry my bad, turns out my adblock extension was creating issue. It is working now integrations: function(integrations) {
// integrations will be all default integrations
let integrationArr = ["InboundFilters","Breadcrumbs","FunctionToString"]
return integrations.filter(function(integration) {
let idx = integrationArr.findIndex(ele=>ele == integration.name)
return idx != -1
});
},
beforeBreadcrumb(breadcrumb, hint) {
return breadcrumb.category === "error" || breadcrumb.category === "sentry.event" || breadcrumb.category == 'navigation' ? breadcrumb : null; PS:- doing this caused default tags to eliminate (browser.name ,OS ,URL, User etc etc), any idea how can I get them back ? |
Beta Was this translation helpful? Give feedback.
-
@AbhiPrasad Would really appreciate help here. |
Beta Was this translation helpful? Give feedback.
Hey @Dhan3777 - thanks for writing in. To disable automatic instrumentation for errors you can remove the integrations that do this.
See: https://docs.sentry.io/platforms/javascript/guides/angular/configuration/integrations/default/#removing-an-integration on how to remove an integration.
Specifically you'll have to remove the
TryCatch
andGlobalHandlers
integrations.