Modules and module families

otel4s splits its published artifacts into module families so libraries and applications can depend on only the pieces they need.

The main distinction is between:

That split keeps application dependencies explicit and lets library authors instrument code without forcing a specific telemetry backend on their users.

Main entry points

Most users start with one of these module families:

Within this repository, otel4s-oteljava is the main backend. It is JVM-only.

If you need a backend for Scala.js or Scala Native, use the separate otel4s-sdk project. It builds on otel4s-core, but it is published from a different repository.

How the families relate

The published modules in this repository fall into a few groups:

At a high level, the dependency flow looks like this:

graph BT
  otel4s-oteljava --> otel4s-core
  otel4s-semconv --> otel4s-core
  otel4s-instrumentation-metrics --> otel4s-core

Some families are further split by signal. For example, otel4s-core and otel4s-oteljava both have tracing, metrics, and logs variants, plus shared internal modules such as *-common. Most users do not need to think about that structure until they want a smaller dependency surface for one specific signal.

Which module do I need?

Use the smallest module that matches your job:

Use case Start with Why
Library instrumentation for tracing only otel4s-core-trace Depends only on the tracing API
Library instrumentation for metrics only otel4s-core-metrics Depends only on the metrics API
Library instrumentation for logs only otel4s-core-logs Depends only on the logs API
Library instrumentation for multiple signals otel4s-core Aggregates the core signal APIs
JVM application exporting telemetry otel4s-oteljava Main backend in this repo
Scala.js or Scala Native application exporting telemetry otel4s-sdk Cross-platform backend published from the separate otel4s-sdk repo
JVM tests that need to assert exported telemetry otel4s-oteljava-testkit Provides in-memory exporters and expectation APIs

If you are unsure, a useful rule of thumb is:

Some module families are usually added after you have chosen a backend:

Next steps