[!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.
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.
Big thanks to @NthPortal for thorough reviews and valuable feedback during this cycle. 🙌
What's Changed
Core
logs: add core-logs module by @iRevive in https://github.com/typelevel/otel4s/pull/1013
core-common: add AnyValue by @iRevive in https://github.com/typelevel/otel4s/pull/1009
core-logs: add Severity by @iRevive in https://github.com/typelevel/otel4s/pull/1015
Define hashCode as lazy val by @c0d33ngr in https://github.com/typelevel/otel4s/pull/1019
core-common: add Attributes.Make by @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, and Logger by @iRevive in https://github.com/typelevel/otel4s/pull/1030
Rename most mapK methods to liftTo by @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 LogsProtoEncoder by @iRevive in https://github.com/typelevel/otel4s/pull/1057
Add otel4s-oteljava-logs module 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.Meta by @iRevive in https://github.com/typelevel/otel4s/pull/1084
Refactor InstrumentMeta by @iRevive in https://github.com/typelevel/otel4s/pull/1085
SDK
sdk-logs: add LogRecordData by @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 LogRecordLimits by @iRevive in https://github.com/typelevel/otel4s/pull/1041
sdk-logs: add LogRecordLimitsAutoConfigure by @iRevive in https://github.com/typelevel/otel4s/pull/1058
sdk-logs: add LogRecordExporter by @iRevive in https://github.com/typelevel/otel4s/pull/1056
sdk-logs: add ConsoleLogRecordExporter by @iRevive in https://github.com/typelevel/otel4s/pull/1061
sdk-logs: add LogRecordProcessor by @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 SimpleLogRecordProcessor by @iRevive in https://github.com/typelevel/otel4s/pull/1067
sdk-logs: Add BatchLogRecordProcessor by @iRevive in https://github.com/typelevel/otel4s/pull/1066
sdk-logs: Add SdkLogRecordBuilder by @iRevive in https://github.com/typelevel/otel4s/pull/1069
sdk-logs: Add LogRecordExportersAutoConfigure by @iRevive in https://github.com/typelevel/otel4s/pull/1071
sdk-logs: Add SdkLoggerProvider, SdkLoggerBuilder, and SdkLogger by @iRevive in https://github.com/typelevel/otel4s/pull/1072
sdk-logs-testkit: Add LogsTestkit by @iRevive in https://github.com/typelevel/otel4s/pull/1070
sdk-logs: add BatchLogRecordProcessorAutoConfigure by @iRevive in https://github.com/typelevel/otel4s/pull/1073
sdk-logs: add LoggerProviderAutoConfigurer by @iRevive in https://github.com/typelevel/otel4s/pull/1075
sdk-logs: add SdkLogs by @iRevive in https://github.com/typelevel/otel4s/pull/1076
Add otel4s-sdk-logs module 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 OtlpLogRecordExporter by @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#resetSpans by @iRevive in https://github.com/typelevel/otel4s/pull/1028
oteljava-logs-test: add LogsTestkit by @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