Hi plugin developers,
there is a new experimental API for plugins coming: ErrorReportSink. Here’s the gist in 2 minutes:
This API gives plugin authors a built-in way to automatically observe their own failures, without relying on users to open the IDE error UI and click Submit. If you want to count crashes, group recurring stack traces, or forward summarized data to Sentry, Rollbar, or any other backend, this is the missing piece.
This is also what makes it different from ErrorReportSubmitter. ErrorReportSubmitter is part of the user-facing reporting flow. ErrorReportSink is background-only, receive-only, and meant for observability. In PlatformExtensionPoints.xml, they are separate extension points: errorHandler for ErrorReportSubmitter, and errorReportSink for ErrorReportSink, and they can be used together.
Minimal setup looks like this for ErrorReportSink:
<extensions defaultExtensionNs="com.intellij">
<errorReportSink implementation="my.plugin.MyErrorReportSink"/>
</extensions>
@Suppress("UnstableApiUsage")
class MyErrorReportSink : ErrorReportSink {
override suspend fun submit(report: UnhandledErrorReport) {
when (report) {
is UnhandledExceptionReport -> { /* report to backend */ }
is UnhandledFreezeReport -> { /* report to backend */ }
}
}
}
A few caveats are worth knowing before anyone builds around it:
- it is
@ApiStatus.Experimental - delivery is automatic and asynchronous
- it is best-effort, not guaranteed
- plugins only receive reports attributed to themselves
- exception reports are capped at 10,000 per plugin per IDE session
- exception reports are currently limited to class + stack trace, without message, cause chain, or attachments
- the platform does not deduplicate for you
The current implementation details are also useful context: delivery behavior comes from UnhandledReportSinkServiceImpl.kt, exception attribution goes through code such as IdeaLogger.java and PluginUtilImpl.java, and freeze attribution/reporting is tied into code such as PluginFreezeNotificationPanel.kt.
As always, feel free to ask any questions.