diff --git a/build.sbt b/build.sbt index 00f1bf89..56ac8424 100644 --- a/build.sbt +++ b/build.sbt @@ -23,7 +23,8 @@ libraryDependencies ++= Seq( "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5", "com.typesafe.akka" %% "akka-http-spray-json" % "10.2.9", "com.google.protobuf" % "protobuf-java" % "4.0.0-rc-2", - "io.sentry" % "sentry" % "6.9.2", + "io.sentry" % "sentry" % "6.15.0", + "io.sentry" % "sentry-logback" % "6.15.0", "org.broadinstitute.dsde.workbench" %% "workbench-google" % workbenchGoogleV exclude("com.typesafe.akka", "akka-protobuf-v3_2.13") exclude("com.google.protobuf", "protobuf-java") diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 81464542..1bd54dbb 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -31,10 +31,11 @@ - + ERROR + DEBUG diff --git a/src/main/scala/thurloe/Main.scala b/src/main/scala/thurloe/Main.scala index b8124c37..e41726cf 100644 --- a/src/main/scala/thurloe/Main.scala +++ b/src/main/scala/thurloe/Main.scala @@ -16,10 +16,14 @@ import scala.concurrent.ExecutionContext.Implicits.global import scala.jdk.CollectionConverters._ object Main extends App { + 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")) + options.setRelease(version.getOrElse("unknown")) + Sentry.init(options) }