Skip to content

v0.5.0-RC2

Pre-release
Pre-release
Compare
Choose a tag to compare
@iRevive iRevive released this 14 Mar 11:26
· 461 commits to main since this release
558763e

We are happy to announce the second candidate for the upcoming 0.5.0 release.
The SDK tracing modules are now publicly available. Check out the documentation.

API improvements

There are several improvements. Kudos to @NthPortal for the dedicated work!

1) Attributes collection

Attributes is a typesafe collection of attributes with handy methods (get, added, concat):

val attributes = Attributes(Attribute("key", "value"), Attribute("frequency", 12.1))
val frequency: Option[Attribute[Double]] = attributes.get[Double]("frequency")
val withAttribute = attributes.added("some.attribute", 123L)

Attributes can be used with Tracer API too:

val attributes = Attributes(Attribute("http.latency", 0.123d), Attribute("user.id", 1L))
Tracer[IO].span("span", attributes)

2) Simplified conversion between OpenTelemetry Java and otel4s Attributes

import io.opentelemetry.api.common.{Attributes => JAttributes}
import org.typelevel.otel4s.Attributes
import org.typelevel.otel4s.oteljava.AttributeConverters._

val asOtel4s: Attributes =
  JAttributes.builder().put("key", "value").build().toScala
  
val asOpenTelemetry: JAttributes =
  Attributes(Attribute("key", "value")).toJava

3) OtelJava.underlying provides access to the JOpenTelemetry

Now you can access the JOpenTelemetry that OtelJava uses under the hood:

OtelJava.autoConfigured[IO]() { otel4s =>
  val openTelemetry: io.opentelemetry.api.OpenTelemetry = otel4s.underlying
  ???
}

What's Changed

Improvements and enhancements

Internal

Upgrades

  • Update cats-effect, cats-effect-kernel, ... to 3.5.4 by @typelevel-steward in #538
  • Update http4s-circe, http4s-ember-client to 0.23.26 by @typelevel-steward in #537
  • Update scala3-library, ... to 3.3.3 by @typelevel-steward in #528
  • Update opentelemetry-api, ... to 1.36.0 by @typelevel-steward in #540
  • flake.lock: Update by @typelevel-steward in #546
  • Update scala-library, scala-reflect to 2.13.13 by @typelevel-steward in #523

Full Changelog: v0.5.0-RC1...v0.5.0-RC2