OpenTelemetry - java
Notes
no notes yet
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.Kindenum has been moved to the top level, and namedSpanKind. DefaultOpenTelemetryis no longer a public class. If you need the functionality previously provided by this implementation, it can be accessed via new static methods on theOpenTelemetryinterface itself.- The
TraceFlagsinterface has been re-introduced. This is now used, rather than a barebytewherever trace flags is used. In particular,SpanContext.create(),SpanContext.createFromRemoteParent()now require aTraceFlagsinstance, andSpanContext.getTraceFlags()returns aTraceFlagsinstance. - The names of static methods on
TraceFlagshave been normalized to match other similar classes, and now returnTraceFlagsinstead ofbytewhere appropriate. - The
Labelsinterface 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 toSpanContext.getTraceId()SpanContext.getSpanIdAsHexString()has been renamed toSpanContext.getSpanId()BaggageEntry.getEntryMetadata()has been renamed toBaggageEntry.getMetadata()BaggageConsumerhas been removed in favor of a standardjava.util.function.BiConsumer<String, BaggageEntry>TraceFlags.isSampledFromHex(CharSequence src, int srcOffset)has been removed.SpanIdandTraceIdmethods that had aStringparameter now acceptCharSequenceand assume the id starts at the beginning.SpanId.getSize()andTraceId.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 toSpanId.getLength()SpanId.bytesToHex()has been renamed toSpanId.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 toTraceId.getLength()TraceId.bytesToHex()has been renamed toTraceId.fromBytes()StrictContextStoragehas been made private. Use -Dio.opentelemetry.context.enableStrictContext=true` to enable it
📈Enhancements
- The
W3CTraceContextPropagatorclass now directly implements theTextMapPropagatorinterface. - The
OpenTelemetryinterface now has agetDefault()method which will return a completely no-op implementation. - The
OpenTelmmetryinterface now has agetPropagating(ContextPropagators propagators)method which will return an implementation that contains propagators, but is otherwise no-op.
🌟Misc Notes
- The internal
StringUtilsclass has had metrics-related methods removed from it. But, you weren't using internal classes, were you? - The internal
AbstractWeakConcurrentMapclass has been made non-public. See the line above about internal classes.
Extensions
☢️ Breaking Changes
- The
OtTracerPropagatorhas been renamed toOtTracePropagatorin the trace-propagators extension module. AwsXrayPropagatorhas been moved to theopentelemetry-extension-awsartifact
SDK
☢️ Breaking Changes
TraceConfighas been renamed toSpanLimitsand relocated to theio.opentelemetry.sdk.tracingpackage. 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
SpanDatanow directly exposes the underlyingSpanContextinstance.
SDK Extensions
☢️Breaking Changes
- In the
opentelemetry-autoconfiguremodule, three environment variables/system properties have been renamed to match the spec:OTEL_TRACE_EXPORTER/otel.trace.exporterhas been replaced withOTEL_TRACES_EXPORTER/otel.traces.exporterOTEL_TRACE_SAMPLER/otel.trace.samplerhas been replaced withOTEL_TRACES_SAMPLER/otel_traces_samplerOTEL_TRACE_SAMPLER_ARG/otel.trace.sampler.arghas been replaced withOTEL_TRACES_SAMPLER_ARG/otel.traces.sampler.arg
📈Enhancements
- The
opentelemetry-autoconfiguremodule now supports using non-millisecond values for duration & interval configuration options. See the javadoc on theio.opentelemetry.sdk.autoconfigure.ConfigProperties.getDuration(String)method for details on supported formats. - The
opentelemetry-autoconfiguremodule now provides automatic SPI-based parsing of theOTEL_RESOURCE_ATTRIBUTESenv var (and the correspondingotel.resource.attributessystem property). If you include this module on your classpath, it will automatically update theResource.getDefault()instance with that configuration.
Metrics (alpha)
API
- The
Labelsinterface has been moved into the metrics API module and repackaged into theio.opentelemetry.api.metrics.commonpackage.