Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 1.8
distribution: temurin
java-version: 8
cache: sbt
- name: Run tests
run: sbt test
run: sbt clean coverage test coverageReport
- name: Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ RUN yum update -y && yum install openssl -y
RUN bash aws-certs.sh

WORKDIR /opt/api
COPY sentry.properties .
COPY sentry-opentelemetry-agent.jar .
COPY target/scala-2.13/dpla-api.jar .
EXPOSE 8080
CMD ["java", "-jar", "/opt/api/dpla-api.jar"]
CMD ["java", "-javaagent:sentry-opentelemetry-agent.jar", "-jar", "/opt/api/dpla-api.jar"]
14 changes: 13 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
lazy val akkaHttpVersion = "10.4.0"
lazy val akkaVersion = "2.7.0"

lazy val openTelemetrySpecific = {
val version = "1.45.0"
Seq(
"io.opentelemetry" % "opentelemetry-bom" % version pomOnly(),
"io.opentelemetry" % "opentelemetry-api" % version,
"io.opentelemetry" % "opentelemetry-sdk" % version,
"io.opentelemetry" % "opentelemetry-sdk-extension-autoconfigure" % version,
"io.opentelemetry" % "opentelemetry-exporter-otlp" % version
)
}

lazy val root = (project in file("."))
.configs(IntegrationTest)
.settings(
Expand Down Expand Up @@ -34,7 +45,8 @@ lazy val root = (project in file("."))
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % IntegrationTest,
"com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion % IntegrationTest,
"org.scalatest" %% "scalatest" % "3.2.11" % IntegrationTest
)
) ++ openTelemetrySpecific,

)

ThisBuild / assemblyMergeStrategy := {
Expand Down
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
Binary file added sentry-opentelemetry-agent.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions sentry.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
traces-sample-rate=1.0
enable-tracing=true
2 changes: 1 addition & 1 deletion src/main/scala/dpla/api/Routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Routes(
system.settings.config.getDuration("application.routes.askTimeout")
)

val log: Logger = LoggerFactory.getLogger("dpla.ebookapi.Routes")
val log: Logger = LoggerFactory.getLogger(getClass)

// Requests are send to the appropriate register for processing.

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/dpla/api/RunApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ object RunApp {

Behaviors.empty
}
ActorSystem[Nothing](rootBehavior, "HelloAkkaHttpServer")
ActorSystem[Nothing](rootBehavior, "DPLA API Server")
//#server-bootstrapping
}
}