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: https://github.com/typelevel/otel4s/issues/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 https://github.com/typelevel/otel4s/issues/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 https://github.com/typelevel/otel4s/pull/1013 - core-common: add
AnyValueby @iRevive in https://github.com/typelevel/otel4s/pull/1009 - core-logs: add Severity by @iRevive in https://github.com/typelevel/otel4s/pull/1015
- Define
hashCodeaslazy valby @c0d33ngr in https://github.com/typelevel/otel4s/pull/1019 - core-common: add
Attributes.Makeby @iRevive in https://github.com/typelevel/otel4s/pull/1023 - core-logs: add LogRecordBuilder by @iRevive in https://github.com/typelevel/otel4s/pull/1018
- docs: update scaladoc example by @iRevive in https://github.com/typelevel/otel4s/pull/1034
- core-logs: add
LoggerProvider,LoggerBuilder, andLoggerby @iRevive in https://github.com/typelevel/otel4s/pull/1030 - Rename most
mapKmethods toliftToby @NthPortal in https://github.com/typelevel/otel4s/pull/1002 - Seal public traits by @iRevive in https://github.com/typelevel/otel4s/pull/1037
- sdk-exporter-logs: add
LogsProtoEncoderby @iRevive in https://github.com/typelevel/otel4s/pull/1057 - Add
otel4s-oteljava-logsmodule by @iRevive in https://github.com/typelevel/otel4s/pull/1038 - Wire all logs modules together by @iRevive in https://github.com/typelevel/otel4s/pull/1077
- core-logs: add
Logger.Metaby @iRevive in https://github.com/typelevel/otel4s/pull/1084 - Refactor
InstrumentMetaby @iRevive in https://github.com/typelevel/otel4s/pull/1085
SDK
- sdk-logs: add
LogRecordDataby @iRevive in https://github.com/typelevel/otel4s/pull/1040 - Update opentelemetry-semconv to 1.37.0 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1051
- sdk-logs: add
LogRecordLimitsby @iRevive in https://github.com/typelevel/otel4s/pull/1041 - sdk-logs: add
LogRecordLimitsAutoConfigureby @iRevive in https://github.com/typelevel/otel4s/pull/1058 - sdk-logs: add
LogRecordExporterby @iRevive in https://github.com/typelevel/otel4s/pull/1056 - sdk-logs: add
ConsoleLogRecordExporterby @iRevive in https://github.com/typelevel/otel4s/pull/1061 - sdk-logs: add
LogRecordProcessorby @iRevive in https://github.com/typelevel/otel4s/pull/1055 - sdk-logs: Evaluate multiple processors sequentially by @iRevive in https://github.com/typelevel/otel4s/pull/1068
- sdk-logs: Add
SimpleLogRecordProcessorby @iRevive in https://github.com/typelevel/otel4s/pull/1067 - sdk-logs: Add
BatchLogRecordProcessorby @iRevive in https://github.com/typelevel/otel4s/pull/1066 - sdk-logs: Add
SdkLogRecordBuilderby @iRevive in https://github.com/typelevel/otel4s/pull/1069 - sdk-logs: Add
LogRecordExportersAutoConfigureby @iRevive in https://github.com/typelevel/otel4s/pull/1071 - sdk-logs: Add
SdkLoggerProvider,SdkLoggerBuilder, andSdkLoggerby @iRevive in https://github.com/typelevel/otel4s/pull/1072 - sdk-logs-testkit: Add
LogsTestkitby @iRevive in https://github.com/typelevel/otel4s/pull/1070 - sdk-logs: add
BatchLogRecordProcessorAutoConfigureby @iRevive in https://github.com/typelevel/otel4s/pull/1073 - sdk-logs: add
LoggerProviderAutoConfigurerby @iRevive in https://github.com/typelevel/otel4s/pull/1075 - sdk-logs: add
SdkLogsby @iRevive in https://github.com/typelevel/otel4s/pull/1076 - Add
otel4s-sdk-logsmodule by @iRevive in https://github.com/typelevel/otel4s/pull/1039
SDK exporter
- sdk-exporter: update OTLP exporter docs by @iRevive in https://github.com/typelevel/otel4s/pull/1042
- sdk-exporter-logs: add
OtlpLogRecordExporterby @iRevive in https://github.com/typelevel/otel4s/pull/1063 - Metrics SDK: Ignore empty and annotations unit by @lenguyenthanh in https://github.com/typelevel/otel4s/pull/1089
SDK Contrib AWS
- feat(AwsEksDetector): Adding in functionality for the AWSEksDetector similar to the java implementation. #783. by @brbrown25 in https://github.com/typelevel/otel4s/pull/1096
- chore(DockerHelper): switching to Concurrent instead of Async. #783. by @brbrown25 in https://github.com/typelevel/otel4s/pull/1098
Semantic Conventions
- semconv: fix semconv generation by @iRevive in https://github.com/typelevel/otel4s/pull/1047
OtelJava
- oteljava: add
TracesTestkit#resetSpansby @iRevive in https://github.com/typelevel/otel4s/pull/1028 - oteljava-logs-test: add
LogsTestkitby @iRevive in https://github.com/typelevel/otel4s/pull/1064 - unwrap IOLocalContextStorage from SettableContextStorageProvider in t… by @AlixBa in https://github.com/typelevel/otel4s/pull/996
- add fromInMemory on Testkits by @AlixBa in https://github.com/typelevel/otel4s/pull/1081
Build
- build: do not upload JS and SN artifacts by @iRevive in https://github.com/typelevel/otel4s/pull/1093
- sdk-exporter: try to address flaky tests by @iRevive in https://github.com/typelevel/otel4s/pull/1114
Documentation
- docs: add sttp and tapir to the ecosystem by @iRevive in https://github.com/typelevel/otel4s/pull/1024
- Use Resource.fromAutoCloseable in docs by @mzuehlke in https://github.com/typelevel/otel4s/pull/1033
- docs: add otel4s Java Agent example by @iRevive in https://github.com/typelevel/otel4s/pull/1044
- docs: add logs module configuration details by @iRevive in https://github.com/typelevel/otel4s/pull/1074
- Update exporter property key from 'otlp' to 'otel' by @lenguyenthanh in https://github.com/typelevel/otel4s/pull/1086
- Correct disabled TimerHeapConfig in docs by @lenguyenthanh in https://github.com/typelevel/otel4s/pull/1087
Dependencies
- Update cats-effect, cats-effect-kernel, ... to 3.6.3 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1022
- Update opentelemetry-proto to 1.8.0-alpha by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1054
- Update fs2-core, fs2-io, fs2-scodec to 3.12.2 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1060
- flake.lock: Update by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1092
- Update sbt, scripted-plugin to 1.11.7 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1111
- Update sbt-scalajs, scalajs-compiler, ... to 1.20.1 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1107
- Update http4s-circe, http4s-dsl, ... to 0.23.32 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1106
- Update pekko-stream to 1.2.1 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1105
- Update opentelemetry-javaagent to 2.20.1 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1104
- Update opentelemetry-instrumentation-annotations to 2.20.1 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1103
- Update scala3-library, ... to 3.3.7 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1109
- Update sbt-jmh to 0.4.8 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1113
- Update sbt-typelevel, ... to 0.8.2 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1112
- Update opentelemetry-api, ... to 1.55.0 by @typelevel-steward[bot] in https://github.com/typelevel/otel4s/pull/1115
- Update Otel4sAgentVersion to 0.0.4 by @iRevive in https://github.com/typelevel/otel4s/pull/1082
New Contributors
- @c0d33ngr made their first contribution in https://github.com/typelevel/otel4s/pull/1019
- @brbrown25 made their first contribution in https://github.com/typelevel/otel4s/pull/1096
Full Changelog: https://github.com/typelevel/otel4s/compare/v0.13.1...v0.14.0