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
TraceStateBuilder
reuse bug.
SDK
InstrumentationScopeInfo
replacesInstrumentationLibraryInfo
. Methods returningInstrumentationLibraryInfo
are deprecated.- Add
ResourceBuilder#removeIf(Predicate)
method for symmetry withAttributesBuilder
.
Traces
- Span events that record exceptions are instances of
ExceptionEventData
.
Metrics
- BREAKING: Remove
MetricReader
factory pattern:MetricReader
instances, rather thanMetricReaderFacotry
, are registered withSdkMeterProviderBuilder
. For example:SdkMeterProvider.builder().registerMetricReader(PeriodicMetricReader.builder(exporter).build())
.MetricReader
does not support custom implementations. Built-in readers include:PeriodicMetricReader
,PrometheusHttpServer
, and for testing,InMemoryMetricReader
.
- BREAKING: Several breaking changes metrics to the
Data
classes:MetriaData
returnsInstrumentationScopeInfo
instead ofInstrumentationLibraryInfo
.MetricData
factories 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.
ValueAtPercentile
has been converted toValueAtQuantile
to reflect specification.- Drop
HistogramPointData
utility methods for finding bucket bounds.
- BREAKING: Move
InstrumentType
andInstrumentValueType
toio.opentelemetry.sdk.metrics
package. - BREAKING: Several breaking changes to the
InstrumentSelector
/View
APIs:InstrumentSelector
/View
and corresponding builders have been moved toio.opentelemetry.sdk.metrics
package.InstrumentSelector
meter selection criteria has been inlined andMeterSelector
has been removed.InstrumentSelector
criteria 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. View
baggage appending attribute processor has been removed. Available for experimental use viaSdkMeterProviderUtil#appendFilteredBaggageAttributes
.- Concept of
AttributeProcessor
has 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_trace
filter. 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.
PeriodicMetricReader
will no longer callMetricExporter#export
if no metrics are available.- BREAKING:
SdkMeterProviderBuilder#setMinimumCollectionInterval
has 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.name
andotel.scope.version
, in addition tootel.library.name
andotel.library.version
which are retained for backwards compatibility. - BREAKING: Remove deprecated
PrometheusCollector
. UsePrometheusHttpServer
instead. - 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
setPreferredTemporality
method has been removed fromOtlpGrpcMetricExporterBuilder
andOtlpHttpMetricExporterBuilder
. UsesetAggregationTemporality(Function<InstrumentType, AggregationTemporality>)
instead.
SDK Extensions
- IMPORTANT: Auto-configuration sets
otel.metrics.exporter
tootlp
instead ofnone
, enabling metric export by default. - Auto-configuration added
otel.java.enabled.resource-providers
property 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.hasAttribute
methods.
🙇 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