Skip to content

Commit

Permalink
Kamon works when running with sbt
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Nov 23, 2023
1 parent 200f80a commit e41645b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
http.port = 9665
redis.uri = "redis://127.0.0.1"

kamon {
enabled = false
environment.service = "lila-fishnet"
metric.tick-interval = 60 seconds
influxdb {
hostname = ""
authentication {
token = "NCnPKbCqXinm46K86lVfIhwXD1_BaJaRaftNeqNWB6-34X2YUMNbZT6DnT3RtJgnFoaY7lyRrO_NGJFAteRP2g=="
}
hostname = "127.0.0.1"
port = 8086
database = "kamon"
percentiles = [50.0, 75.0, 90.0, 95.0, 99.0, 99.9]
Expand Down
1 change: 1 addition & 0 deletions app/src/main/scala/App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ object App extends IOApp.Simple:

def app: Resource[IO, Unit] =
for
_ <- Resource.eval(KamonInitiator.apply.init)
config <- Resource.eval(Config.load)
_ <- Resource.eval(Logger[IO].info(s"Starting lila-fishnet with config: $config"))
res <- AppResources.instance(config.redis)
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/scala/http/Kamon.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package lila.fishnet

import cats.effect.IO
import kamon.Kamon

trait KamonInitiator:
def init: IO[Unit]

object KamonInitiator:
def apply: KamonInitiator = new KamonInitiator:
def init: IO[Unit] = IO(Kamon.init())
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ lazy val app = project
kamonCore,
kamonInflux,
kamonSystemMetrics,
// kamonHttp4s,
log4Cats,
logback,
redis,
Expand Down
33 changes: 0 additions & 33 deletions conf/logback.xml

This file was deleted.

3 changes: 1 addition & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Dependencies {
val http4s = "0.23.23"
val ciris = "3.4.0"
val kamon = "2.5.11"
val kamonHttp4s = "2.6.6"
val kamonHttp4s = "2.6.1"
val chess = "15.6.11"
val munit = "1.0.0-M8"
}
Expand Down Expand Up @@ -39,7 +39,6 @@ object Dependencies {
val kamonCore = "io.kamon" %% "kamon-core" % V.kamon
val kamonInflux = "io.kamon" %% "kamon-influxdb" % V.kamon
val kamonSystemMetrics = "io.kamon" %% "kamon-system-metrics" % V.kamon
val kamonHttp4s = "io.kamon" %% "kamon-http4s" % V.kamonHttp4s

val http4sDsl = http4s("dsl")
val http4sServer = http4s("ember-server")
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.0")
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.19.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("nl.gn0s1s" % "sbt-dotenv" % "3.0.0")
addSbtPlugin("io.kamon" % "sbt-kanela-runner" % "2.0.14")

0 comments on commit e41645b

Please sign in to comment.