Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: update dependencies (#2173)
* update dependency springframework security

* update slf4j

* update zio dependencies

* update scalafmt

* explicitly add jackson-databind dependency to get rid of vulnerability

* add jodd to scala-steward ignore list

* bump Kamon version and fix code accordingly

* add swagger annotations to scala-seward ignore list
  • Loading branch information
BalduinLandolt committed Aug 23, 2022
1 parent 4fab193 commit 79b88d2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
8 changes: 8 additions & 0 deletions .scala-steward.conf
@@ -0,0 +1,8 @@
# ignore the following dependencies:

# jodd -> hard to update and only used in DateUtilV1
# swagger-akka-http -> should be removed in separate PR
updates.ignore = [
{ groupId = "org.jodd", artifactId="jodd", version = "3.2.7" },
{ groupId = "com.github.swagger-akka-http", artifactId="swagger-akka-http", version = "1.6.0" }
]
2 changes: 1 addition & 1 deletion .scalafmt.conf
@@ -1,4 +1,4 @@
version = "3.5.8"
version = "3.5.9"
runner.dialect = scala213
maxColumn = 120
align.preset = most
Expand Down
18 changes: 10 additions & 8 deletions project/Dependencies.scala
Expand Up @@ -22,10 +22,10 @@ object Dependencies {
val scalaVersion = "2.13.8"
val ZioVersion = "2.0.0"
val ZioHttpVersion = "2.0.0-RC4"
val ZioJsonVersion = "0.3.0-RC10"
val ZioJsonVersion = "0.3.0-RC11"
val ZioConfigVersion = "3.0.2"
val ZioSchemaVersion = "0.2.0"
val ZioLoggingVersion = "2.0.1"
val ZioLoggingVersion = "2.1.0"
val ZioZmxVersion = "2.0.0-RC4"
val ZioPreludeVersion = "1.0.0-RC15"

Expand All @@ -40,8 +40,8 @@ object Dependencies {
val zioConfig = "dev.zio" %% "zio-config" % ZioConfigVersion
val zioConfigMagnolia = "dev.zio" %% "zio-config-magnolia" % ZioConfigVersion
val zioConfigTypesafe = "dev.zio" %% "zio-config-typesafe" % ZioConfigVersion
val zioTest = "dev.zio" %% "zio-test" % "2.0.0"
val zioTestSbt = "dev.zio" %% "zio-test-sbt" % "2.0.0"
val zioTest = "dev.zio" %% "zio-test" % "2.0.1"
val zioTestSbt = "dev.zio" %% "zio-test-sbt" % "2.0.1"

// akka
val akkaActor = "com.typesafe.akka" %% "akka-actor" % akkaVersion // Scala 3 compatible
Expand All @@ -57,12 +57,12 @@ object Dependencies {
// logging
val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.11"
val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5" // Scala 3 compatible
val slf4j = "org.slf4j" % "slf4j-simple" % "1.7.36"
val slf4j = "org.slf4j" % "slf4j-simple" % "2.0.0"

// Metrics
val aspectjweaver = "org.aspectj" % "aspectjweaver" % "1.9.9.1"
val kamonCore = "io.kamon" %% "kamon-core" % "2.5.6" // Scala 3 compatible
val kamonScalaFuture = "io.kamon" %% "kamon-scala-future" % "2.1.21" // Scala 3 incompatible
val kamonCore = "io.kamon" %% "kamon-core" % "2.5.6" // Scala 3 compatible
val kamonScalaFuture = "io.kamon" %% "kamon-scala-future" % "2.5.6" // Scala 3 incompatible

// input validation
val commonsValidator =
Expand All @@ -72,7 +72,7 @@ object Dependencies {
val jwtSprayJson = "com.github.jwt-scala" %% "jwt-spray-json" % "9.0.2"
// jwtSprayJson -> 9.0.2 is the latest version that's compatible with spray-json; if it wasn't for spray, this would be Scala 3 compatible
val springSecurityCore =
"org.springframework.security" % "spring-security-core" % "5.7.2" exclude ("commons-logging", "commons-logging") exclude ("org.springframework", "spring-aop")
"org.springframework.security" % "spring-security-core" % "5.7.3" exclude ("commons-logging", "commons-logging") exclude ("org.springframework", "spring-aop")
val bouncyCastle = "org.bouncycastle" % "bcprov-jdk15to18" % "1.71"

// caching
Expand All @@ -96,6 +96,7 @@ object Dependencies {
val swaggerAkkaHttp = "com.github.swagger-akka-http" %% "swagger-akka-http" % "1.6.0" // Scala 3 incompatible
val titaniumJSONLD = "com.apicatalog" % "titanium-json-ld" % "1.3.1"
val xmlunitCore = "org.xmlunit" % "xmlunit-core" % "2.9.0"
val jacksonDatabind = "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.3"

// test
val akkaHttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion // Scala 3 incompatible
Expand Down Expand Up @@ -127,6 +128,7 @@ object Dependencies {
gatlingTestFramework % Test,
gwtServlet,
icu4j,
jacksonDatabind,
jakartaJSON,
jedis,
jenaText,
Expand Down
Expand Up @@ -6,12 +6,12 @@
package org.knora.webapi.instrumentation

import com.typesafe.scalalogging.Logger
import kamon.instrumentation.futures.scala.ScalaFutureInstrumentation.trace
import org.slf4j.LoggerFactory

import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.util.Success
import kamon.Kamon

/**
* A set of methods used for measuring stuff that is happening.
Expand Down Expand Up @@ -47,10 +47,11 @@ trait InstrumentationSupport {
* have at least something.
*/
val start = System.currentTimeMillis()
trace(name)(future.andThen { case Success(_) =>
metricsLogger.info(s"$name: {} ms", System.currentTimeMillis() - start)
})
// .andThen(case completed => logger.info(s"$name: " + (System.currentTimeMillis() - start) + "ms"))
Kamon.span(name) {
future.andThen { case Success(_) =>
metricsLogger.info(s"$name: {} ms", System.currentTimeMillis() - start)
}
}
}

// def counter(name: String) = Kamon.metrics.counter(name)
Expand Down

0 comments on commit 79b88d2

Please sign in to comment.