From 885e35ab9ae7d4a41aa952431b165e3b5e478e82 Mon Sep 17 00:00:00 2001 From: Wojciech Langiewicz Date: Thu, 25 Jan 2024 15:03:28 +0100 Subject: [PATCH 1/4] update readme, link to prometheus-akka-http --- README.md | 6 +++++- build.sbt | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 77b7649..dd239ad 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,11 @@ Collection of utilities to allow exposing prometheus metrics from pekko-http endpoint using the prometheus java client - "com.varwise" %% "prometheus-pekko-http" % "0.6.0" + "com.varwise" %% "prometheus-pekko-http" % "1.0.0" + +### Related projects + +[prometheus-akka-http](https://github.com/varwise/prometheus-akka-http) - same thing but for akka-http ### Publishing diff --git a/build.sbt b/build.sbt index ff9aa9e..dd55ad0 100644 --- a/build.sbt +++ b/build.sbt @@ -25,11 +25,11 @@ libraryDependencies ++= { ("org.apache.pekko" %% "pekko-stream" % pekkoVersion % Provided).cross(CrossVersion.for3Use2_13), ("org.apache.pekko" %% "pekko-http" % pekkoHttpVersion % Provided).cross(CrossVersion.for3Use2_13), ("org.apache.pekko" %% "pekko-http-spray-json" % pekkoHttpVersion % Provided).cross(CrossVersion.for3Use2_13), - "io.prometheus" % "simpleclient" % simpleclientVersion, - "io.prometheus" % "simpleclient_common" % simpleclientVersion, - ("org.apache.pekko" %% "pekko-testkit" % pekkoVersion % Test).cross(CrossVersion.for3Use2_13), - ("org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion % Test).cross(CrossVersion.for3Use2_13), - "org.scalatest" %% "scalatest" % scalaTestVersion % Test + "io.prometheus" % "simpleclient" % simpleclientVersion, + "io.prometheus" % "simpleclient_common" % simpleclientVersion, + ("org.apache.pekko" %% "pekko-testkit" % pekkoVersion % Test).cross(CrossVersion.for3Use2_13), + ("org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion % Test).cross(CrossVersion.for3Use2_13), + "org.scalatest" %% "scalatest" % scalaTestVersion % Test ) } From abec511596f73ea037e9c7d8fcadb6941e51a725 Mon Sep 17 00:00:00 2001 From: Wojciech Langiewicz Date: Thu, 25 Jan 2024 15:05:41 +0100 Subject: [PATCH 2/4] fix github actions --- .github/workflows/scala.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index bd63367..531db6e 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -8,18 +8,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 - - name: Set up Scala - uses: olafurpg/setup-scala@v11 + uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v3 with: - java-version: openjdk@1.14 - - name: Cache sbt - uses: actions/cache@v2 - with: - path: | - ~/.ivy2/cache - ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} + distribution: temurin + java-version: 17.0.8 + cache: sbt - name: Check format run: sbt scalafmtCheckAll - name: Run tests From d59fb26dbc76f5d37695e39a2bb600e1a0633969 Mon Sep 17 00:00:00 2001 From: Wojciech Langiewicz Date: Thu, 25 Jan 2024 15:06:35 +0100 Subject: [PATCH 3/4] udpate setup-java action --- .github/workflows/scala.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index 531db6e..16cff8e 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17.0.8 From 8312eaea423f8ebe2d0deb8f48661f1b10126d19 Mon Sep 17 00:00:00 2001 From: Wojciech Langiewicz Date: Thu, 25 Jan 2024 15:06:58 +0100 Subject: [PATCH 4/4] reformat --- .../http/prometheus/PrometheusResponseTimeRecorderSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/scala/com/varwise/pekko/http/prometheus/PrometheusResponseTimeRecorderSpec.scala b/src/test/scala/com/varwise/pekko/http/prometheus/PrometheusResponseTimeRecorderSpec.scala index c92b25a..d6046ec 100644 --- a/src/test/scala/com/varwise/pekko/http/prometheus/PrometheusResponseTimeRecorderSpec.scala +++ b/src/test/scala/com/varwise/pekko/http/prometheus/PrometheusResponseTimeRecorderSpec.scala @@ -17,7 +17,7 @@ class PrometheusResponseTimeRecorderSpec extends AnyFlatSpec with Matchers { labelNames: List[String], labelValues: List[String], bucket: Double - ): Int = { + ): Int = { val name = metricName + "_bucket" // 'le' should be the first label in the list