def init()

in membership-attribute-service/app/monitoring/SentryLogging.scala [13:31]


  def init(config: SentryConfig): Unit = {
    config.sentryDsn match {
      case None => logger.warnNoPrefix("No Sentry logging configured (OK for dev)")
      case Some(sentryDSN) =>
        logger.infoNoPrefix(s"Initialising Sentry logging")
        Try {
          Sentry.init(sentryDSN)
          val buildInfo: Map[String, String] = app.BuildInfo.toMap.view.mapValues(_.toString).toMap
          val tags = Map("stage" -> config.stage) ++ buildInfo
          tags.foreach { case (key, value) =>
            Sentry.setTag(key, value)
          }
        } match {
          case Success(_) => logger.debug("Sentry logging configured.")
          case Failure(e) => logger.errorNoPrefix(scrub"Something went wrong when setting up Sentry logging ${e.getStackTrace}")
        }
    }

  }