From a5bfb7dc4d3ce7fa4e8783e41dd1b8071e6d1ee8 Mon Sep 17 00:00:00 2001 From: Benjamin Benoist Date: Tue, 26 Nov 2024 16:02:48 +0100 Subject: [PATCH] Upgrade collector to 3.2.1 --- .github/workflows/deploy.yml | 2 +- .github/workflows/test.yml | 2 +- project/Dependencies.scala | 2 +- .../MicroHttpServer.scala | 17 ++--------------- .../Run.scala | 1 - 5 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 15246c4..d2ea057 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,7 +28,7 @@ jobs: - name: Publish collector locally run: | - git clone --branch 3.2.0 --depth 1 https://github.com/snowplow/stream-collector.git + git clone --branch 3.2.1 --depth 1 https://github.com/snowplow/stream-collector.git cd stream-collector sbt +publishLocal diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 39aff62..7e4bc4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: - name: Publish collector locally run: | - git clone --branch 3.2.0 --depth 1 https://github.com/snowplow/stream-collector.git + git clone --branch 3.2.1 --depth 1 https://github.com/snowplow/stream-collector.git cd stream-collector sbt +publishLocal diff --git a/project/Dependencies.scala b/project/Dependencies.scala index e63f8d9..bbeb306 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -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" diff --git a/src/main/scala/com.snowplowanalytics.snowplow.micro/MicroHttpServer.scala b/src/main/scala/com.snowplowanalytics.snowplow.micro/MicroHttpServer.scala index 39a1687..dca6ac5 100644 --- a/src/main/scala/com.snowplowanalytics.snowplow.micro/MicroHttpServer.scala +++ b/src/main/scala/com.snowplowanalytics.snowplow.micro/MicroHttpServer.scala @@ -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 @@ -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) @@ -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) diff --git a/src/main/scala/com.snowplowanalytics.snowplow.micro/Run.scala b/src/main/scala/com.snowplowanalytics.snowplow.micro/Run.scala index bd46f88..6204a70 100644 --- a/src/main/scala/com.snowplowanalytics.snowplow.micro/Run.scala +++ b/src/main/scala/com.snowplowanalytics.snowplow.micro/Run.scala @@ -66,7 +66,6 @@ object Run { config.collector.enableDefaultRedirect, config.collector.rootResponse.enabled, config.collector.crossDomain.enabled, - config.collector.networking.bodyReadTimeout, collectorService ).value