Skip to content

Releases: typelevel/otel4s

v1.0.1

Choose a tag to compare

@iRevive iRevive released this 19 Jun 15:50
f34c324

Note

This 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-steward[bot] in #1251

Documentation

  • Prepare 1.0 release by @iRevive in #1248
  • docs: add How-to | JVM setup section by @iRevive in #1258
  • docs: add How-to | Metrics section by @iRevive in #1260
  • docs: add How-to | Tracing section by @iRevive in #1259
  • docs: add "Register JVM runtime metrics" how-to section by @iRevive in #1261
  • docs: add "Keep otel4s context in sync with OpenTelemetry Java" by @iRevive in #1264
  • docs: add "Customize histogram buckets" how-to page by @iRevive in #1263
  • docs: add "Root spans and tracing scopes" explanation page by @iRevive in #1267
  • docs: add "Use unmanaged spans when a span must end outside its scope" page by @iRevive in #1268
  • docs: rename and update "Root spans and tracing scopes" by @iRevive in #1269
  • docs: remove stale link by @iRevive in #1274
  • docs: add "Use the otel4s Java agent" how-to page by @iRevive in #1273
  • docs: move "Tracing context propagation" to explanations by @iRevive in #1275
  • docs: restructure and relocate "Modules structure" content by @iRevive in #1278
  • docs: add "Trace Resource and fs2.Stream code" how-to and explanation pages by @iRevive in #1266
  • docs: add "Work with baggage" how-to page by @iRevive in #1270

Dependencies

  • Update scalafmt-core to 3.11.1 by @typelevel-steward[bot] in #1250
  • Update sbt-typelevel, ... to 0.8.6 by @typelevel-steward[bot] in #1254
  • Update auxlib, clib, javalib, nativelib, ... to 0.5.12 by @typelevel-steward[bot] in #1257
  • Update opentelemetry-javaagent to 2.28.1 by @typelevel-steward[bot] in #1256
  • Update opentelemetry-instrumentation-annotations to 2.28.1 by @typelevel-steward[bot] in #1255
  • flake.lock: Update by @typelevel-steward[bot] in #1262
  • Update munit to 1.3.1 by @typelevel-steward[bot] in #1265
  • Update munit to 1.3.2 by @typelevel-steward[bot] in #1271
  • Update opentelemetry-api, ... to 1.63.0 by @typelevel-steward[bot] in #1276
  • Update munit to 1.3.3 by @typelevel-steward[bot] in #1277
  • Update scala3-library, ... to 3.3.8 by @typelevel-steward[bot] in #1280
  • Update cats-mtl, cats-mtl-laws to 1.7.0 by @typelevel-steward[bot] in #1281
  • Update sbt, scripted-plugin to 1.12.12 by @typelevel-steward[bot] in #1282
  • Update opentelemetry-instrumentation-annotations to 2.29.0 by @typelevel-steward[bot] in #1283
  • Update opentelemetry-javaagent to 2.29.0 by @typelevel-steward[bot] in #1284

Uncategorized

  • semconv generator: fix block code template by @iRevive in #1279

Full Changelog: v1.0.0...v1.0.1

v1.0.0

Choose a tag to compare

@iRevive iRevive released this 10 May 11:56
041f8c8

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 for Scala into a broader ecosystem. It now features cross-platform support, production integrations, generated semantic conventions, and a testkit.

Thank you to everyone who helped get otel4s to 1.0: people who contributed code, reviewed pull requests, reported bugs, tested release candidates, improved documentation and examples, and shared feedback from real systems.

This release is the result of a lot of iteration, and that iteration only worked because the project kept getting thoughtful feedback and steady help from various contributors.

What's Changed

Core

Semantic Conventions

OtelJava

  • Add loggerProvider to the OtelJavaTestkit's toString by @iRevive in #1227
  • Remove withInMemory* by @iRevive in #1226
  • oteljava-testkit: Remove custom projection models by @iRevive in #1229
  • docs: explain how to trace fs2.Stream by @iRevive in #1183
  • Replace metric projection models with expectations by @iRevive in #1207
  • common-testkit: add shared utilities by @iRevive in #1231
  • metrics-testkit: use shared utilities by @iRevive in #1232
  • trace-testkit: add expectations for trace components by @iRevive in #1233
  • trace-testkit: add trace and trace forest expectations by @iRevive in #1234
  • logs-testkit: add log record expectations by @iRevive in #1235
  • oteljava-testkit: Bring back deleted models/API and deprecate them by @iRevive in #1237
  • Remove deprecated testkit models and APIs by @iRevive in #1249

