fix: Send the process exit reason to Sentry + add OS info

This commit is contained in:
Jakub Błach 2025-07-24 14:16:00 +02:00 • committed by GitHub
commit d1b258ffc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 6 deletions

View file

@ -1,5 +1,6 @@
package com.github.continuedev.continueintellijextension.`continue`.process
import com.github.continuedev.continueintellijextension.error.ContinueErrorService
import com.github.continuedev.continueintellijextension.services.TelemetryService
import com.github.continuedev.continueintellijextension.utils.OS
import com.github.continuedev.continueintellijextension.utils.getContinueBinaryPath
@ -44,11 +45,8 @@ class ContinueBinaryProcess(private val onExit: () -> Unit) : ContinueProcess {
err = err.substring(doneIndex + delimiter.length)
}
}
println("Core process exited with output: $err")
val telemetryService = service<TelemetryService>()
telemetryService.capture("jetbrains_core_exit", mapOf("error" to err))
service<ContinueErrorService>().reportMessage("Core process exited with output: $err")
service<TelemetryService>().capture("jetbrains_core_exit", mapOf("error" to err))
}
private companion object {
@ -67,6 +65,7 @@ class ContinueBinaryProcess(private val onExit: () -> Unit) : ContinueProcess {
elevatePermissions()
}
// todo: consider setting permissions ahead-of-time during build/packaging, not at runtime
private fun elevatePermissions() {
val path = getContinueBinaryPath()
val permissions = setOf(

View file

@ -6,6 +6,7 @@ import com.intellij.openapi.components.Service
import com.intellij.openapi.diagnostic.Attachment
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.util.SystemInfo
import com.intellij.ui.jcef.JBCefApp
import io.sentry.Hint
import io.sentry.Sentry
@ -26,6 +27,8 @@ class ContinueErrorService {
config.setTag("ide_version", ApplicationInfo.getInstance().build.asString())
config.setTag("jcef_supported", JBCefApp.isSupported().toString())
config.setTag("plugin_version", PluginManagerCore.getPlugin(PluginId.getId(PLUGIN_ID))?.version)
config.setTag("system", SystemInfo.OS_NAME)
config.setTag("system_version", SystemInfo.OS_VERSION)
}
}
@ -39,7 +42,14 @@ class ContinueErrorService {
sentryEvent.message = Message().apply { this.message = message }
val hint = Hint.withAttachments(attachments?.map { SentryAttachment(it.bytes, it.path) })
Sentry.captureEvent(sentryEvent, hint)
log.warn("Problem sent to Sentry: $message", throwable)
log.warn("Exception sent to Sentry: $message", throwable)
}
fun reportMessage(
message: String,
) {
Sentry.captureMessage(message)
log.warn("Message sent to Sentry: $message")
}
private companion object {