Skip to content

Commit

Permalink
Prepare 1.42.0 (#6688)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg authored Sep 6, 2024
1 parent f85a57b commit fbdb906
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 4 deletions.
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,58 @@

## Unreleased

### API

* BREAKING: Stabilize log support for AnyValue bodies. Rename `AnyValue` to `Value`, promote
from `opentelemetry-api-incubator` to `opentelemetry-api`, change package
from `io.opentelemetry.api.incubator.logs` to `io.opentelemetry.api.common`.
([#6591](https://github.com/open-telemetry/opentelemetry-java/pull/6591))
* Noop implementations detect when `opentelemetry-api-incubator` is present and return extended noop
implementations.
([#6617](https://github.com/open-telemetry/opentelemetry-java/pull/6617))%

### SDK

#### Traces

* Added experimental support for SpanProcessor OnEnding callback
([#6367](https://github.com/open-telemetry/opentelemetry-java/pull/6367))
* Remove final modifier from SdkTracer.tracerEnabled
([#6687](https://github.com/open-telemetry/opentelemetry-java/pull/6687))

#### Exporters

* Suppress zipkin exporter instrumentation
([#6552](https://github.com/open-telemetry/opentelemetry-java/pull/6552))
* OTLP exporters return status code exceptions via CompletableResultCode in GrpcExporter and
HttpExporter.
([#6645](https://github.com/open-telemetry/opentelemetry-java/pull/6645))
* Align GrpcSender contract with HttpSender
([#6658](https://github.com/open-telemetry/opentelemetry-java/pull/6658))

#### Extensions

* Add autoconfigure support for ns and us durations
([#6654](https://github.com/open-telemetry/opentelemetry-java/pull/6654))
* Add declarative configuration ComponentProvider support for resources
([#6625](https://github.com/open-telemetry/opentelemetry-java/pull/6625))
* Add declarative configuration ComponentProvider support for processors
([#6623](https://github.com/open-telemetry/opentelemetry-java/pull/6623))
* Add declarative configuration ComponentProvider support for samplers
([#6494](https://github.com/open-telemetry/opentelemetry-java/pull/6494))
* Add declarative configuration ComponentProvider support for propagators
([#6624](https://github.com/open-telemetry/opentelemetry-java/pull/6624))
* Add declarative configuration missing pieces
([#6677](https://github.com/open-telemetry/opentelemetry-java/pull/6677))
* Change jaeger remote sampler autoconfigure property from `pollingInterval` to `pollingIntervalMs`
to match spec.
([#6672](https://github.com/open-telemetry/opentelemetry-java/pull/6672))

#### Testing

* Add asserts for log record body fields
([#6509](https://github.com/open-telemetry/opentelemetry-java/pull/6509))

## Version 1.41.0 (2024-08-09)

### API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Key-value pair of {@link String} key and {@link Value} value.
*
* @see Value#of(KeyValue...)
* @since 1.42.0
*/
public interface KeyValue {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* io.opentelemetry.api.logs.LogRecordBuilder#setBody(Value)}.
*
* @param <T> the type. See {@link #getValue()} for description of types.
* @since 1.42.0
*/
public interface Value<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* AnyValue type options, mirroring <a
* href="https://github.com/open-telemetry/opentelemetry-proto/blob/ac3242b03157295e4ee9e616af53b81517b06559/opentelemetry/proto/common/v1/common.proto#L31">AnyValue#value
* options</a>.
*
* @since 1.42.0
*/
public enum ValueType {
STRING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ public interface LogRecordBuilder {
*/
LogRecordBuilder setBody(String body);

/** Set the body {@link Value}. */
/**
* Set the body {@link Value}.
*
* @since 1.42.0
*/
default LogRecordBuilder setBody(Value<?> body) {
setBody(body.asString());
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ public interface LogRecordData {
@Deprecated
Body getBody();

/** Returns the {@link Value} representation of the log body, of null if unset. */
/**
* Returns the {@link Value} representation of the log body, of null if unset.
*
* @since 1.42.0
*/
@Nullable
@SuppressWarnings("deprecation") // Default impl uses deprecated code for backwards compatibility
default Value<?> getBodyValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ public LogRecordDataAssert hasBody(String body) {
return hasBody(Value.of(body));
}

/** Asserts the log has the given body. */
/**
* Asserts the log has the given body.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBody(@Nullable Value<?> body) {
isNotNull();
if (!Objects.equals(actual.getBodyValue(), body)) {
Expand All @@ -177,6 +181,8 @@ public LogRecordDataAssert hasBody(@Nullable Value<?> body) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and String {@code value}.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBodyField(String key, String value) {
return hasBodyField(key, Value.of(value));
Expand All @@ -185,6 +191,8 @@ public LogRecordDataAssert hasBodyField(String key, String value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and long {@code value}.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBodyField(String key, long value) {
return hasBodyField(key, Value.of(value));
Expand All @@ -193,6 +201,8 @@ public LogRecordDataAssert hasBodyField(String key, long value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and double {@code value}.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBodyField(String key, double value) {
return hasBodyField(key, Value.of(value));
Expand All @@ -201,6 +211,8 @@ public LogRecordDataAssert hasBodyField(String key, double value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and boolean {@code value}.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBodyField(String key, boolean value) {
return hasBodyField(key, Value.of(value));
Expand All @@ -209,6 +221,8 @@ public LogRecordDataAssert hasBodyField(String key, boolean value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and list of String {@code value}s.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBodyField(String key, String... value) {
List<Value<?>> values = new ArrayList<>(value.length);
Expand All @@ -221,6 +235,8 @@ public LogRecordDataAssert hasBodyField(String key, String... value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and list of long {@code value}s.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBodyField(String key, long... value) {
List<Value<?>> values = new ArrayList<>(value.length);
Expand All @@ -233,6 +249,8 @@ public LogRecordDataAssert hasBodyField(String key, long... value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and list of double {@code value}s.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBodyField(String key, double... value) {
List<Value<?>> values = new ArrayList<>(value.length);
Expand All @@ -245,6 +263,8 @@ public LogRecordDataAssert hasBodyField(String key, double... value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and list of boolean {@code value}s.
*
* @since 1.42.0
*/
public LogRecordDataAssert hasBodyField(String key, boolean... value) {
List<Value<?>> values = new ArrayList<>(value.length);
Expand All @@ -257,6 +277,8 @@ public LogRecordDataAssert hasBodyField(String key, boolean... value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given {@code key} and {@code value}.
*
* @since 1.42.0
*/
@SuppressWarnings({"unchecked"})
public LogRecordDataAssert hasBodyField(String key, Value<?> value) {
Expand All @@ -275,6 +297,8 @@ public LogRecordDataAssert hasBodyField(String key, Value<?> value) {
/**
* Asserts the log has a body of type {@link ValueType#KEY_VALUE_LIST}, containing a field with
* the given attribute {@code key} and {@code value}.
*
* @since 1.42.0
*/
@SuppressWarnings({"unchecked"})
public <T> LogRecordDataAssert hasBodyField(AttributeKey<T> key, T value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public io.opentelemetry.sdk.logs.data.Body getBody() {
: io.opentelemetry.sdk.logs.data.Body.string(valueBody.asString());
}

/**
* {@inheritDoc}
*
* @since 1.42.0
*/
@Override
@Nullable
public abstract Value<?> getBodyValue();
Expand Down Expand Up @@ -156,7 +161,11 @@ public Builder setBody(io.opentelemetry.sdk.logs.data.Body body) {
return this;
}

/** Set the body. */
/**
* Set the body.
*
* @since 1.42.0
*/
public abstract Builder setBodyValue(@Nullable Value<?> body);

/** Set the attributes. */
Expand Down

0 comments on commit fbdb906

Please sign in to comment.