-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Migrating to v3 #370
Comments
Thanks for the detailed writeup Tim. I'm not migrating, but trying to integrate sentry for the first time and came across this thread. Unfortunately I wasn't successful at making it work. I kept getting this error, and my preload script wouldn't build:
I'm on Electron: 15.2.0 and using electron-forge 6.0.0-beta.61, including the webpack plugin. fwiw I've tried:
Happy to provide any other info that can help |
I'm currently working on improving the tests and adding more examples. Here you can see the Electron Forge Webpack example: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There are new features and bug fixes in the latest (3.0.0-beta.4) release! |
Thanks for the new release! I'm getting quite a few 400 errors after upgrading to the 3.0.0-beta.4 release within the module itself. Is this known? There is not much information provided what the cause of the failed request is. Could you @timfish have a look?
|
I would love to fix any potential issues with the latest SDK before it makes it to a stable release! However, I have not personally observed the issues you're reporting and I haven't seen it with any of the e2e tests. I need more information or a repository that reproduces the issue! Where is the JSON you've included coming from? |
Ah ok, so these events are making it to Sentry but they probably shouldn't be. The latest beta includes offline support which means that events that cannot be sent are saved to disk and sent when a connection is detected. It's highly likely that your app was getting HTTP errors at this point in v2 of the SDK, but they would have never have made it to Sentry because the server was not accessible. @AbhiPrasad how do you think I should go about improving this? Simply never queue errors originating from the transport? Outside of SDK transport errors, the offline support is going to increase the number of errors users get due to intermittent/bad connections. Other than make this more clear in the docs, is there anything else we should to to improve this? |
@timfish That's maybe a wild guess but we sometimes return null in We actually filter any network error, as those are not actable for us. export function beforeSend(
event: Sentry.Event,
hint: Sentry.EventHint
): Sentry.Event {
if (`${hint.originalException}`.includes('net::ERR_')) {
console.debug('[sentry] Ignored network error event.');
return null;
}
return event;
} |
The offline transport ( If |
I can't ever see a case where these errors are of high value to users, I would just filter them out if possible. We do have the |
Thanks for this handy guide! From the above it seems like Example with SentryElectron.init({
dsn: ...,
release: ...
}); The same works with v3, but the Typescript types insist that
Everything seems to work fine without |
Thanks for reporting this @chetbox, these should be optional! |
Many thanks for the PRs! |
3.0.0 has now been released and this migration guide has moved to here. |
Facing this issue as well |
v3 of the Electron SDK includes significant changes to simplify usage and improve maintainability and bundler support. Migration should still be relatively painless!
For some advanced technical detail, you may want to check out the relevant Proposal and Pull Request.
New Features:
Major breaking changes:
sampleRate
andbeforeSend
Session Tracking
Session tracking is now enabled by default so you will see Release Health data. Session tracking is via the
MainProcessSession
integration which as the name suggests, tracks sessions as per the main process lifetime.If you don't want to track sessions, this can be disabled by setting
autoSessionTracking
tofalse
.If you have a use case where sessions should be tracked in a different way, please open an issue!
Relative Imports
The SDK uses multiple
package.json
fields to ensure that bundlers automatically pickup the the correct entry point for each Electron process when using the root import (const Sentry = require('@sentry/electron')
orimport * as Sentry from '@sentry/electron'
). This allows you to have asentry.js
with your Sentry configuration imported into every process.However, not all bundlers are created equal and you may want to add specific integrations to only one of the Electron processes.
To support more complex configurations, you can now skip this automatic bundler target detection and import the process specific code directly:
Main Process
Renderer Process
Preload Code
Offline Support
The
ElectronOfflineNetTransport
is now the default transport. It wrapsElectronNetTransport
and saves payloads to disk if they cannot be sentAdditional device context
The default enabled
AdditionalContext
integration includes additional device context like screen resolution and memory usage.Browser Tracing
The significant refactor now allows the use of Sentry browser tracing in the renderer process:
main.js
renderer.js
Preload Scripts
As of 3.0.0-beta.2 a preload script is no longer required for Electron >= v5
Native Crashes,
sampleRate
andbeforeSend
Previously, the SDK did not consider
sampleRate
when sending native crash events and it was not possible to intercept them via thebeforeSend
hook. Theses are now correctly handled.Integrations over Options
Previously, the Electron SDK had various configuration options. Most of these have moved to integrations.
With v3, the only Electron specific configuration options are in the main process and are detailed below:
Native Crash Reporting
For native crash reporting, you have three options
SentryMinidump
integration (default)Uploads minidump files via the Sentry Envelope endpoint with full breadcrumbs and context
ElectronMinidump
integrationUploads minidumps via Crashpad/Breakpad built in uploader with partial context
SentryMinidump
integration)WebContents
'unresponsive'
EventsBy default, the
ElectronEvents
integrations captures events for unresponsive Electron renderers. If you would like to disable this:The text was updated successfully, but these errors were encountered: