Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Natchez to Otel4s #3

Merged
merged 23 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
905a111
Update for Otel4s
ChristopherDavenport Apr 19, 2023
06e96cd
Push work on Map Injection
ChristopherDavenport Apr 26, 2023
85e5dc1
Simplest Propagated Context - not finding client span in vault
ChristopherDavenport May 3, 2023
4c03de9
Use background use thread to push context in out of F
ChristopherDavenport May 3, 2023
0752b72
Use local rather than get
ChristopherDavenport May 3, 2023
e2dc695
Add cede to allow ended to complete
ChristopherDavenport May 3, 2023
4358fc9
Inject rename
ChristopherDavenport May 3, 2023
f0214f0
Add External Helpers and Bypass since we need HttpApp
ChristopherDavenport May 3, 2023
f7b998e
Add doNotTrace
ChristopherDavenport May 3, 2023
46a1991
Only need Ask
rossabaker May 4, 2023
f1db1be
Fully migrate to otel4s
NthPortal Oct 11, 2023
ac99e5d
fixup! Fully migrate to otel4s
NthPortal Oct 13, 2023
0602750
Merge branch 'otel4s-03' into migrate-otel4s/R1
NthPortal Oct 16, 2023
e99b052
Update ClientMiddlewareTests to otel4s
NthPortal Oct 23, 2023
a6d7855
Use built-in exception recording
NthPortal Oct 24, 2023
c9ee267
Drop 2.12 and update CI
NthPortal Oct 26, 2023
4d74b6a
Remove redundant code
NthPortal Nov 15, 2023
033aa45
Update to otel4s release version
NthPortal Nov 16, 2023
79b4a15
Remove commented imports
rossabaker Nov 30, 2023
9337bb2
Switch default build to Scala 2.13
rossabaker Nov 30, 2023
566baf4
Merge branch 'main' into otel4s
NthPortal Dec 5, 2023
9c8de05
Fix otel4s imports
NthPortal Dec 5, 2023
f1d6689
Fix warnings
NthPortal Dec 5, 2023
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
86 changes: 4 additions & 82 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.18, 2.13.12, 3.3.1]
scala: [2.13.12, 3.3.1]
java: [temurin@17]
project: [rootJS, rootJVM, rootNative]
project: [rootJVM]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand Down Expand Up @@ -69,14 +69,6 @@ jobs:
- name: Check that workflows are up to date
run: sbt githubWorkflowCheck

- name: scalaJSLink
if: matrix.project == 'rootJS'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult

- name: nativeLink
if: matrix.project == 'rootNative'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink

- name: Test
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test

Expand All @@ -90,11 +82,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p examples/target target .js/target core/.native/target site/target core/.js/target core/.jvm/target .jvm/target .native/target project/target
run: mkdir -p examples/target target .js/target site/target core/.jvm/target .jvm/target .native/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar examples/target target .js/target core/.native/target site/target core/.js/target core/.jvm/target .jvm/target .native/target project/target
run: tar cf targets.tar examples/target target .js/target site/target core/.jvm/target .jvm/target .native/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand Down Expand Up @@ -146,46 +138,6 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

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

- name: Inflate target directories (2.12.18, rootJS)
run: |
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (2.12.18, rootJVM)
run: |
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (2.12.18, rootNative)
run: |
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (2.13.12, rootJS)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.13.12, rootJVM)
uses: actions/download-artifact@v3
with:
Expand All @@ -196,26 +148,6 @@ jobs:
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (2.13.12, rootNative)
run: |
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (3.3.1, rootJS)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (3.3.1, rootJVM)
uses: actions/download-artifact@v3
with:
Expand All @@ -226,16 +158,6 @@ jobs:
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (3.3.1, rootNative)
run: |
tar xf targets.tar
rm targets.tar

- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
run: echo $PGP_SECRET | base64 -di | gpg --import
Expand Down
52 changes: 29 additions & 23 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ ThisBuild / tlCiReleaseBranches := Seq("main")
// true by default, set to false to publish to s01.oss.sonatype.org
ThisBuild / tlSonatypeUseLegacyHost := true

