Back to directory
typelevel avatar

otel4s

An OpenTelemetry library for Scala based on Cats-Effect. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/typelevel/otel4s.git

214

Stars

50

Forks

14

Watchers

Apache-2.0

License

otel4s

Typelevel Organization Project otel4s-core Scala version support

Telemetry meets higher-kinded types

otel4s is an OpenTelemetry implementation for Scala. The design goal is to fully and faithfully implement the OpenTelemetry Specification atop Cats Effect.

Quick start

The Quick start shows how to add the JVM backend and record your first span and counter measurement.

Features

  • Simple and idiomatic metrics and tracing API

    Provides a user-friendly and idiomatic API for telemetry, designed with Typelevel ecosystem best practices. Intuitive interfaces for metrics, tracing, and context propagation.

  • Minimal overhead

    The library utilizes metaprogramming techniques to reduce runtime costs and allocations. Near-zero overhead when telemetry is disabled, ensuring production performance is unaffected when tracing or metrics collection is not required.

  • Modularity

    A modular architecture allows to include only the required components:

    1. Core modules: designed for library instrumentation, offering a lightweight dependency footprint
    2. Selective integration: use only the metrics or tracing functionality without requiring the other
  • Cross-platform

    All modules are available for Scala 2.13 and Scala 3. Core modules are available on all platforms: JVM, Scala.js, and Scala Native.

  • OpenTelemetry Java SDK backend

    The backend utilizes OpenTelemetry Java SDK under the hood, offering production-ready telemetry:

    1. Low memory overhead
    2. Extensive instrumentation ecosystem
    3. Well-tested implementation
  • Pure Scala SDK

    A pure Scala SDK backend is available in the separate otel4s-sdk project for JVM, Scala.js, and Scala Native.

  • Testkit

    A testkit simplifies the validation of telemetry behavior in the applications and libraries:

    1. Framework-agnostic, works with any test framework, such as weaver, munit, scalatest
    2. Ideal for testing of the instrumented applications in end-to-end or unit tests
    3. Included for the OpenTelemetry Java backend in this repo

Status

otel4s 1.0 establishes the compatibility baseline for the modules published from this repository, primarily otel4s-core*, otel4s-oteljava*, and the semantic-convention and instrumentation modules.

Artifacts that remain unstable are explicitly marked, such as *-experimental semantic-convention modules. The pure Scala SDK backend lives in the separate otel4s-sdk project.

Published modules in this repo

Module family JVM Scala Native Scala.js
otel4s-core* ✅ ✅ ✅
otel4s-semconv* ✅ ✅ ✅
otel4s-instrumentation-* ✅ ✅ ✅
otel4s-oteljava* ✅ ❌ ❌

Learn more

See the website.

Releases

We are happy to announce the 1.1.0 release. This release makes metrics and baggage easier to use across effect-transformer stacks by adding liftTo support throughout the synchronous metrics API and Ba...

Jun 19, 2026

Download .zip

NoteThis release is fully binary compatible with 1.0.0.

The semantic conventions were updated to 1.42.0. What's Changed Semantic Conventions

Update opentelemetry-semconv to 1.42.0 by @typelevel-stew...

May 10, 2026

Download .zip

After more than two years of development, otel4s 1.0.0 has finally arrived! 🎉 Over the past two years, otel4s has evolved from an experimental approach to integrating OpenTelemetry in a natural way f...

We are happy to announce the 1.0.0-RC1 release. This release is mainly about tightening the public API ahead of 1.0, expanding the oteljava testkit, and documenting the expectations-based testing styl...

We are happy to announce the 0.16.0 release. NoteThis release brings support for Scala Native 0.5.

WarningThere are several minor binary- and source-breaking changes. In particular, code using KindTr...