Skip to content

Commit

Permalink
ID-361 Add breadcrumbs and release hash for sentry.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-in-a-Jar committed Mar 8, 2023
1 parent ba6260d commit b196897
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</appender>

<!-- Configure the Sentry appender, overriding the logging threshold to the WARN level -->
<appender name="Sentry" class="com.getsentry.raven.logback.SentryAppender">
<appender name="Sentry" class="io.sentry.logback.SentryAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/thurloe/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ import scala.concurrent.ExecutionContext.Implicits.global
import scala.jdk.CollectionConverters._

object Main extends App {
val releaseHash: Option[String] = sys.env.get("GIT_SHA")
val version: Option[String] = Option(getClass.getPackage.getImplementationVersion)

sys.env.get("SENTRY_DSN").foreach { dsn =>
val options = new SentryOptions()
options.setDsn(dsn)
options.setEnvironment(sys.env.getOrElse("SENTRY_ENVIRONMENT", "unknown"))
releaseHash.foreach(options.setRelease)
options.setRelease(version.getOrElse("unknown"))

Sentry.init(options)
}
Expand Down

0 comments on commit b196897

Please sign in to comment.