Documentation

Dependencies

  • Update munit to 1.3.0 by @typelevel-steward[bot] in #1223
  • Update munit-scalacheck to 1.3.0 by @typelevel-steward[bot] in #1224
  • Update scalafmt-core to 3.11.0 by @typelevel-steward[bot] in #1228
  • Update opentelemetry-javaagent to 2.27.0 by @typelevel-steward[bot] in #1239
  • Update opentelemetry-instrumentation-annotations to 2.27.0 by @typelevel-steward[bot] in #1238
  • flake.lock: Update by @typelevel-steward[bot] in #1241
  • Update pekko-stream to 1.6.0 by @typelevel-steward[bot] in #1244
  • Update sbt, scripted-plugin to 1.12.11 by @typelevel-steward[bot] in #1245
  • Update scodec-bits to 1.2.5 by @typelevel-steward[bot] in #1246
  • Update opentelemetry-api, ... to 1.62.0 by @typelevel-steward[bot] in #1247

Uncategorized

Full Changelog: v0.16.0...v1.0.0

v1.0.0-RC1

Choose a tag to compare

@iRevive iRevive released this 20 Apr 10:21
d603852

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 style that is now the intended path going forward.

Warning

This RC includes source-breaking changes relative to 0.16.x.
Most of them are small API cleanups, but the oteljava testkit migration is worth reading before upgrading.

Key changes

1. The oteljava testkit now has a first-class expectation API

The biggest user-facing change in this cycle is the new expectations-based testkit API for metrics, traces, and logs.

Instead of projecting OpenTelemetry Java models into otel4s-specific Scala data structures and asserting on those,
tests can now work directly with raw OpenTelemetry Java data:

  • io.opentelemetry.sdk.metrics.data.MetricData
  • io.opentelemetry.sdk.trace.data.SpanData
  • io.opentelemetry.sdk.logs.data.LogRecordData

and express assertions with dedicated expectation builders:

  • MetricExpectation, PointExpectation, PointSetExpectation
  • SpanExpectation, TraceExpectation, TraceForestExpectation
  • LogRecordExpectation
  • shared helpers such as AttributesExpectation, InstrumentationScopeExpectation, and TelemetryResourceExpectation

This makes tests more direct and more flexible:

  • partial matching is the default
  • scope/resource/attributes can be asserted independently
  • tests can focus on only the parts of telemetry that matter
  • you can still drop down to raw OpenTelemetry Java models when needed

For example, a metrics assertion can now look like this:

for {
  metrics <- testkit.collectMetrics
} yield {
  MetricExpectations.checkAll(
    metrics,
    List(
      MetricExpectation
        .sum[Long]("service.requests")
        .value(1L, Attribute("route", "/checkout"))
    )
  )
}

And a trace assertion can match the exported trace structure directly:

for {
  spans <- testkit.finishedSpans
} yield {
  val expected =
    TraceForestExpectation.unordered(
      TraceExpectation.unordered(
        SpanExpectation.name("http.request"),
        TraceExpectation.leaf(SpanExpectation.name("db.query"))
      )
    )

  assertEquals(TraceExpectations.check(spans, expected), Right(()))
}

Check out the documentation for more details:

2. The old projection-model testkit API is now compatibility-only

The older mirrored Scala models in oteljava.testkit.metrics.data and the generic
collect*/finishedSpans[A: From*Data] projection methods are no longer the primary testing surface.

They are still available in 1.0.0-RC1, but only as a compatibility layer:

  • MetricsTestkit.collectMetrics[A: FromMetricData] is deprecated
  • LogsTestkit.collectLogs[A: FromLogRecordData] is deprecated
  • TracesTestkit.finishedSpans[A: FromSpanData] is deprecated
  • corresponding projection models are deprecated as well

The recommended path is:

  • collect raw OpenTelemetry Java telemetry
  • assert with expectations

This is the direction the new docs and examples follow.

3. withInMemory* and fromInMemory were intentionally removed

