parent
d017d5f18a
commit
e6e2190f68
|
@ -74,7 +74,10 @@ class MessagingAttributesExtractorTest {
|
||||||
entry(SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, 10L));
|
entry(SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, 10L));
|
||||||
expectedEntries.add(entry(SemanticAttributes.MESSAGING_OPERATION, operation.operationName()));
|
expectedEntries.add(entry(SemanticAttributes.MESSAGING_OPERATION, operation.operationName()));
|
||||||
|
|
||||||
assertThat(startAttributes.build()).containsOnly(expectedEntries.toArray(new MapEntry[0]));
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
|
MapEntry<? extends AttributeKey<?>, ?>[] expectedEntriesArr =
|
||||||
|
expectedEntries.toArray(new MapEntry[0]);
|
||||||
|
assertThat(startAttributes.build()).containsOnly(expectedEntriesArr);
|
||||||
|
|
||||||
assertThat(endAttributes.build())
|
assertThat(endAttributes.build())
|
||||||
.containsOnly(entry(SemanticAttributes.MESSAGING_MESSAGE_ID, "42"));
|
.containsOnly(entry(SemanticAttributes.MESSAGING_MESSAGE_ID, "42"));
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class AkkaAsyncChild extends ForkJoinTask implements Runnable, Callable {
|
public class AkkaAsyncChild extends ForkJoinTask<Object> implements Runnable, Callable<Object> {
|
||||||
private static final Tracer tracer = GlobalOpenTelemetry.getTracer("test");
|
private static final Tracer tracer = GlobalOpenTelemetry.getTracer("test");
|
||||||
|
|
||||||
private final AtomicBoolean blockThread;
|
private final AtomicBoolean blockThread;
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
class TracingRequestHandlerTest {
|
class TracingRequestHandlerTest {
|
||||||
|
|
||||||
private static Response<SendMessageResult> response(Request request) {
|
private static Response<SendMessageResult> response(Request<?> request) {
|
||||||
return new Response<>(new SendMessageResult(), new HttpResponse(request, new HttpGet()));
|
return new Response<>(new SendMessageResult(), new HttpResponse(request, new HttpGet()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class FieldMapperTest {
|
||||||
MethodHandleFactory methodHandleFactory = new MethodHandleFactory();
|
MethodHandleFactory methodHandleFactory = new MethodHandleFactory();
|
||||||
Serializer serializer = mock(Serializer.class);
|
Serializer serializer = mock(Serializer.class);
|
||||||
FieldMapper underTest = new FieldMapper(serializer, methodHandleFactory);
|
FieldMapper underTest = new FieldMapper(serializer, methodHandleFactory);
|
||||||
Map<String, Collection<WriteRequest>> items = new HashMap();
|
Map<String, Collection<WriteRequest>> items = new HashMap<>();
|
||||||
BatchWriteItemRequest sdkRequest = BatchWriteItemRequest.builder().requestItems(items).build();
|
BatchWriteItemRequest sdkRequest = BatchWriteItemRequest.builder().requestItems(items).build();
|
||||||
given(serializer.serialize(items)).willReturn("firstTable,secondTable");
|
given(serializer.serialize(items)).willReturn("firstTable,secondTable");
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class FieldMapperTest {
|
||||||
MethodHandleFactory methodHandleFactory = new MethodHandleFactory();
|
MethodHandleFactory methodHandleFactory = new MethodHandleFactory();
|
||||||
Serializer serializer = mock(Serializer.class);
|
Serializer serializer = mock(Serializer.class);
|
||||||
FieldMapper underTest = new FieldMapper(serializer, methodHandleFactory);
|
FieldMapper underTest = new FieldMapper(serializer, methodHandleFactory);
|
||||||
Map<String, Collection<ItemCollectionMetrics>> items = new HashMap();
|
Map<String, Collection<ItemCollectionMetrics>> items = new HashMap<>();
|
||||||
BatchWriteItemResponse sdkResponse =
|
BatchWriteItemResponse sdkResponse =
|
||||||
BatchWriteItemResponse.builder()
|
BatchWriteItemResponse.builder()
|
||||||
.consumedCapacity(ConsumedCapacity.builder().build())
|
.consumedCapacity(ConsumedCapacity.builder().build())
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.ForkJoinTask;
|
import java.util.concurrent.ForkJoinTask;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class JavaAsyncChild extends ForkJoinTask implements Runnable, Callable {
|
public class JavaAsyncChild extends ForkJoinTask<Object> implements Runnable, Callable<Object> {
|
||||||
private static final Tracer tracer = GlobalOpenTelemetry.getTracer("test");
|
private static final Tracer tracer = GlobalOpenTelemetry.getTracer("test");
|
||||||
|
|
||||||
private final AtomicBoolean blockThread;
|
private final AtomicBoolean blockThread;
|
||||||
|
|
|
@ -29,6 +29,8 @@ dependencies {
|
||||||
testImplementation("org.springframework.cloud:spring-cloud-sleuth-core:2.2.4.RELEASE") {
|
testImplementation("org.springframework.cloud:spring-cloud-sleuth-core:2.2.4.RELEASE") {
|
||||||
isTransitive = false
|
isTransitive = false
|
||||||
}
|
}
|
||||||
|
// For some annotations used by sleuth
|
||||||
|
testCompileOnly("org.springframework:spring-core:4.3.30.RELEASE")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|
|
@ -12,9 +12,9 @@ import io.opentelemetry.api.GlobalOpenTelemetry;
|
||||||
import io.opentelemetry.sdk.OpenTelemetrySdk;
|
import io.opentelemetry.sdk.OpenTelemetrySdk;
|
||||||
import io.opentelemetry.sdk.metrics.SdkMeterProvider;
|
import io.opentelemetry.sdk.metrics.SdkMeterProvider;
|
||||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||||
import io.opentelemetry.sdk.metrics.testing.InMemoryMetricReader;
|
|
||||||
import io.opentelemetry.sdk.testing.assertj.MetricAssertions;
|
import io.opentelemetry.sdk.testing.assertj.MetricAssertions;
|
||||||
import io.opentelemetry.sdk.testing.assertj.MetricDataAssert;
|
import io.opentelemetry.sdk.testing.assertj.MetricDataAssert;
|
||||||
|
import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import org.junit.jupiter.api.AfterAll;
|
import org.junit.jupiter.api.AfterAll;
|
||||||
|
@ -37,7 +37,8 @@ class AbstractMetricsTest {
|
||||||
GlobalOpenTelemetry.resetForTest();
|
GlobalOpenTelemetry.resetForTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void waitAndAssertMetrics(Consumer<MetricDataAssert>... assertions) {
|
@SafeVarargs
|
||||||
|
protected final void waitAndAssertMetrics(Consumer<MetricDataAssert>... assertions) {
|
||||||
await()
|
await()
|
||||||
.untilAsserted(
|
.untilAsserted(
|
||||||
() -> {
|
() -> {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import scala.concurrent.forkjoin.ForkJoinTask;
|
import scala.concurrent.forkjoin.ForkJoinTask;
|
||||||
|
|
||||||
public class ScalaAsyncChild extends ForkJoinTask implements Runnable, Callable {
|
public class ScalaAsyncChild extends ForkJoinTask<Object> implements Runnable, Callable<Object> {
|
||||||
private static final Tracer tracer = GlobalOpenTelemetry.getTracer("test");
|
private static final Tracer tracer = GlobalOpenTelemetry.getTracer("test");
|
||||||
|
|
||||||
private final AtomicBoolean blockThread;
|
private final AtomicBoolean blockThread;
|
||||||
|
|
|
@ -15,7 +15,9 @@ dependencies {
|
||||||
library("io.vertx:vertx-core:3.0.0")
|
library("io.vertx:vertx-core:3.0.0")
|
||||||
|
|
||||||
compileOnly("io.vertx:vertx-codegen:3.0.0")
|
compileOnly("io.vertx:vertx-codegen:3.0.0")
|
||||||
|
testCompileOnly("io.vertx:vertx-codegen:3.0.0")
|
||||||
compileOnly("io.vertx:vertx-docgen:3.0.0")
|
compileOnly("io.vertx:vertx-docgen:3.0.0")
|
||||||
|
testCompileOnly("io.vertx:vertx-docgen:3.0.0")
|
||||||
|
|
||||||
compileOnly("com.google.auto.value:auto-value-annotations")
|
compileOnly("com.google.auto.value:auto-value-annotations")
|
||||||
annotationProcessor("com.google.auto.value:auto-value")
|
annotationProcessor("com.google.auto.value:auto-value")
|
||||||
|
|
|
@ -15,6 +15,7 @@ dependencies {
|
||||||
library("io.vertx:vertx-core:4.0.0")
|
library("io.vertx:vertx-core:4.0.0")
|
||||||
|
|
||||||
compileOnly("io.vertx:vertx-codegen:4.0.0")
|
compileOnly("io.vertx:vertx-codegen:4.0.0")
|
||||||
|
testCompileOnly("io.vertx:vertx-codegen:4.0.0")
|
||||||
|
|
||||||
implementation(project(":instrumentation:vertx:vertx-http-client:vertx-http-client-common:javaagent"))
|
implementation(project(":instrumentation:vertx:vertx-http-client:vertx-http-client-common:javaagent"))
|
||||||
|
|
||||||
|
|
|
@ -53,19 +53,4 @@ public final class CallDepth {
|
||||||
public int decrementAndGet() {
|
public int decrementAndGet() {
|
||||||
return --this.depth;
|
return --this.depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get current call depth. This method may be used by vendor distributions to extend existing
|
|
||||||
* instrumentations.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public int get() {
|
|
||||||
return depth;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Reset the call depth to its initial value. */
|
|
||||||
@Deprecated
|
|
||||||
public void reset() {
|
|
||||||
depth = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,17 +19,6 @@ class CallDepthTest {
|
||||||
assertThat(CallDepth.forClass(String.class).getAndIncrement()).isOne();
|
assertThat(CallDepth.forClass(String.class).getAndIncrement()).isOne();
|
||||||
assertThat(CallDepth.forClass(Integer.class).getAndIncrement()).isOne();
|
assertThat(CallDepth.forClass(Integer.class).getAndIncrement()).isOne();
|
||||||
|
|
||||||
CallDepth.forClass(String.class).reset();
|
|
||||||
assertThat(CallDepth.forClass(Integer.class).getAndIncrement()).isEqualTo(2);
|
|
||||||
|
|
||||||
CallDepth.forClass(Integer.class).reset();
|
|
||||||
|
|
||||||
assertThat(CallDepth.forClass(String.class).getAndIncrement()).isZero();
|
|
||||||
assertThat(CallDepth.forClass(Integer.class).getAndIncrement()).isZero();
|
|
||||||
|
|
||||||
assertThat(CallDepth.forClass(String.class).getAndIncrement()).isOne();
|
|
||||||
assertThat(CallDepth.forClass(Integer.class).getAndIncrement()).isOne();
|
|
||||||
|
|
||||||
assertThat(CallDepth.forClass(String.class).decrementAndGet()).isOne();
|
assertThat(CallDepth.forClass(String.class).decrementAndGet()).isOne();
|
||||||
assertThat(CallDepth.forClass(Integer.class).decrementAndGet()).isOne();
|
assertThat(CallDepth.forClass(Integer.class).decrementAndGet()).isOne();
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ dependencies {
|
||||||
|
|
||||||
annotationProcessor("com.google.auto.service:auto-service")
|
annotationProcessor("com.google.auto.service:auto-service")
|
||||||
compileOnly("com.google.auto.service:auto-service-annotations")
|
compileOnly("com.google.auto.service:auto-service-annotations")
|
||||||
|
testCompileOnly("com.google.auto.service:auto-service-annotations")
|
||||||
|
|
||||||
// Used by byte-buddy but not brought in as a transitive dependency.
|
// Used by byte-buddy but not brought in as a transitive dependency.
|
||||||
compileOnly("com.google.code.findbugs:annotations")
|
compileOnly("com.google.code.findbugs:annotations")
|
||||||
|
|
Loading…
Reference in New Issue