Skip to content

Commit

Permalink
Merge branch 'series/0.24' into update/series/0.24/http4s-core-0.23.27
Browse files Browse the repository at this point in the history
  • Loading branch information
rossabaker authored May 29, 2024
2 parents 5d0f1e2 + 8a72161 commit b57a652
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 23 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
path: targets.tar
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
run: sbt +update

- name: Download target directories (2.12)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12

Expand All @@ -193,7 +193,7 @@ jobs:
rm targets.tar
- name: Download target directories (2.13)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13

Expand All @@ -203,7 +203,7 @@ jobs:
rm targets.tar
- name: Download target directories (3)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3

Expand Down Expand Up @@ -352,7 +352,7 @@ jobs:

- name: Publish site
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3.9.3
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/target/docs/site
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ ThisBuild / developers := List(
tlGitHubDev("rossabaker", "Ross A. Baker")
)

val Scala213 = "2.13.12"
val Scala213 = "2.13.14"
ThisBuild / crossScalaVersions := Seq("2.12.19", Scala213, "3.3.3")
ThisBuild / scalaVersion := Scala213
ThisBuild / startYear := Some(2018)

lazy val root = project.in(file(".")).aggregate(prometheusMetrics).enablePlugins(NoPublishPlugin)

Expand All @@ -19,7 +20,6 @@ lazy val prometheusMetrics = project
.settings(
name := "http4s-prometheus-metrics",
description := "Support for Prometheus Metrics",
startYear := Some(2018),
libraryDependencies ++= Seq(
"org.http4s" %%% "http4s-core" % http4sVersion,
"io.prometheus" % "simpleclient" % prometheusVersion,
Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ val meteredRouter: Resource[IO, HttpRoutes[IO]] =
} yield router
```

### Example Project
Refer to [this example project](https://github.com/martinprobson/http4s_prometheus_example) that publishes the default server metrics and exposes them on a sample Grafana dashboard.

## Client example

```scala mdoc:reset:silent
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.16.2")
addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.17.1")
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package org.http4s.metrics.prometheus
import cats.data.NonEmptyList
import cats.effect.Resource
import cats.effect.Sync
import cats.syntax.all.*
import io.prometheus.client.*
import cats.syntax.all._
import io.prometheus.client._
import org.http4s.Method
import org.http4s.Status
import org.http4s.metrics.MetricsOps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.http4s.metrics.prometheus

import cats.effect.*
import cats.effect._
import io.prometheus.client.CollectorRegistry
import munit.CatsEffectSuite
import org.http4s.HttpApp
Expand All @@ -25,9 +25,9 @@ import org.http4s.Status
import org.http4s.client.Client
import org.http4s.client.UnexpectedStatus
import org.http4s.client.middleware.Metrics
import org.http4s.dsl.io.*
import org.http4s.metrics.prometheus.util.*
import org.http4s.syntax.literals.*
import org.http4s.dsl.io._
import org.http4s.metrics.prometheus.util._
import org.http4s.syntax.literals._

import java.io.IOException
import java.util.concurrent.TimeoutException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

package org.http4s.metrics.prometheus

import cats.effect.*
import cats.effect._
import io.prometheus.client.CollectorRegistry
import io.prometheus.client.exemplars.Exemplar
import munit.CatsEffectSuite
import org.http4s.HttpApp
import org.http4s.client.Client
import org.http4s.client.middleware.Metrics
import org.http4s.metrics.prometheus.Prometheus.DefaultHistogramBuckets
import org.http4s.metrics.prometheus.util.*
import org.http4s.metrics.prometheus.util._

class PrometheusExemplarsCustomLabelsSuite extends CatsEffectSuite {
val client: Client[IO] = Client.fromHttpApp[IO](HttpApp[IO](stub))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

package org.http4s.metrics.prometheus

import cats.effect.*
import cats.effect._
import io.prometheus.client.CollectorRegistry
import io.prometheus.client.exemplars.Exemplar
import munit.CatsEffectSuite
import org.http4s.HttpApp
import org.http4s.client.Client
import org.http4s.client.middleware.Metrics
import org.http4s.metrics.prometheus.util.*
import org.http4s.metrics.prometheus.util._

class PrometheusExemplarsSuite extends CatsEffectSuite {
val client: Client[IO] = Client.fromHttpApp[IO](HttpApp[IO](stub))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@

package org.http4s.metrics.prometheus

import cats.effect.*
import cats.effect._
import io.prometheus.client.CollectorRegistry
import munit.CatsEffectSuite
import org.http4s.HttpApp
import org.http4s.HttpRoutes
import org.http4s.Method.GET
import org.http4s.Request
import org.http4s.Status
import org.http4s.dsl.io.*
import org.http4s.metrics.prometheus.util.*
import org.http4s.dsl.io._
import org.http4s.metrics.prometheus.util._
import org.http4s.server.middleware.Metrics
import org.http4s.syntax.all.*
import org.http4s.syntax.all._

class PrometheusServerMetricsCustomLabelsSuite extends CatsEffectSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import io.prometheus.client.CollectorRegistry
import org.http4s.Method.GET
import org.http4s.Request
import org.http4s.Response
import org.http4s.dsl.io.*
import org.http4s.dsl.io._

import java.io.IOException
import java.util.concurrent.TimeUnit
Expand Down

0 comments on commit b57a652

Please sign in to comment.