Releases: open-telemetry/opentelemetry-java
Version v1.13.0
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
Version 1.12.0
This release includes many breaking changes to the metrics SDK as we move towards marking its first stable release.
Notably, if you configure metric Views or have written a custom metric exporter, many of the classes and methods will
have been moved or renamed. There are still a few remaining cleanups targeted for the next release after which there
should not be many. Thanks for bearing with us on this.
API
- New methods have been added to
Contextto propagate context for common Java 8 callback types AttributesBuilder.putnow supports vararg versions for lists withAttributeKey- Multiple metric async callbacks can be registered for the same instrument, and callbacks can be removed
SDK
- An issue with Android desugaring of the SDK has been worked around
- EXPERIMENTAL: Support for disabling resource keys with
OTEL_EXPERIMENTAL_RESOURCE_DISABLED_KEYS - Fixed handling of
schemaUrlinResource.toBuilder() - BREAKING: Many changes to
Dataclasses used during export - BREAKING: Many view configuration methods have been removed
Metrics
- APIs deprecated in the previous release have been removed
- DEPRECATION:
PrometheusCollectorfor exporting OpenTelemetry metrics with the prometheus client library has been deprecated - EXPERIMENTAL: File-based configuration of views
- Prometheus exporter now supports JPMS modules
Logs
- DEPRECATION:
LogData.getNamehas been deprecated for removal
Version 1.11.0
General
- Examples moved to opentelemetry-java-docs
SDK
Exporter
- Switch Jaeger remote sampler to use grpc lite
- Deprecate
.setChannel(ManagedChannel)methods on OTLP gRPC exporters - Deprecate
.setChannel(ManagedChannel)methods on Jaeger gRPC exporter - Experimental OTLP retry support now retries on connection timeouts
Metrics
- BREAKING Change: Deprecated
InMemoryMetricExporterandInMemoryMetricReaderhave been removed. Use versions inopentelemetry-sdk-metrics-testinginstead - Deprecate
InstrumentTypevaluesOBSERVABLE_SUMandOBSERVABLE_UP_DOWN_SUMin favor ofOBSERVABLE_COUNTERandOBSERVABLE_UP_DOWN_COUNTER
Logs
- Add ability to configure log attribute limits via
SdkLogEmitterProviderBuilder#setLogLimits(..)
SDK Extensions
- Auto-configuration added options to
AutoConfigurationCustomizerfor customizingSdkTracerProviderBuilder,SdkMeterProviderBuilder,MetricExporter,SdkLogEmitterProviderBuilder, andLogExporter - Auto-configuration added option to skip shutdown hooks
- Auto-configuration adjusted the execution order of tracer and meter provider customization to happen after autoconfiguration
- Auto-configuration adjusted SPI factories to evaluate lazily
- Auto-configuration now uses sets configured
SdkMeterProvideronBatchLogProcessorandBatchSpanProcessor - Auto-configuration deprecated
SdkTracerProviderConfigurerin favor ofAutoConfigurationCustomizer#addTracerProviderCustomizer(..)
Version 1.10.1
Bugfixes
- Fix issue preventing registration of PrometheusCollector with SDK
- Allow retry policy to be set for OkHttpGrpcExporter
Version 1.10.0
(These release notes contain the content of the 1.10 RCs)
With this release, the OpenTelemetry metrics API has been marked stable - you can use it through the usual opentelemetry-api artifact. The SDK is still under development and not yet stable, but we hope this can open the door to instrumentation libraries using the metrics API.
API
- Performance of
GlobalOpenTelemetry.getimproved buildWithCallbackfor asynchronous metrics now return interfaces instead of void. The interfaces are empty but will allow adding functionality in the future- BREAKING CHANGE:
Double/LongMeasurement.observehave been removed, replaced with therecordmethod. - BREAKING CHANGE:
GlobalMeterProviderhas been removed - BREAKING CHANGE:
ObservableMeasurement, an empty interface, has been removed. This type was not previously deprecated but is expected to have no use in apps due to the lack of functionality - The Metrics API has been merged into the
opentelemetry-apiartifact.OpenTelemetry.getMeterProvider()is the new entrypoint - BREAKING CHANGE: Bound metrics instruments have been removed for now to allow more time to bake while still providing a stable metrics API
- A warning is logged now when registering async instruments with the same name. Previously subsequent invocations were just ignored.
GlobalOpenTelemetryextended with helpers for meter creation
SDK
- The semantic conventions have been updated to 1.8.0
- Deprecated methods have been removed from the
opentelemetry-sdk-autoconfigureartifact.
Exporter
- The OkHttp gRPC exporters now support experimental retry
- OkHttp dispatcher threads are now spawned as daemon threads
- The JPMS module name for the logs exporter has been fixed
- Metrics exporters can have temporality configured
- HTTP exporters now support experimental retry
- Jaeger exporter allows setting trusted certificates
- gRPC exporter metric typos corected
Metrics
InMemoryMetricExporterhas been moved to theopentelemetry-sdk-metrics-testingartifact. The current class has been deprecated in this release- Metric instrument usage violations consistently report issues as debug logs
- Some user callbacks have been wrapped to catch exceptions instead of throwing
- MinMaxSumCount/Count aggregation has been removed
- Empty aggregator is renamed to
drop - Cumulative aggregations will not be aggressively dropped every collection cycle
Logs
- A
opentelemetry-sdk-logs-testingmodule has been added SdkLogEmitterProvideris now available throughOpenTelemetrySdk- LogDataBuilder can now take a SpanContext directly
- SdkLogEmitterProvider.get convenience method added
AWS
- HTTP requests now use OkHttp instead of the JDK
OpenCensus Shim
- Shim span attributes are set before the span is created instead of after
- Exceptions are not thrown when activating a null span
SDK Extensions
- BREAKING CHANGE: Deprecated trace incubator types (DelegatingSpanData, SpanDataBuidler) have been removed
- BREAKING CHANGE: Deprecated
ExecutorServiceSpanProcessorhas been removed cloud.platformis now populated in AWSResource- Auto-configuration correctly uses configured class loader for configuring Resource
- Auto-configuration prints a debug log with the resolved tracer configuration
- Auto-configuration supports the logs signal
Version 1.10.0 RC2
This release continues preparation for the stable release of the metrics API. APIs deprecated in RC1 have been removed. It is expected for 1.10.0 to release with the same API as this release.
API
- Performance of
GlobalOpenTelemetry.getimproved buildWithCallbackfor asynchronous metrics now return interfaces instead of void. The interfaces are empty but will allow adding functionality in the future- BREAKING CHANGE:
Double/LongMeasurement.observehave been removed - BREAKING CHANGE:
GlobalMeterProviderhas been removed - BREAKING CHANGE:
ObservableMeasurement, an empty interface, has been removed. This type was not previously deprecated but is expected to have no use in apps due to the lack of functionality
SDK
- HTTP exporters now support experimental retry
- Deprecated methods have been removed from the
opentelemetry-sdk-autoconfigureartifact.
Metrics
InMemoryMetricExporterhas been moved to theopentelemetry-sdk-metrics-testingartifact. The current class has been deprecated in this release- Metric instrument usage violations consistently report issues as debug logs
Logs
- A
opentelemetry-sdk-logs-testingmodule has been added SdkLogEmitterProvideris now available throughOpenTelemetrySdk
AWS
- HTTP requests now use OkHttp instead of the JDK
OpenCensus Shim
- Shim span attributes are set before the span is created instead of after
- Exceptions are not thrown when activating a null span
Full Changelog: v1.10.0-rc.1...v1.10.0-rc.2
Version 1.10.0 RC1
OpenTelemetry SDK 1.10 will be the first release where the metrics API is considered stable. The Metrics SDK continues to be in development and will be alpha.
We plan to release this RC1 with redundant metrics APIs deprecated, RC2 with them removed, and 1.10.0 the same as RC2 barring unforeseen issues.
API
- The Metrics API has been merged into the
opentelemetry-apiartifact.OpenTelemetry.getMeterProvider()is the new entrypoint - BREAKING CHANGE: Bound metrics instruments have been removed for now to allow more time to bake while still providing a stable metrics API
Double/LongMeasurement.observehas been renamed torecord.observeis deprecated in this releaseGlobalMeterProviderhas been deprecated.GlobalOpenTelemetry.getMeterProvidershould be used instead
SDK
- The semantic conventions have been updated to 1.8.0
Exporter
- The OkHttp gRPC exporters now support experimental retry
- OkHttp dispatcher threads are now spawned as daemon threads
- The JPMS module name for the logs exporter has been fixed
- Metrics exporters can have temporality configured
Metrics (Alpha)
- Some user callbacks have been wrapped to catch exceptions instead of throwing
- MinMaxSumCount/Count aggregation has been removed
- Empty aggregator is renamed to
drop - Cumulative aggregations will not be aggressively dropped every collection cycle
Logs (Alpha)
- LogDataBuilder can now take a SpanContext directly
- SdkLogEmitterProvider.get convenience method added
SDK Extensions
- BREAKING CHANGE: Deprecated trace incubator types (DelegatingSpanData, SpanDataBuidler) have been removed
- BREAKING CHANGE: Deprecated
ExecutorServiceSpanProcessorhas been removed cloud.platformis now populated in AWSResource
New Contributors
- @svalaskevicius made their first contribution in #3921
- @elevenzhan made their first contribution in #3951
Full Changelog: v1.9.0...v1.10.0-rc.1
Version 1.9.1
Bugfixes
- In Prometheus exporter, only populate exemplars for Prometheus types that support them
- Fix proto encoding of oneof values in metrics
- Correctly cleanup OkHttp client resources when shutting down exporters
Version 1.9.0
Note that due to an issue in publishing of Java artifacts, the 1.8.0 version has been skipped. The version before this one is 1.7.1.
General
- IMPORTANT: The deprecated
io.opentelemetry:opentelemetry-protomodule was removed. Java bindings for OTLP protobufs are now published via opentelemetry-proto-java, and available at maven coordinatesio.opentelemetry.proto:opentelemetry-proto.
API
- New
AttributesBuilder#remove(String)andAttributeBuilder#removeIf(Predicate<AttributeKey<?>>)methods improve ergonomics of modifying attributes. W3CBaggagePropagatornow encodes baggage values in URL encoded UTF-8 format, per the W3C Baggage Specification.
SDK
DelegatingSpanDatahas been promoted from incubation and is now available in the Trace SDK. TheDelegatingSpanDataclass in theio.opentelemetry:opentelemetry-sdk-extension-tracing-incubatormodule is now deprecated.
Exporters
- The prometheus metric exporter now includes the
time_unix_nanorepresenting the epoch timestamp when collection occurred. - The OTLP
grpcexporters (OtlpGrpcSpanExporter,OtlpGrpcLogExporter, andOtlpGrpcMetricExporter) now include a default client implementation (okhttp). If agrpcimplementation is detected on the classpath it will be used, but the exporters now work "out of the box" with no additional dependencies.
SDK Extensions
- IMPORTANT: The deprecated
io.opentelemetry:opentelemetry-sdk-extension-async-processormodule was removed. This module is now published via opentelemetry-java-contrib, and available at maven coordinatesio.opentelemetry.contrib:opentelemetry-disruptor-processor. - The
ExecutorServiceSpanProcessorfrom theio.opentelemetry:opentelemetry-sdk-extension-tracing-incubatormodule is now deprecated.
Logging (alpha)
- This release includes a rework of the Log SDK to implement OTEP-0150 and to have more symmetry to the Trace SDK.
LogSinkis nowLogEmitter.LogEmitterinstances are obtained fromSdkLogEmitterProvider. Other additions includeMultiLogProcessor(accessed viaLogProcessor#composite(...)),SimpleLogProcessor,InMemoryLogExporter,OtlpJsonLoggingLogExporter, andSystemOutLogExporter. - The Log SDK maven coordinates have changed from
io.opentelemetry:opentelemetry-sdk-extension-loggingtoio.opentelemetry:opentelemetry-sdk-logs.
Metrics (alpha)
- The
new InMemoryMetricReader()constructor has been deprecated. UseInMemoryMetricReader.create()instead. - A typo in
Aggregation.explictBucketHistogram()has been fixed, and is now accessible atAggregation.explicitBucketHistogram(). - The
PeriodicMetricReader#builder(MetricExporter)builder replacesPeriodicMetricReader#newMetricReaderFactory(MetricExporter, Duration). - Aggregation temporality is now influenced by metric exporters, and the ability to configure aggregation temporality via the view API has been removed. For example, the OTLP metric exporters support both
DELTAandCUMULATIVEtemporality.CUMULATIVEis the default preferred, but this can be changed either via programmatic configuration or
viaOTEL_EXPORTER_OTLP_METRICS_TEMPORALITYif using autoconfigure. - The
MeterProvider#get(String instrumentationName, String instrumentationVersion, String schemaUrl)method is deprecated. UseMeterProvider#meterBuilder(String instrumentationName)with corresponding builder setters instead. - Metric cardinality defenses have been added. Each instrument view now can have at most 2000 distinct metric streams per collection cycle. Recordings for additional streams are dropped with a diagnostic log message. Additionally, cumulative metric streams (both for synchronous and asynchronous instruments) are aggressively forgotten each time a metric export occurs that does not include recordings for a particular stream. The net effect is that there is now a cap on metric memory consumption.
Auto-configuration (alpha)
- BREAKING CHANGE: Remove deprecated
otel.experimental.exporter.otlp.protocol,otel.experimental.exporter.otlp.{signal}.protocolproperties. Please useotel.exporter.otlp.protocol,otel.exporter.otlp.{signal}.protocolinstead. - The autoconfigure module has introduced a powerful new
AutoConfiguredOpenTelemetrySdkBuilder, and SPI for programmatically configuring the builder withAutoConfigurationCustomizerProvider. This provides improved ergonomics and control around autoconfigure customization. - Added experimental support for enabling OTLP retry support for the
grpcexporters. If enabled viaotel.experimental.exporter.otlp.retry.enabled, a default retry policy will be used. - The metric export interval of
PeriodicMetricReaderis now configured viaotel.metric.export.interval. The existingotel.imr.export.intervalproperty has been deprecated. - The SPI classloader can now be specified when using the autoconfigure module programmatically.
Version 1.7.1
Version 1.7.1 (2021-11-03):
Exporters:
- BUGFIX: In 1.7.0, the
okhttp-based exporters (OtlpHttpSpanExporter,OtlpHttpMetricExporter,OtlpHttpLogExporter)
did not properly close the okhttp response and hence would leak connections. This has been fixed in
1.7.1.