Skip to content

Commit 79b88d2

Browse files
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
1 parent 4fab193 commit 79b88d2

4 files changed

Lines changed: 25 additions & 14 deletions

File tree

‎.scala-steward.conf‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ignore the following dependencies:
2+
3+
# jodd -> hard to update and only used in DateUtilV1
4+
# swagger-akka-http -> should be removed in separate PR
5+
updates.ignore = [
6+
{ groupId = "org.jodd", artifactId="jodd", version = "3.2.7" },
7+
{ groupId = "com.github.swagger-akka-http", artifactId="swagger-akka-http", version = "1.6.0" }
8+
]

‎.scalafmt.conf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.5.8"
1+
version = "3.5.9"
22
runner.dialect = scala213
33
maxColumn = 120
44
align.preset = most

‎project/Dependencies.scala‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ object Dependencies {
2222
val scalaVersion = "2.13.8"
2323
val ZioVersion = "2.0.0"
2424
val ZioHttpVersion = "2.0.0-RC4"
25-
val ZioJsonVersion = "0.3.0-RC10"
25+
val ZioJsonVersion = "0.3.0-RC11"
2626
val ZioConfigVersion = "3.0.2"
2727
val ZioSchemaVersion = "0.2.0"
28-
val ZioLoggingVersion = "2.0.1"
28+
val ZioLoggingVersion = "2.1.0"
2929
val ZioZmxVersion = "2.0.0-RC4"
3030
val ZioPreludeVersion = "1.0.0-RC15"
3131

@@ -40,8 +40,8 @@ object Dependencies {
4040
val zioConfig = "dev.zio" %% "zio-config" % ZioConfigVersion
4141
val zioConfigMagnolia = "dev.zio" %% "zio-config-magnolia" % ZioConfigVersion
4242
val zioConfigTypesafe = "dev.zio" %% "zio-config-typesafe" % ZioConfigVersion
43-
val zioTest = "dev.zio" %% "zio-test" % "2.0.0"
44-
val zioTestSbt = "dev.zio" %% "zio-test-sbt" % "2.0.0"
43+
val zioTest = "dev.zio" %% "zio-test" % "2.0.1"
44+
val zioTestSbt = "dev.zio" %% "zio-test-sbt" % "2.0.1"
4545

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

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

6767
// input validation
6868
val commonsValidator =
@@ -72,7 +72,7 @@ object Dependencies {
7272
val jwtSprayJson = "com.github.jwt-scala" %% "jwt-spray-json" % "9.0.2"
7373
// 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
7474
val springSecurityCore =
75-
"org.springframework.security" % "spring-security-core" % "5.7.2" exclude ("commons-logging", "commons-logging") exclude ("org.springframework", "spring-aop")
75+
"org.springframework.security" % "spring-security-core" % "5.7.3" exclude ("commons-logging", "commons-logging") exclude ("org.springframework", "spring-aop")
7676
val bouncyCastle = "org.bouncycastle" % "bcprov-jdk15to18" % "1.71"
7777

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

100101
// test
101102
val akkaHttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion // Scala 3 incompatible
@@ -127,6 +128,7 @@ object Dependencies {
127128
gatlingTestFramework % Test,
128129
gwtServlet,
129130
icu4j,
131+
jacksonDatabind,
130132
jakartaJSON,
131133
jedis,
132134
jenaText,

‎webapi/src/main/scala/org/knora/webapi/instrumentation/InstrumentationSupport.scala‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
package org.knora.webapi.instrumentation
77

88
import com.typesafe.scalalogging.Logger
9-
import kamon.instrumentation.futures.scala.ScalaFutureInstrumentation.trace
109
import org.slf4j.LoggerFactory
1110

1211
import scala.concurrent.ExecutionContext
1312
import scala.concurrent.Future
1413
import scala.util.Success
14+
import kamon.Kamon
1515

1616
/**
1717
* A set of methods used for measuring stuff that is happening.
@@ -47,10 +47,11 @@ trait InstrumentationSupport {
4747
* have at least something.
4848
*/
4949
val start = System.currentTimeMillis()
50-
trace(name)(future.andThen { case Success(_) =>
51-
metricsLogger.info(s"$name: {} ms", System.currentTimeMillis() - start)
52-
})
53-
// .andThen(case completed => logger.info(s"$name: " + (System.currentTimeMillis() - start) + "ms"))
50+
Kamon.span(name) {
51+
future.andThen { case Success(_) =>
52+
metricsLogger.info(s"$name: {} ms", System.currentTimeMillis() - start)
53+
}
54+
}
5455
}
5556

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

0 commit comments

Comments
 (0)