The oteljava testkit builders no longer expose withInMemory* hooks, and the old fromInMemory constructors are
gone as well.

The previous API made it easy to share in-memory exporters/readers between Java and Scala instrumentation, but in
practice it also made it easy to end up with confusing collection behavior, especially around double-collection and
unclear ownership of the in-memory buffers.

For 1.0, the testkit is intentionally simpler:

  • OtelJavaTestkit.inMemory
  • MetricsTestkit.inMemory
  • LogsTestkit.inMemory
  • TracesTestkit.inMemory

all create and own their in-memory collection infrastructure themselves.

That makes the behavior more predictable and avoids the shared-buffer pitfalls from the previous API.

4. liftTo is now the only supported lifting API

This is a small cleanup, but it is visible in user code.

Several deprecated mapK helpers have now been removed in favor of liftTo.

In practice, this is mostly a rename plus alignment with the cats-mtl terminology already introduced in 0.16.0:

  • use LiftValue when lifting plain effects
  • use LiftKind when lifting traced/resource-aware operations

Typical upgrade:

// before
val traced: Tracer[G] = tracer.mapK[G]

// after
val traced: Tracer[G] = tracer.liftTo[G]

Similarly for:

  • Span
  • SpanBuilder
  • SpanOps
  • Tracer
  • TracerBuilder
  • TracerProvider

If you already moved from KindTransformer to LiftValue / LiftKind in 0.16.x, this change should be minor.

5. Deprecated compatibility APIs were removed ahead of 1.0

This release also removes older deprecated surfaces that had already been superseded in earlier releases, including:

  • the old shared org.typelevel.otel4s.meta.InstrumentMeta
  • old deprecated mapK entry points replaced by liftTo
  • old scalafix rewrite rules that no longer matched the current public migration path

The goal here is to make the 1.0 surface smaller and more coherent, rather than carrying multiple generations of the
same abstraction.

What's Changed

Core

OtelJava

  • Add loggerProvider to the OtelJavaTestkit's toString by @iRevive in #1227
  • Remove withInMemory* by @iRevive in #1226
  • oteljava-testkit: Remove custom projection models by @iRevive in #1229
  • docs: explain how to trace fs2.Stream by @iRevive in #1183
  • Replace metric projection models with expectations by @iRevive in #1207
  • common-testkit: add shared utilities by @iRevive in #1231
  • metrics-testkit: use shared utilities by @iRevive in #1232
  • trace-testkit: add expectations for trace components by @iRevive in #1233
  • trace-testkit: add trace and trace forest expectations by @iRevive in #1234
  • logs-testkit: add log record expectations by @iRevive in #1235
  • oteljava-testkit: Bring back deleted models/API and deprecate them by @iRevive in #1237

Documentation

Dependencies

  • Update munit to 1.3.0 by @typelevel-steward[bot] in #1223
  • Update munit-scalacheck to 1.3.0 by @typelevel-steward[bot] in #1224
  • Update scalafmt-core to 3.11.0 by @typelevel-steward[bot] in #1228

Uncategorized

Full Changelog: v0.16.0...v1.0.0-RC1

v0.16.0

Choose a tag to compare

@iRevive iRevive released this 11 Apr 09:01
ff55124

We are happy to announce the 0.16.0 release.

Note

This release brings support for Scala Native 0.5.

Warning

There are several minor binary- and source-breaking changes. In particular, code using KindTransformer should be updated to use cats.mtl.LiftValue or cats.mtl.LiftKind.

Key changes

1. Attribute API ergonomics improvements

Given:

val userIdKey = AttributeKey[String]("user.id")
val planKey   = AttributeKey[String]("plan")

// per-request dynamic attributes
val userId: Option[String] = Some("u-123")
val plan: Option[String]   = None
val extra = Attributes(Attribute("region", "us"), Attribute("env", "prod"))
val base  = Attribute("endpoint", "/checkout")

Previously, creating a span or recording a metric often meant building Attributes manually:

// combined attributes
val attrs: Attributes = {
  val builder = Attributes.newBuilder
  builder.addAll(userIdKey.maybe(userId))
  builder.addAll(planKey.maybe(plan))
  builder.addAll(extra)
  builder.add(base)
  builder.result()
}

// record ops
tracer.span("http.request", attrs)

