github open-telemetry/opentelemetry-java v0.16.0
Version 0.16.0 (RC)

latest releases: v1.44.1, v1.44.0, v1.43.0...
3 years ago

0.16.0 is planned to be the final release before 1.0.0. It is a release candidate and reflects our final API, no further breaking changes will be made unless a critical user-facing bug or security issue is found.

This release contains final cleanups of the API - apologies for any needed updates but this is it.

General

Note: In an effort to accelerate our work toward a 1.0.0 release, we have skipped the deprecation phase
on a number of breaking changes. We apologize for the inconvenience this may have caused. We are very
aware that these changes will impact users. If you need assistance in migrating from previous releases,
please open a discussion topic at
https://github.com/opentelemetry/opentelemetry-java/discussions.

☢️ Breaking Changes

  • Methods and classes deprecated in 0.15.0 have been removed.

API

☢️Breaking Changes

  • The Span.Kind enum has been moved to the top level, and named SpanKind.
  • DefaultOpenTelemetry is no longer a public class. If you need the functionality previously provided by this
    implementation, it can be accessed via new static methods on the OpenTelemetry interface itself.
  • The TraceFlags interface has been re-introduced. This is now used, rather than a bare byte wherever
    trace flags is used. In particular, SpanContext.create(), SpanContext.createFromRemoteParent() now require
    a TraceFlags instance, and SpanContext.getTraceFlags() returns a TraceFlags instance.
  • The names of static methods on TraceFlags have been normalized to match other similar classes, and now
    return TraceFlags instead of byte where appropriate.
  • The Labels interface and related classes have been moved into the alpha metrics modules and repackaged.
  • TraceId.copyHexInto(byte[] traceId, char[] dest, int destOffset) has been removed.
  • SpanContext.getTraceIdAsHexString() has been renamed to SpanContext.getTraceId()
  • SpanContext.getSpanIdAsHexString() has been renamed to SpanContext.getSpanId()
  • BaggageEntry.getEntryMetadata() has been renamed to BaggageEntry.getMetadata()
  • BaggageConsumer has been removed in favor of a standard java.util.function.BiConsumer<String, BaggageEntry>
  • TraceFlags.isSampledFromHex(CharSequence src, int srcOffset) has been removed.
  • SpanId and TraceId methods that had a String parameter now accept CharSequence
    and assume the id starts at the beginning.
  • SpanId.getSize() and TraceId.getSize() have been removed.
  • SpanId.bytesFromHex() has been removed.
  • SpanId.asLong(CharSequence) has been removed.
  • SpanId.asBytes(CharSequence) has been removed.
  • SpanId.getHexLength() has been renamed to SpanId.getLength()
  • SpanId.bytesToHex() has been renamed to SpanId.fromBytes()
  • TraceId.bytesFromHex() has been removed.
  • TraceId.traceIdLowBytesAsLong(CharSequence) has been removed.
  • TraceId.traceIdHighBytesAsLong(CharSequence) has been removed.
  • TraceId.asBytes(CharSequence) has been removed.
  • TraceId.getHexLength() has been renamed to TraceId.getLength()
  • TraceId.bytesToHex() has been renamed to TraceId.fromBytes()
  • StrictContextStorage has been made private. Use -Dio.opentelemetry.context.enableStrictContext=true` to enable it

📈Enhancements

  • The W3CTraceContextPropagator class now directly implements the TextMapPropagator interface.
  • The OpenTelemetry interface now has a getDefault() method which will return a completely no-op implementation.
  • The OpenTelmmetry interface now has a getPropagating(ContextPropagators propagators) method which will
    return an implementation that contains propagators, but is otherwise no-op.

🌟Misc Notes

  • The internal StringUtils class has had metrics-related methods removed from it. But, you weren't using
    internal classes, were you?
  • The internal AbstractWeakConcurrentMap class has been made non-public. See the line above about internal classes.

Extensions

☢️ Breaking Changes

  • The OtTracerPropagator has been renamed to OtTracePropagator in the trace-propagators extension module.
  • AwsXrayPropagator has been moved to the opentelemetry-extension-aws artifact

SDK

☢️ Breaking Changes

  • TraceConfig has been renamed to SpanLimits and relocated to the io.opentelemetry.sdk.tracing package.
    All related method names have been renamed to match.
  • SpanData.getTraceState() has been removed. The TraceState is still available via the SpanContext accessor.
  • SpanData.isSampled() has been removed. The isSampled property is still available via the SpanContext accessor.

📈Enhancements

  • SpanData now directly exposes the underlying SpanContext instance.

SDK Extensions

☢️Breaking Changes

  • In the opentelemetry-autoconfigure module, three environment variables/system properties
    have been renamed to match the spec:
    • OTEL_TRACE_EXPORTER/otel.trace.exporter has been replaced with OTEL_TRACES_EXPORTER/otel.traces.exporter
    • OTEL_TRACE_SAMPLER/otel.trace.sampler has been replaced with OTEL_TRACES_SAMPLER/otel_traces_sampler
    • OTEL_TRACE_SAMPLER_ARG/otel.trace.sampler.arg has been replaced with OTEL_TRACES_SAMPLER_ARG/otel.traces.sampler.arg

📈Enhancements

  • The opentelemetry-autoconfigure module now supports using non-millisecond values for duration &
    interval configuration options. See the javadoc on the io.opentelemetry.sdk.autoconfigure.ConfigProperties.getDuration(String)
    method for details on supported formats.
  • The opentelemetry-autoconfigure module now provides automatic SPI-based parsing of the OTEL_RESOURCE_ATTRIBUTES env var
    (and the corresponding otel.resource.attributes system property). If you include this module on your
    classpath, it will automatically update the Resource.getDefault() instance with that configuration.

Metrics (alpha)

API

  • The Labels interface has been moved into the metrics API module and repackaged into the
    io.opentelemetry.api.metrics.common package.

Don't miss a new opentelemetry-java release

NewReleases is sending notifications on new releases.