Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg committed Dec 19, 2024
1 parent 414a5e7 commit d11991c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Value;
import io.opentelemetry.api.incubator.logs.ExtendedLogRecordBuilder;
import io.opentelemetry.api.logs.LogRecordBuilder;
import io.opentelemetry.api.logs.Severity;
import io.opentelemetry.context.Context;
import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
Expand Down Expand Up @@ -37,13 +36,13 @@ public ExtendedSdkLogRecordBuilder setTimestamp(Instant instant) {
}

@Override
public LogRecordBuilder setObservedTimestamp(long timestamp, TimeUnit unit) {
public ExtendedSdkLogRecordBuilder setObservedTimestamp(long timestamp, TimeUnit unit) {
super.setObservedTimestamp(timestamp, unit);
return this;
}

@Override
public LogRecordBuilder setObservedTimestamp(Instant instant) {
public ExtendedSdkLogRecordBuilder setObservedTimestamp(Instant instant) {
super.setObservedTimestamp(instant);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import static io.opentelemetry.sdk.trace.internal.TracerConfig.defaultConfig;
import static io.opentelemetry.sdk.trace.internal.TracerConfig.disabled;
import static io.opentelemetry.sdk.trace.internal.TracerConfig.enabled;
import static org.assertj.core.api.Assertions.assertThat;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.incubator.trace.ExtendedTracer;
Expand All @@ -24,7 +25,6 @@
import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor;
import io.opentelemetry.sdk.trace.internal.TracerConfig;
import java.util.stream.Stream;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
Expand Down Expand Up @@ -56,8 +56,8 @@ void disableScopes() throws InterruptedException {
parent.setAttribute("a", "1");
child = tracerB.spanBuilder("child").startSpan();
// tracerB is disabled and should behave the same as noop tracer
Assertions.assertThat(child.getSpanContext()).isEqualTo(parent.getSpanContext());
Assertions.assertThat(child.isRecording()).isFalse();
assertThat(child.getSpanContext()).isEqualTo(parent.getSpanContext());
assertThat(child.isRecording()).isFalse();
try (Scope childScope = child.makeCurrent()) {
child.setAttribute("b", "1");
grandchild = tracerC.spanBuilder("grandchild").startSpan();
Expand All @@ -76,7 +76,7 @@ void disableScopes() throws InterruptedException {

// Only contain tracerA:parent and tracerC:child should be seen
// tracerC:grandchild should list tracerA:parent as its parent
Assertions.assertThat(exporter.getFinishedSpanItems())
assertThat(exporter.getFinishedSpanItems())
.satisfiesExactlyInAnyOrder(
spanData ->
assertThat(spanData)
Expand Down Expand Up @@ -106,7 +106,7 @@ void tracerConfigurator(
TracerConfig expectedTracerConfig) {
TracerConfig tracerConfig = tracerConfigurator.apply(scope);
tracerConfig = tracerConfig == null ? defaultConfig() : tracerConfig;
Assertions.assertThat(tracerConfig).isEqualTo(expectedTracerConfig);
assertThat(tracerConfig).isEqualTo(expectedTracerConfig);
}

private static final InstrumentationScopeInfo scopeCat = InstrumentationScopeInfo.create("cat");
Expand Down

0 comments on commit d11991c

Please sign in to comment.