Releases: typelevel/otel4s
Release list
v1.0.1
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 setupsection by @iRevive in #1258 - docs: add
How-to | Metricssection by @iRevive in #1260 - docs: add
How-to | Tracingsection 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
Full Changelog: v1.0.0...v1.0.1
v1.0.0
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
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.MetricDataio.opentelemetry.sdk.trace.data.SpanDataio.opentelemetry.sdk.logs.data.LogRecordData
and express assertions with dedicated expectation builders:
MetricExpectation,PointExpectation,PointSetExpectationSpanExpectation,TraceExpectation,TraceForestExpectationLogRecordExpectation- shared helpers such as
AttributesExpectation,InstrumentationScopeExpectation, andTelemetryResourceExpectation
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 deprecatedLogsTestkit.collectLogs[A: FromLogRecordData]is deprecatedTracesTestkit.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.inMemoryMetricsTestkit.inMemoryLogsTestkit.inMemoryTracesTestkit.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
LiftValuewhen lifting plain effects - use
LiftKindwhen 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:
SpanSpanBuilderSpanOpsTracerTracerBuilderTracerProvider
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
mapKentry points replaced byliftTo - 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
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:
Loggernow exposescurrentContext- logs
InstrumentMetahas an overload ofisEnabledthat 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
IORuntimeMetricsavailability on Scala Native- related build and test layout cleanup for cross-platform modules
Changes
Core
- Update Scala Native to 0.5.10 by @iRevive in #1078
- Replace
KindTransformerwithLift{Value,Kind}by @NthPortal in #1196 - core-logs: add overloaded
isEnabledby @iRevive in #1197 - logs: add
currentContextto theLoggerby @iRevive in #1199 - Rename
InstrumentMeta.fromtoInstrumentMeta.dynamicby @iRevive in #1204 - core: improve ergonomics of the attribute API (Scala 3) by @iRevive in #1191
Semantic Conventions
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
KindTransformerreferences withcats.mtl.LiftValueby @iRevive in #1198 - docs: mention
LiftKindinstead ofLiftValueby @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
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
- Update Scala Native to 0.5.10 by @iRevive in #1078
- Replace
KindTransformerwithLift{Value,Kind}by @NthPortal in #1196 - core-logs: add overloaded
isEnabledby @iRevive in #1197 - logs: add
currentContextto theLoggerby @iRevive in #1199
Semantic Conventions
Docs
- docs: mention
LiftKindinstead ofLiftValueby @iRevive in #1202 - docs: replace
KindTransformerreferences withcats.mtl.LiftValueby @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
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
- Add
Span#isRecordingby @iRevive in #1176 - core-trace: TraceFlags - support randomness flag by @iRevive in #1189
- core-logs: add
withExceptionto theLogRecordBuilderby @iRevive in #1190
Semantic Conventions
- Update opentelemetry-semconv to 1.40.0 by @typelevel-steward[bot] in #1182
Documentation
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
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
- Added Dash0 example by @CodingFabian in #1166
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
- @CodingFabian made their first contribution in #1166
Full Changelog: v0.15.0...v0.15.1
v0.15.0
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.noop3. 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 */))
.buildOr 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.noopby @iRevive in #1094 - core-trace: make
SpanFinalizerinner classes private, add missing API by @iRevive in #1159 - core-trace: add
withCurrentSpanOrNooputility toTracerby @iRevive in #1160 - Add builders for
*Testkitby @iRevive in #1126
Semantic Conventions
Documentation
- docs: add documentation for the
Logsmodule by @iRevive in #1119 - Add mention of
fs2-queuesotel4s 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
- Update otel4s-opentelemetry-javaagent version by @iRevive in #1136
- Show Scaladex version badge by @iRevive in #1154
New Contributors
Full Changelog: v0.14.0...v0.15.0
v0.14.0
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:
- Spec: https://opentelemetry.io/docs/specs/otel/logs/
- Modules:
otel4s-logs,otel4s-oteljava-logs,otel4s-sdk-logs,otel4s-sdk-exporter-logs
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-logsoffers 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
- logs: add
core-logsmodule by @iRevive in #1013 - core-common: add
AnyValueby @iRevive in #1009 - core-logs: add Severity by @iRevive in #1015
- Define
hashCodeaslazy valby @c0d33ngr in #1019 - core-common: add
Attributes.Makeby @iRevive in #1023 - core-logs: add LogRecordBuilder by @iRevive in #1018
- docs: update scaladoc example by @iRevive in #1034
- core-logs: add
LoggerProvider,LoggerBuilder, andLoggerby @iRevive in #1030 - Rename most
mapKmethods toliftToby @NthPortal in #1002 - Seal public traits by @iRevive in #1037
- sdk-exporter-logs: add
LogsProtoEncoderby @iRevive in #1057 - Add
otel4s-oteljava-logsmodule by @iRevive in #1038 - Wire all logs modules together by @iRevive in #1077
- core-logs: add
Logger.Metaby @iRevive in #1084 - Refactor
InstrumentMetaby @iRevive in #1085
SDK
- sdk-logs: add
LogRecordDataby @iRevive in #1040 - Update opentelemetry-semconv to 1.37.0 by @typelevel-steward[bot] in #1051
- sdk-logs: add
LogRecordLimitsby @iRevive in #1041 - sdk-logs: add
LogRecordLimitsAutoConfigureby @iRevive in #1058 - sdk-logs: add
LogRecordExporterby @iRevive in #1056 - sdk-logs: add
ConsoleLogRecordExporterby @iRevive in #1061 - sdk-logs: add
LogRecordProcessorby @iRevive in #1055 - sdk-logs: Evaluate multiple processors sequentially by @iRevive in #1068
- sdk-logs: Add
SimpleLogRecordProcessorby @iRevive in #1067 - sdk-logs: Add
BatchLogRecordProcessorby @iRevive in #1066 - sdk-logs: Add
SdkLogRecordBuilderby @iRevive in #1069 - sdk-logs: Add
LogRecordExportersAutoConfigureby @iRevive in #1071 - sdk-logs: Add
SdkLoggerProvider,SdkLoggerBuilder, andSdkLoggerby @iRevive in #1072 - sdk-logs-testkit: Add
LogsTestkitby @iRevive in #1070 - sdk-logs: add
BatchLogRecordProcessorAutoConfigureby @iRevive in #1073 - sdk-logs: add
LoggerProviderAutoConfigurerby @iRevive in #1075 - sdk-logs: add
SdkLogsby @iRevive in #1076 - Add
otel4s-sdk-logsmodule by @iRevive in #1039
SDK exporter
- sdk-exporter: update OTLP exporter docs by @iRevive in #1042
- sdk-exporter-logs: add
OtlpLogRecordExporterby @iRevive in #1063 - Metrics SDK: Ignore empty and annotations unit by @lenguyenthanh in #1089
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#resetSpansby @iRevive in #1028 - oteljava-logs-test: add
LogsTestkitby @iRevive in #1064 - unwrap IOLocalContextStorage from SettableContextStorageProvider in t… by @AlixBa in #996
- add fromInMemory on Testkits by @AlixBa in #1081
Build
- build: do not upload JS and SN artifacts by @iRevive in #1093
- sdk-exporter: try to address flaky tests by @iRevive in #1114
Documentation
- docs: add sttp and tapir to the ecosystem by @iRevive in #1024
- Use Resource.fromAutoCloseable in docs by @mzuehlke in #1033
- docs: add otel4s Java Agent example by @iRevive in #1044
- docs: add logs module configuration details by @iRevive in #1074
- Update exporter property key from 'otlp' to 'otel' by @lenguyenthanh in https://github.com/typelevel/otel4s/p...
v0.14.0-RC3
What's Changed
Core
SDK exporter
- Metrics SDK: Ignore empty and annotations unit by @lenguyenthanh in #1089
Documentation
- Update exporter property key from 'otlp' to 'otel' by @lenguyenthanh in #1086
- Correct disabled TimerHeapConfig in docs by @lenguyenthanh in #1087
Dependencies
- flake.lock: Update by @typelevel-steward[bot] in #1092
Uncategorized
Full Changelog: v0.14.0-RC2...v0.14.0-RC3