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 7, 2023
1 parent fee9fac commit ba6260d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel>
</appender>

<logger name="org.broadinstitute.dsde" level="info" additivity="false">
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/thurloe/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +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")
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)

Sentry.init(options)
}

Expand Down

0 comments on commit ba6260d

Please sign in to comment.