Now these values can be passed directly:

tracer.span(
  "http.request",
  userIdKey.maybe(userId),
  planKey.maybe(plan),
  extra,
  Attribute("endpoint", "/checkout")
)

This removes the Attributes.newBuilder boilerplate when mixing optional attributes, existing Attributes, and individual Attribute values.

2. KindTransformer replaced with LiftValue / LiftKind

otel4s now uses cats-mtl's LiftValue and LiftKind directly instead of KindTransformer.
The old KindTransformer type alias is still present in 0.16.0, but deprecated:

3. isEnabled is now dynamic for otel-java-backed instruments

otel-java-backed metrics, traces, and logs now calculate isEnabled dynamically by calling the underlying instrument each time,
instead of capturing the value once at construction time.

Calls such as meta.isEnabled now reflect the current state of the underlying OpenTelemetry Java instrument.

4. Logging ergonomics improvements

The logging API also has a couple of small changes:

  • Logger now exposes currentContext
  • logs InstrumentMeta has an overload of isEnabled that extracts the current context automatically

These make it easier for integrations to check whether logging is enabled without having to explicitly specify a context.

5. Scala Native 0.5 support

otel4s now targets Scala Native 0.5.x.

Related changes:

  • dependency alignment with the Scala.js build
  • IORuntimeMetrics availability on Scala Native
  • related build and test layout cleanup for cross-platform modules

Changes

Core

Semantic Conventions

  • semconv-metrics: make AttributeSpec.Impl private by @iRevive in #1200

OtelJava

  • otel-java-logs: properly record a single attribute by @iRevive in #1206
  • oteljava: dynamically calculate whether instrument is enabled by @iRevive in #1222

Documentation

  • docs: replace KindTransformer references with cats.mtl.LiftValue by @iRevive in #1198
  • docs: mention LiftKind instead of LiftValue by @iRevive in #1202

Dependencies

  • Update opentelemetry-javaagent to 2.26.0 by @typelevel-steward[bot] in #1210
  • Update opentelemetry-api, ... to 1.60.1 by @typelevel-steward[bot] in #1192
  • Update munit-scalacheck to 1.2.0 by @typelevel-steward[bot] in #1195
  • Update fs2-core to 3.13.0-M8 by @typelevel-steward[bot] in #1193
  • Update munit to 1.2.4 by @typelevel-steward[bot] in #1194
  • Update vault to 3.7.0 by @typelevel-steward[bot] in #1203
  • Update sbt, scripted-plugin to 1.12.6 by @typelevel-steward[bot] in #1211
  • Update opentelemetry-instrumentation-annotations to 2.26.0 by @typelevel-steward[bot] in #1209
  • Update opentelemetry-javaagent to 2.26.1 by @typelevel-steward[bot] in #1213
  • Update opentelemetry-instrumentation-annotations to 2.26.1 by @typelevel-steward[bot] in #1212
  • Update sbt, scripted-plugin to 1.12.8 by @typelevel-steward[bot] in #1215
  • Update sbt-scalajs, scalajs-compiler, ... to 1.21.0 by @typelevel-steward[bot] in #1218
  • Update opentelemetry-api, ... to 1.61.0 by @typelevel-steward[bot] in #1221
  • Update sbt, scripted-plugin to 1.12.9 by @typelevel-steward[bot] in #1220
  • Update pekko-stream to 1.5.0 by @typelevel-steward[bot] in #1217
  • flake.lock: Update by @typelevel-steward[bot] in #1216
  • Update auxlib, clib, javalib, nativelib, ... to 0.5.11 by @typelevel-steward[bot] in #1219

Uncategorized

Full Changelog: v0.15.2...v0.16.0

v0.16.0-M1

v0.16.0-M1 Pre-release
Pre-release

Choose a tag to compare

@iRevive iRevive released this 12 Mar 06:30
3481a4d

Warning

