Skip to content

Commit

Permalink
Upgrade collector to 3.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
benjben committed Nov 27, 2024
1 parent 7172f4a commit 9b9165f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object Dependencies {

object V {
// Snowplow
val snowplowStreamCollector = "3.2.0"
val snowplowStreamCollector = "3.2.1"
val snowplowCommonEnrich = "5.1.4"
val http4sCirce = "0.23.23"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import com.snowplowanalytics.snowplow.micro.Configuration.{MicroConfig, SinkConf
import org.http4s.blaze.server.BlazeServerBuilder
import org.http4s.headers.`Strict-Transport-Security`
import org.http4s.server.Server
import org.http4s.server.middleware.{HSTS, Metrics, Timeout, Logger => LoggerMiddleware}
import org.http4s.server.middleware.{HSTS, Metrics, Timeout}
import org.http4s.{HttpApp, HttpRoutes}
import org.typelevel.ci.CIString
import org.typelevel.log4cats.Logger
import org.typelevel.log4cats.slf4j.Slf4jLogger

Expand Down Expand Up @@ -57,9 +56,7 @@ object MicroHttpServer {

private def builder(routes: HttpRoutes[IO], config: CollectorConfig[SinkConfig]): BlazeServerBuilder[IO] = {
BlazeServerBuilder[IO]
.withHttpApp(
loggerMiddleware(timeoutMiddleware(hstsMiddleware(config.hsts, routes.orNotFound), config.networking), config.debug.http)
)
.withHttpApp(timeoutMiddleware(hstsMiddleware(config.hsts, routes.orNotFound), config.networking))
.withIdleTimeout(config.networking.idleTimeout)
.withMaxConnections(config.networking.maxConnections)
.withResponseHeaderTimeout(config.networking.responseHeaderTimeout)
Expand All @@ -69,16 +66,6 @@ object MicroHttpServer {
)
}

private def loggerMiddleware(routes: HttpApp[IO], config: CollectorConfig.Debug.Http): HttpApp[IO] =
if (config.enable) {
LoggerMiddleware.httpApp[IO](
logHeaders = config.logHeaders,
logBody = config.logBody,
redactHeadersWhen = config.redactHeaders.map(CIString(_)).contains(_),
logAction = Some((msg: String) => Logger[IO].debug(msg))
)(routes)
} else routes

private def timeoutMiddleware(routes: HttpApp[IO], networking: CollectorConfig.Networking): HttpApp[IO] =
Timeout.httpApp[IO](timeout = networking.responseHeaderTimeout)(routes)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ object Run {
config.collector.enableDefaultRedirect,
config.collector.rootResponse.enabled,
config.collector.crossDomain.enabled,
config.collector.networking.bodyReadTimeout,
collectorService
).value

Expand Down

0 comments on commit 9b9165f

Please sign in to comment.