OpenTelemetry - CNCF/opentelemetry-java: Release v1.13.0
Name: opentelemetry-java
Owner: OpenTelemetry - CNCF
Release: Version v1.13.0
Released: 2022-04-08
License: Apache-2.0
Release Assets:
Although we originally intended 1.13.0 to be the first stable release of the metrics SDK, we've postponed it out of caution due to a large number of changes in both the metrics SDK specification and the java implementation. This release should be considered a release candidate for the metrics SDK. There are several notable changes mentioned in the Metrics section. Additionally, please note that the Auto-configuration module now enables metric export by default via OTLP, i.e. by default otel.metrics.exporter is set to otlp instead of none.
API
- Fix
TraceStateBuilderreuse bug.
SDK
InstrumentationScopeInforeplacesInstrumentationLibraryInfo. Methods returningInstrumentationLibraryInfoare deprecated.- Add
ResourceBuilder#removeIf(Predicate)method for symmetry withAttributesBuilder.
Traces
- Span events that record exceptions are instances of
ExceptionEventData.
Metrics
- BREAKING: Remove
MetricReaderfactory pattern:MetricReaderinstances, rather thanMetricReaderFacotry, are registered withSdkMeterProviderBuilder. For example:SdkMeterProvider.builder().registerMetricReader(PeriodicMetricReader.builder(exporter).build()).MetricReaderdoes not support custom implementations. Built-in readers include:PeriodicMetricReader,PrometheusHttpServer, and for testing,InMemoryMetricReader.
- BREAKING: Several breaking changes metrics to the
Dataclasses:MetriaDatareturnsInstrumentationScopeInfoinstead ofInstrumentationLibraryInfo.MetricDatafactories classes have been moved internal.- Exemplar data classes have been migrated to interfaces, and deprecated methods have been removed.
- PointData classes have been migrated to interfaces.
ValueAtPercentilehas been converted toValueAtQuantileto reflect specification.- Drop
HistogramPointDatautility methods for finding bucket bounds.
- BREAKING: Move
InstrumentTypeandInstrumentValueTypetoio.opentelemetry.sdk.metricspackage. - BREAKING: Several breaking changes to the
InstrumentSelector/ViewAPIs:InstrumentSelector/Viewand corresponding builders have been moved toio.opentelemetry.sdk.metricspackage.InstrumentSelectormeter selection criteria has been inlined andMeterSelectorhas been removed.InstrumentSelectorcriteria has been reduced to reflect specification. All fields are exact match, except instrument name which accepts wildcard*and?matches.- If
InstrumentSelectorBuilder#build()is called without any selection criteria, an exception will be thrown. Viewbaggage appending attribute processor has been removed. Available for experimental use viaSdkMeterProviderUtil#appendFilteredBaggageAttributes.- Concept of
AttributeProcessorhas been moved internal. - If a View configures an aggregation that is not compatible with the instrument type of a selected instrument, a warning is logged and the View is ignored.
- BREAKING: Remove deprecated
Aggregation#histogram(). UseAggregation#explicitBucketHistogram()instead. - Relax behavior around conflicting instruments. If you register two instruments with the same name but conflicting description, unit, type, or value type, both will be exported and a warning will be logged indicating the metric identity conflict. Previously, the second registered would have produced a noop instrument. Likewise, if two views are registered that produce instruments with conflicting names, or if an instrument conflicts with a registered view's name, both will be exported and a warning will be logged indicating the view conflict.
- BREAKING: Exemplars have been moved to internal. By default, exemplars are enabled with
with_sampled_tracefilter. This can be adjusted via experimental APIs viaSdkMeterProviderUtil#setExemplarFilter. - BREAKING:
MetricExporter#getPreferredTemporality()has been removed and replaced withgetAggregationTemporality(InstrumentType), which allows exporters to dictate the aggregation temporality on a per-instrument basis.MetricExporter#alwaysCumulative(InstrumentType)andMetricExporter#deltaPreferred(Instrument)are provided as utilities representing common configurations. - Callbacks associated with asynchronous instruments with multiple matching views will only be called once per collection, instead of once per view per collection.
PeriodicMetricReaderwill no longer callMetricExporter#exportif no metrics are available.- BREAKING:
SdkMeterProviderBuilder#setMinimumCollectionIntervalhas been removed. Available for experimental use viaSdkMeterProviderUtil#setMinimumCollectionInterval. - Introduce lock ensuring that metric collections occur sequentially.
- Add min and max to
HistogramDataPoint.
Logs
- BREAKING: Deprecated name field has been removed.
Exporter
- Upgrade to OTLP protobuf version 0.16.0.
- Jaeger and Zipkin exporters export
otel.scope.nameandotel.scope.version, in addition tootel.library.nameandotel.library.versionwhich are retained for backwards compatibility. - BREAKING: Remove deprecated
PrometheusCollector. UsePrometheusHttpServerinstead. - Add support for mTLS authentication to OTLP and jaeger exporters.
- Only log once if OTLP gRPC export receives
UNIMPLEMENTED. - Jaeger remote sampler sets appropriate sampling strategy type if not provided in response.
- BREAKING: The
setPreferredTemporalitymethod has been removed fromOtlpGrpcMetricExporterBuilderandOtlpHttpMetricExporterBuilder. UsesetAggregationTemporality(Function<InstrumentType, AggregationTemporality>)instead.
SDK Extensions
- IMPORTANT: Auto-configuration sets
otel.metrics.exportertootlpinstead ofnone, enabling metric export by default. - Auto-configuration added
otel.java.enabled.resource-providersproperty for opting into specific resource providers.
Micrometer shim
- Bring micrometer shim over from
opentelemetry-java-instrumentation. Artifact is available at maven coordinatesio.opentelemetry:opentelemetry-micrometer1-shim:1.13.0-alpha. - Add support for "prometheus mode", enabling better naming when exporting micrometer metrics via prometheus.
Testing
- Add int overload for equalTo attribute assertion.
- Add
SpanDataAssert.hasAttributemethods.
🙇 Thank you
This release was possible thanks to the following contributors who shared their brilliant ideas and awesome pull requests:
@anuraaga @bogdandrutu @breedx-splk @HaloFour @jack-berg @jkamon @jkwatson @jsuereth @kubawach @mateuszrzeszutek @mdii @pokusak @Rocksnake @trask @wallezhang @zeitlinger