ThisBuild / crossScalaVersions := Seq("2.12.18", "2.13.12", "3.3.1")
ThisBuild / scalaVersion := "3.3.1"
val scala213 = "2.13.12"
val scala3 = "3.3.1"
ThisBuild / crossScalaVersions := Seq(scala213, scala3)
ThisBuild / scalaVersion := scala213

ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17"))
ThisBuild / tlJdkRelease := Some(8)
Expand All @@ -25,10 +27,13 @@ ThisBuild / testFrameworks += new TestFramework("munit.Framework")

val catsV = "2.10.0"
val catsEffectV = "3.5.2"
val fs2V = "3.7.0"
val http4sV = "0.23.19"
val fiberLocalV = "0.1.2"
val natchezV = "0.3.2"
val catsMtlV = "1.3.1"
val fs2V = "3.9.2"
val http4sV = "0.23.23"

val openTelemetryV = "1.31.0"
val otel4sV = "0.3.0"

val munitCatsEffectV = "2.0.0-M3"

val slf4jV = "1.7.36"
Expand All @@ -38,15 +43,11 @@ val slf4jV = "1.7.36"
lazy val `natchez-http4s-otel` = tlCrossRootProject
.aggregate(core, examples)

lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
lazy val core = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.settings(
name := "natchez-http4s-otel",
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[DirectMissingMethodProblem]("io.chrisdavenport.natchezhttp4sotel.ClientMiddleware.request"),
ProblemFilters.exclude[DirectMissingMethodProblem]("io.chrisdavenport.natchezhttp4sotel.ServerMiddleware.request")
),
name := "http4s-otel4s",

libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsV,
Expand All @@ -55,18 +56,17 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
"co.fs2" %%% "fs2-core" % fs2V,
"co.fs2" %%% "fs2-io" % fs2V,

"org.http4s" %%% "http4s-server" % http4sV,
"org.http4s" %%% "http4s-client" % http4sV,
"org.http4s" %%% "http4s-server" % http4sV,
"org.http4s" %%% "http4s-client" % http4sV,

"io.chrisdavenport" %%% "fiberlocal" % fiberLocalV,
"org.tpolecat" %%% "natchez-core" % natchezV,
"org.typelevel" %%% "otel4s-core-trace" % otel4sV,
"org.typelevel" %%% "otel4s-java" % otel4sV,
"org.typelevel" %%% "cats-mtl" % catsMtlV,


"org.typelevel" %%% "munit-cats-effect" % munitCatsEffectV % Test,
"org.tpolecat" %%% "natchez-testkit" % natchezV % Test,
"io.opentelemetry" % "opentelemetry-sdk-testing" % openTelemetryV % Test,
"org.typelevel" %%% "cats-effect-testkit" % catsEffectV % Test,
"org.typelevel" %%% "munit-cats-effect" % munitCatsEffectV % Test,
)
).jsSettings(
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule)},
)

lazy val examples = project.in(file("examples"))
Expand All @@ -75,12 +75,18 @@ lazy val examples = project.in(file("examples"))
.settings(
scalacOptions -= "-Xfatal-warnings",
libraryDependencies ++= Seq(
"org.tpolecat" %% "natchez-jaeger" % natchezV,
"org.typelevel" %% "otel4s-java" % otel4sV,
"io.opentelemetry" % "opentelemetry-exporter-otlp" % openTelemetryV % Runtime,
"io.opentelemetry" % "opentelemetry-sdk-extension-autoconfigure" % openTelemetryV % Runtime,
"org.http4s" %% "http4s-dsl" % http4sV,
"org.http4s" %% "http4s-ember-server" % http4sV,
"org.http4s" %% "http4s-ember-client" % http4sV,
"org.slf4j" % "slf4j-simple" % slf4jV,
)
),
run / fork := true,
javaOptions += "-Dotel.service.name=jaeger-example",
javaOptions += "-Dotel.metrics.exporter=none",
javaOptions += "-Dotel.java.global-autoconfigure.enabled=true",
)

lazy val site = project.in(file("site"))
Expand Down
Loading