diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..9d926716 --- /dev/null +++ b/.gitignore @@ -0,0 +1,49 @@ +*.class +*.log + +# these are moved into the doc project by the build +modules/docs/src/main/tut/changelog.md +modules/docs/src/main/tut/license.md + +# sbt specific +dist/* +target/ +lib_managed/ +src_managed/ +project/boot/ +project/plugins/project/ +project/hydra.sbt + +# Scala-IDE specific +.scala_dependencies +.cache +.classpath +.project +.worksheet/ +bin/ +.settings/ + +# OS X +.DS_Store + +# Ctags +.tags + +# ENSIME +.ensime +.ensime_cache/ + +# IntelliJ +.idea/ + +# Mill +out/ + +# Bloop/Metals +.bloop/ +.metals/ +metals.sbt +.bsp/ + +# VS-Code +.vscode/ \ No newline at end of file diff --git a/backends/datadog.html b/backends/datadog.html index 4feeac1d..9c634b24 100644 --- a/backends/datadog.html +++ b/backends/datadog.html @@ -6,7 +6,7 @@ - + @@ -32,7 +32,7 @@ Natchez
-0.1.5 +0.3.7
@@ -203,7 +205,7 @@

-© 2021 +© 2025

--> @@ -228,7 +230,7 @@

- + diff --git a/backends/opentelemetry.html b/backends/opentelemetry.html new file mode 100644 index 00000000..d45b61e4 --- /dev/null +++ b/backends/opentelemetry.html @@ -0,0 +1,274 @@ + + + + +OpenTelemetry · Natchez + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+ + + +
+
+ + + + + +
+
+

OpenTelemetry

+

The natchez-opentelemetry module provides a backend that uses OpenTelemetry to report spans.

+

To use it, add the following dependency.

sbt
libraryDependencies += "org.tpolecat" % "natchez-opentelemetry-2.13" % "0.3.7"
Maven
<dependencies>
+  <dependency>
+    <groupId>org.tpolecat</groupId>
+    <artifactId>natchez-opentelemetry-2.13</artifactId>
+    <version>0.3.7</version>
+  </dependency>
+</dependencies>
Gradle
dependencies {
+  implementation "org.tpolecat:natchez-opentelemetry-2.13:0.3.7"
+}
+

Then add any exporter, for example:

sbt
libraryDependencies += "io.opentelemetry" % "opentelemetry-exporter-otlp" % "1.12.0"
Maven
<dependencies>
+  <dependency>
+    <groupId>io.opentelemetry</groupId>
+    <artifactId>opentelemetry-exporter-otlp</artifactId>
+    <version>1.12.0</version>
+  </dependency>
+</dependencies>
Gradle
dependencies {
+  implementation "io.opentelemetry:opentelemetry-exporter-otlp:1.12.0"
+}
+

Configuring an OpenTelemetry entrypoint

+

There are two methods you’ll need to construct an OpenTelemetry EndPoint.

+

OpenTelemetry.lift is used to turn an F[_] that constructs a SpanExporter, SpanProcessor or SdkTraceProvider into a Resource that will shut it down cleanly. This takes a String of what you’ve constructed, so we can give a nice error if it fails to shut down cleanly.

+

The OpenTelemetry.entryPoint method takes a boolean called globallyRegister which tells it whether to register this OpenTelemetry globally. This may be helpful if you have other Java dependencies that use the global tracer. It defaults to false.

+

It also takes an OpenTelemetrySdkBuilder => Resource[F, OpenTelemetrySdkBuilder] so that you can configure the Sdk.

+

Here’s an example of configuring one with the otlp exporter with batch span processing:

+ + +
+The source code for this page can be found here. +
+ + + + +
+
+ +
+
+ +
+
+ +
+ +
+ + + + +
+ +
+
+
+ + + + + + + + + + + + + + diff --git a/examples/http4s.html b/examples/http4s.html index 66013501..50911a26 100644 --- a/examples/http4s.html +++ b/examples/http4s.html @@ -6,7 +6,7 @@ - + @@ -32,7 +32,7 @@ Natchez
-0.1.5 +0.3.7
@@ -200,7 +202,7 @@

-© 2021 +© 2025

--> @@ -225,7 +227,7 @@

- + diff --git a/index.html b/index.html index 7dfd3d73..21ec740e 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - + @@ -32,7 +32,7 @@ Natchez
-0.1.5 +0.3.7