Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ID-361 Add breadcrumbs and release hash for sentry. #143

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 2 additions & 1 deletion src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
</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>
<minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel>
</appender>

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

Expand Down