Skip to content

v0.10.0

Latest
Compare
Choose a tag to compare
@iRevive iRevive released this 24 Sep 16:56
· 29 commits to main since this release
9c176c2

We are happy to announce the 0.10.0 release.

Warning

The otel4s-sdk-trace and otel4s-sdk-exporter have several breaking changes and are binary incompatible with the 0.9.x lineage.

Warning

The Histogram#recordDuration has a breaking behavior change. Please see below.

Breaking behavior changes

Histogram#recordDuration no longer adds the cause attribute

The cause attribute was opinionated and didn't align with most semantic conventions.

If you want to preserve the old behavior, please use Histogram.causeAttributes:

histogram
  .recordDuration(TimeUnit.SECONDS, Histogram.causeAttributes(_))
  .surround(fa)

New features

1) Histogram#recordDuration provides a way to build attributes based on the exit case

histogram
  .recordDuration(TimeUnit.SECONDS, {
    case Resource.ExitCase.Succeeded =>
      Nil
    case Resource.ExitCase.Errored(e) =>
      List(Attribute("error.type", e.getClass.getName))
    case Resource.ExitCase.Canceled =>
      List(Attribute("error.type", "canceled"))
  })
  .surround(fa)

2) AttributeKey#maybe

Dealing with optional attributes could be cumbersome. AttriubuteKey#maybe goes along with AttributesBuilder#addAll and Attributes#concat:

val attributeKey: AttributeKey[String] = AttributeKey("key")  
val attributeValue: Option[String] = ???

// builder usage
val builder = Attributes.newBuilder
- attributeValue.foreach(value => builder.addOne(attributeKey, value))
+ builder.addAll(attributeKey.maybe(attributeValue))
val attributes: Attributes = builder.result()

// attributes usage
- attributeValue.fold(attributes)(value => attributes.added(attributeKey, value)) 
+ attributes.concat(attributeKey.maybe(attributeValue))

Kudos to @NthPortal for the idea.

3) New OTLP gRPC exporter for SDK

SDK OTLP exporter now supports all required protocols: grpc, http/protobuf, and http/json.
Check out the configuration details.

4) New otel4s-semconv-metrics and otel4s-semconv-metrics-experimental modules

OpenTelemetry semantic conventions provide well-defined requirements for the metrics.
Hence, we generate a spec that you can use to test the implementation.
There is no documentation yet, but there is a PoC example.

5) New SDK AWS contrib modules

There are three new modules that provide AWS-specific functionality for SDK:

  1. Resource detectors
  2. AWS X-Ray ID Generator (kudos to @bpholt)
  3. AWS X-Ray context propagator

What's Changed

Core

  • core-trace: remove Histogram.DoubleBackend by @iRevive in #760
  • core-trace: use ExitCase to build attributes in Histogram#recordDuration by @iRevive in #761
  • core-common: AttributeKey add maybe method by @iRevive in #780

SDK

  • sdk-common: use semconv-experimental in tests by @iRevive in #748
  • sdk: use Console[F].errorln instead of Console[F].error by @iRevive in #769
  • sdk-exporter: implement gRPC exporter by @iRevive in #756
  • sdk-trace: make Sampler effectful by @iRevive in #782
  • sdk-trace: make SimpleSpanProcessor and BatchSpanProcessor private by @iRevive in #788

Semconv

  • semconv: generate semantic conventions using otel/weaver by @iRevive in #763
  • semconv: use single template to generate attributes by @iRevive in #767
  • semconv: generate metrics specs by @iRevive in #764
  • semconv-metrics: fix package of the experimental metrics by @iRevive in #770
  • semconv-metrics: use a reference to semantic attributes by @iRevive in #771
  • semconv-metrics: deprecate stable metrics in the experimental package by @iRevive in #772
  • semconv-metrics: add MetricSpec, generate tests by @iRevive in #773

SDK contrib AWS

  • sdk-contrib-aws: add docs for AwsXRayIdGenerator by @iRevive in #789
  • sdk-contrib: add aws-xray-propagator module by @iRevive in #749
  • sdk-contrib: add AWSXRayLambdaPropagator module by @iRevive in #759
  • sdk-contrib: add aws-resource module by @iRevive in #747
  • sdk-contrib: add AWSEC2Detector by @iRevive in #775
  • sdk-contrib: add AWSBeanstalkDetector by @iRevive in #774
  • sdk-contrib: add AWSECSDetector by @iRevive in #779
  • sdk-contrib-aws: rename classes - use camel case convention by @iRevive in #785
  • Add AwsXRayIdGenerator by @bpholt in #787

Docs

  • docs: SDK configuration - add ottrace,update SDK overview by @iRevive in #745
  • docs: simplify custom propagator example by @iRevive in #750
  • docs: update Grafana example by @iRevive in #762

Behind the scene

Upgrades

  • Update pekko-stream to 1.1.0 by @typelevel-steward in #754
  • Update sbt-typelevel, ... to 0.7.3 by @typelevel-steward in #757
  • Update opentelemetry-api, ... to 1.42.1 by @typelevel-steward in #768
  • Update http4s-circe, http4s-ember-client to 0.23.28 by @typelevel-steward in #765
  • Update pekko-stream to 1.1.1 by @typelevel-steward in #778
  • Update opentelemetry-instrumentation-annotations to 2.8.0 by @typelevel-steward in #776
  • Update opentelemetry-javaagent to 2.8.0 by @typelevel-steward in #777
  • Update sbt to 1.10.2 by @typelevel-steward in #781

New Contributors

Full Changelog: v0.9.0...v0.10.0