There are several binary-breaking changes around mapK / liftTo semantics (see #1196).

This is the first release available for Scala Native 0.5.

What's Changed

Core

Semantic Conventions

  • semconv-metrics: make AttributeSpec.Impl private by @iRevive in #1200

Docs

  • docs: mention LiftKind instead of LiftValue by @iRevive in #1202
  • docs: replace KindTransformer references with cats.mtl.LiftValue by @iRevive in #1198

Dependencies

  • Update opentelemetry-api, ... to 1.60.1 by @typelevel-steward[bot] in #1192
  • Update munit-scalacheck to 1.2.0 by @typelevel-steward[bot] in #1195
  • Update fs2-core to 3.13.0-M8 by @typelevel-steward[bot] in #1193
  • Update munit to 1.2.4 by @typelevel-steward[bot] in #1194
  • Update vault to 3.7.0 by @typelevel-steward[bot] in #1203

Full Changelog: v0.15.2...v0.16.0-M1

v0.15.2

Choose a tag to compare

@iRevive iRevive released this 07 Mar 09:36
98619f2

Note

This release is binary compatible with 0.15.0.

Key changes

Semantic Conventions 1.40.0

Semantic conventions are regenerated using version 1.40.0 of the OpenTelemetry semconv specification.

What's Changed

Core

Semantic Conventions

  • Update opentelemetry-semconv to 1.40.0 by @typelevel-steward[bot] in #1182

Documentation

  • Set tlSiteApiPackage to org.typelevel.otel4s in build configuration by @iRevive in #1175

Dependencies

  • Update opentelemetry-api, ... to 1.60.0 by @typelevel-steward[bot] in #1188
  • Update opentelemetry-javaagent to 2.25.0 by @typelevel-steward[bot] in #1179
  • Update scalafmt-core to 3.10.7 by @typelevel-steward[bot] in #1177
  • Update sbt-typelevel, ... to 0.8.5 by @typelevel-steward[bot] in #1184
  • flake.lock: Update by @typelevel-steward[bot] in #1186
  • Update sbt, scripted-plugin to 1.12.5 by @typelevel-steward[bot] in #1187

Uncategorized

Full Changelog: v0.15.1...v0.15.2

v0.15.1

Choose a tag to compare

@iRevive iRevive released this 07 Feb 17:58
e95bf8f

Note

This release is binary compatible with 0.15.0.

Warning

If you use opentelemetry-java 1.59.0, please use otel4s 0.15.1.

Key changes

Support for complex attributes

You can use AnyValue directly with Attribute, allowing nested and structured values:

import org.typelevel.otel4s.AnyValue
import org.typelevel.otel4s.Attribute

val anyValue: AnyValue = AnyValue.map(
  Map(
    "nested-string" -> AnyValue.string("string"), 
    "nested-long" -> AnyValue.long(123L)
  )
)

val attribute = Attribute("anyValueAttribute", anyValue)

This change is mandated by the OpenTelemetry specification.

Semantic Conventions 1.39.0

Semantic conventions are regenerated using version 1.39.0 of the OpenTelemetry semconv specification.

What's Changed

Core

Semantic Conventions

  • Update opentelemetry-semconv to 1.39.0 by @typelevel-steward[bot] in #1170

Documentation

Dependencies

  • Update scalafmt-core to 3.10.5 by @typelevel-steward[bot] in #1169
  • flake.lock: Update by @typelevel-steward[bot] in #1168
  • Update scalafmt-core to 3.10.6 by @typelevel-steward[bot] in #1171

New Contributors

Full Changelog: v0.15.0...v0.15.1

v0.15.0

Choose a tag to compare

@iRevive iRevive released this 21 Jan 18:25
2e0ff10

We are happy to announce the 0.15.0 release.

Note

The otel4s-sdk* modules have been moved to a new repository and now have their own release cycle.

Warning

There are several minor binary- and source-breaking changes. Primarily around BaggageManager and *Testkit builders. Several deprecated methods were also removed.

Key changes

1. SDK modules moved to a separate repository

The otel4s-sdk modules have been moved out of this repository. The primary reason for this is to allow other libraries, such as fs2 and http4s, to use otel4s directly.

2. BaggageManager.noop

BaggageManager now exposes a noop implementation. This is particularly useful in tests when you don't care about baggage propagation.

val baggageManager: BaggageManager[IO] = BaggageManager.noop

3. Span finalizer API updates

SpanFinalizer internal classes are now private, since they were never intended to be public.

There are also new combinators, such as updateName, addEvent, or addLink.

4. Tracer.withCurrentSpanOrNoop

There is a new withCurrentSpanOrNoop convenience method on Tracer to simplify working with optional span context.

Before:

Tracer[IO].currentSpanOrNoop.flatMap(_.addAttribute(Attribute("key", "value")))

After:

Tracer[IO].withCurrentSpanOrNoop(_.addAttribute(Attribute("key", "value")))

5. Attribute.From for semantic convention values

Semantic convention *Value classes now provide Attribute.From instances, making it easier to build attributes from semantic convention values.

Before:

val attribute: Attribute[String] = NetworkTransport(NetworkTransportValue.Tcp.value)

After:

val attribute: Attribute[String] = NetworkTransport(NetworkTransportValue.Tcp)

6. *Testkit builders

Testkit classes now use builders instead of static create/inMemory methods. This makes testkits easier to evolve without expanding the public API surface, and makes configuration more uniform across traces, metrics, and logs.

Old style (deprecated/removed):

TracesTestkit.inMemory[IO](
  customize = (b: io.opentelemetry.sdk.trace.SdkTracerProviderBuilder) => b, /* your edits */
  textMapPropagators = List(/* propagators */)
)

New style:

TracesTestkit
  .builder[IO]
  .addTracerProviderCustomizer(b => b /* your edits */)
  .withTextMapPropagators(List(/* propagators */))
  .build

Or via the new inMemory overload that customizes the builder:

TracesTestkit.inMemory[IO](
  _.addTracerProviderCustomizer(b => b /* your edits */)
   .withTextMapPropagators(List(/* propagators */))
)

This is the same pattern across oteljava LogsTestkit, MetricsTestkit, TracesTestkit, and OtelJavaTestkit: you now customize a Builder[F] via add...Customizer(...) methods, and you set exporters/readers via withInMemory...(...) on the builder rather than passing fromInMemory/exporter style parameters.

What's Changed

Core

  • core-common: add BaggageManager.noop by @iRevive in #1094
  • core-trace: make SpanFinalizer inner classes private, add missing API by @iRevive in #1159
  • core-trace: add withCurrentSpanOrNoop utility to Tracer by @iRevive in #1160
  • Add builders for *Testkit by @iRevive in #1126

Semantic Conventions

  • semconv: add implicit Attribute.From converters for Value classes by @iRevive in #1162

Documentation

  • docs: add documentation for the Logs module by @iRevive in #1119
  • Add mention of fs2-queues otel4s integration by @satabin in #1132
  • docs: add note where SDK modules were moved by @iRevive in #1155
  • docs: add semantic conventions documentation by @iRevive in #1161

Dependencies

  • Update opentelemetry-javaagent to 2.24.0 by @typelevel-steward[bot] in #1157
  • Update opentelemetry-instrumentation-annotations to 2.24.0 by @typelevel-steward[bot] in #1156
  • Update opentelemetry-api, ... to 1.58.0 by @typelevel-steward[bot] in #1151
  • Update scalafmt-core to 3.10.4 by @typelevel-steward[bot] in #1158
  • Update scala-library, scala-reflect to 2.13.18 by @typelevel-steward[bot]in #1137
  • Update scala-library to 2.12.21 by @typelevel-steward[bot] in #1142
  • Update http4s-circe, http4s-dsl, ... to 0.23.33 by @typelevel-steward[bot] in #1127
  • Update pekko-http to 1.3.0 by @typelevel-steward[bot] in #1121
  • Update pekko-stream to 1.4.0 by @typelevel-steward[bot] in #1143
  • Update opentelemetry-proto to 1.9.0-alpha by @typelevel-steward[bot] in #1131
  • Update sbt-typelevel, ... to 0.8.4 by @typelevel-steward[bot] in #1147
  • Update sbt-scalajs, scalajs-compiler, ... to 1.20.2 by @typelevel-steward[bot] in #1152
  • Update sbt-javaagent to 0.2.0 by @typelevel-steward[bot] in #1141
  • flake.lock: Update by @typelevel-steward[bot] in #1149

Uncategorized

New Contributors

Full Changelog: v0.14.0...v0.15.0

v0.14.0

Choose a tag to compare

@iRevive iRevive released this 18 Oct 09:27
68d9103

We are happy to announce the 0.14.0 release.

Warning

While most changes are source-compatible, there are a few breaking changes across multiple modules.
Please review carefully before upgrading.

Key changes

1. Sealed interfaces

We have sealed many of the core interfaces. There are two sides of this decision:

  • Cons: This makes it harder for third-party libraries to extend otel4s directly.
  • Pros: It gives us much more flexibility to evolve the public API safely over time.

This change is especially important as we look ahead to the 1.0 release. The OpenTelemetry specification is still actively evolving, and sealing interfaces allows us
to add new methods without breaking binary compatibility.

We know this is a trade-off. If feedback shows this experiment is not working well, we may unseal some interfaces in the future.

See the reasoning behind this change: #1029.

2. Attributes.Make

We have introduced the Attributes.Make typeclass to make it easier to turn your own domain values into Attributes.

For example:

case class User(id: Long, group: String)

implicit val userAttributesMake: Attributes.Make[User] =
  user => Attributes(Attribute("user.id", user.id), Attribute("user.group", user.group))

// now you can directly create attributes from your User
val attributes: Attributes = Attributes.from(User(1L, "admin"))

// use it naturally in spans:
Tracer[IO].span("find-user", Attributes.from(user))

This is especially useful when you want to consistently record attributes for domain entities such as users, orders, sessions, or request metadata.

3. mapK renamed to liftTo

As preparation for #1001, all mapK methods have been renamed to liftTo.

The change is binary-compatible. Old usages still compile, but you will see a deprecation warning pointing you to the new liftTo method.

This should make migrations smooth.

4. New Logging module

We now provide an experimental logging module:

Note

The logging module is only for bridging logs from other logging frameworks into OpenTelemetry.
It is not a replacement for a full logging API.

Examples:

  • A library such as scribe or log4cats can use the otel4s-logs API to export logs over the OpenTelemetry protocol.
  • OpenTelemetry-Java bindings are provided in otel4s-oteljava-logs.
  • For Scala.js and Scala Native, otel4s-sdk-logs offers a pure Scala implementation.

This closes an important gap in the ecosystem, allowing structured logs to be exported alongside metrics and traces.

Check out the documentation for more details.

5. New AWS EKS resource detector

The detector provides EKS-specific resource attributes when running on AWS EKS.
Check out the documentation for more details.

Kudos to @brbrown25.

6. New otel4s-oteljava-context-storage-testkit module

The opentelemetry-sdk-testing uses SettableContextStorage as a context storage, which is not compatible with the IOLocalContextStorage.

To address this, you can use the IOLocalTestContextStorage in your tests:

import cats.effect.IO
import org.typelevel.otel4s.oteljava.context.LocalContextProvider
import org.typelevel.otel4s.oteljava.testkit.context.IOLocalTestContextStorage

implicit val localContextProvider: LocalContextProvider[IO] = IOLocalTestContextStorage.localProvider[IO]

Check out the documentation for more details.

Kudos to @AlixBa.

7. New fromInMemory builder for *Testkit objects

In some cases, a program can rely on both Java instrumentation and Scala instrumentation.
To make it easier to test such programs, we have added a fromInMemory method to all *Testkit objects.

Check out the documentation for more details.

Kudos to @AlixBa.

Acknowledgements

Big thanks to @NthPortal for thorough reviews and valuable feedback during this cycle. 🙌

What's Changed

Core

SDK

SDK exporter

SDK Contrib AWS

  • feat(AwsEksDetector): Adding in functionality for the AWSEksDetector similar to the java implementation. #783. by @brbrown25 in #1096
  • chore(DockerHelper): switching to Concurrent instead of Async. #783. by @brbrown25 in #1098

Semantic Conventions

OtelJava

  • oteljava: add TracesTestkit#resetSpans by @iRevive in #1028
  • oteljava-logs-test: add LogsTestkit by @iRevive in #1064
  • unwrap IOLocalContextStorage from SettableContextStorageProvider in t… by @AlixBa in #996
  • add fromInMemory on Testkits by @AlixBa in #1081

Build

Documentation

Read more

v0.14.0-RC3

v0.14.0-RC3 Pre-release
Pre-release

Choose a tag to compare

@iRevive iRevive released this 02 Oct 07:49
b380dd0

What's Changed

Core

SDK exporter

Documentation

Dependencies

  • flake.lock: Update by @typelevel-steward[bot] in #1092

Uncategorized

Full Changelog: v0.14.0-RC2...v0.14.0-RC3