Skip to content

Commit

Permalink
docker compose fixed (#185)
Browse files Browse the repository at this point in the history
* docker compose fixed

* fmt fixed
  • Loading branch information
biandratti authored Jun 23, 2024
1 parent ac536f5 commit 21c47ce
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions app3/app/TraceApplicationLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ class TraceComponents(context: Context)
}

override def ws: WSClient = wsClient
override def configuration: Configuration = context.initialConfiguration
}
4 changes: 4 additions & 0 deletions app3/app/TraceModule.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import controllers.AppController
import play.api.Configuration
import play.api.libs.ws.WSClient
import play.api.mvc.ControllerComponents
import service.TraceService

import scala.concurrent.ExecutionContext

trait TraceModule {
Expand All @@ -14,4 +16,6 @@ trait TraceModule {
implicit val ec: ExecutionContext = scala.concurrent.ExecutionContext.global
def ws: WSClient
def controllerComponents: ControllerComponents
def configuration: Configuration

}
10 changes: 6 additions & 4 deletions app3/app/service/TraceService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ package service

import models.TraceResponse
import play.api.libs.ws.WSClient
import play.api.{Logging, MarkerContext}
import play.api.{Configuration, Logging, MarkerContext}
import utils.ContextId

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}

class TraceService(ws: WSClient) extends Logging {
class TraceService @Inject() (ws: WSClient, config: Configuration)
extends Logging {

private lazy val api4URL = "http://app4:9004/api/v1/trace"
private lazy val api5URL = "http://app5:9005/api/v1/trace"
private lazy val api4URL = config.get[String]("app4.url")
private lazy val api5URL = config.get[String]("app5.url")

def getTrace(ctxId: String)(implicit
mc: MarkerContext,
Expand Down
11 changes: 11 additions & 0 deletions app3/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ play.application.loader=TraceApplicationLoader
play.http.secret.key="jK/^7eTYZVWn^ItVo9g7l9NlY6SwJL3Qa[eUZEV07OeG=jyvS^MJ>5M@U]k?7rXj"
play.server.http.port = 9003


app4 {
url = "http://localhost:9004/api/v1/trace"
url = ${?APP4_URL}
}

app5 {
url = "http://localhost:9005/api/v1/trace"
url = ${?APP5_URL}
}

play.filters.hosts {
allowed = ["."]
}
2 changes: 2 additions & 0 deletions docker/opentelemetry/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ services:
- OTEL_METRICS_EXPORTER=prometheus
- OTEL_EXPORTER_PROMETHEUS_PORT=9094
- OTEL_EXPORTER_PROMETHEUS_HOST=0.0.0.0
- APP4_URL=http://app4:9004/api/v1/trace
- APP5_URL=http://app5:9005/api/v1/trace
networks:
- tracenet
ports:
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ object Dependencies {
lazy val JavaInstrumentVersion = "2.5.0"

lazy val openTelemetryDependencies = {
val version = "1.39.0"
val version = "1.38.0"
Seq(
"io.opentelemetry" % "opentelemetry-api" % version,
"io.opentelemetry.instrumentation" % "opentelemetry-logback-appender-1.0" % s"$JavaInstrumentVersion-alpha" % "runtime"
Expand Down

0 comments on commit 21c47ce

Please sign in to comment.