Skip to content
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
a89364a
migrate code extractor
SylvainJuge May 15, 2025
9950e96
jaxrs-1.0
SylvainJuge May 15, 2025
754c87e
jaxrs-2.0
SylvainJuge May 15, 2025
842deee
jaxrs-3.0
SylvainJuge May 15, 2025
743d865
jaxrs-common
SylvainJuge May 15, 2025
64ea006
methods
SylvainJuge May 15, 2025
4336748
otel annotations
SylvainJuge May 15, 2025
688962f
otel annotations
SylvainJuge May 15, 2025
56dcb38
reactor
SylvainJuge May 15, 2025
dcb8230
rx-java-2.0
SylvainJuge May 15, 2025
8543269
rxjava3
SylvainJuge May 15, 2025
79f9a4a
servlet
SylvainJuge May 15, 2025
dfca3bc
spring-boot-autoconfigure
SylvainJuge May 15, 2025
24c2198
spotless
SylvainJuge May 15, 2025
177d3c7
fix methods instrumentation
SylvainJuge May 15, 2025
c7c110b
springboot-autoconfigure - chapter 2
SylvainJuge May 15, 2025
c423a22
spring-scheduling
SylvainJuge May 15, 2025
a708390
spring-webflux
SylvainJuge May 15, 2025
ee6e51a
fix test for opentelemetry api
SylvainJuge May 15, 2025
d6dce61
spring-boot-mvc part 1
SylvainJuge May 15, 2025
1a944bd
spring-webmvc part 2
SylvainJuge May 15, 2025
f0b4d29
spring-web-mvc part 3
SylvainJuge May 15, 2025
9dbc742
struts
SylvainJuge May 15, 2025
350c20a
fix code extractor
SylvainJuge May 15, 2025
de19f01
wip
SylvainJuge May 16, 2025
eda7917
fix typo
SylvainJuge May 16, 2025
c204c3f
wip
SylvainJuge May 16, 2025
10dfd18
wip
SylvainJuge May 16, 2025
0e4e1a5
wip
SylvainJuge May 16, 2025
ab2e891
wip
SylvainJuge May 17, 2025
14a59d8
wip
SylvainJuge May 17, 2025
94abf7e
wip
SylvainJuge May 20, 2025
bd8adfd
wip
SylvainJuge May 20, 2025
763a1c7
cleanup
SylvainJuge May 20, 2025
7a3e4c2
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge May 20, 2025
92469d1
wip
SylvainJuge May 20, 2025
50e0bf4
wip
SylvainJuge May 20, 2025
abd250f
fix quartz job
SylvainJuge May 20, 2025
4bbf0c4
fix log assertions
SylvainJuge May 20, 2025
c4c788e
fix test for annotations
SylvainJuge May 20, 2025
3a9e121
spotless
SylvainJuge May 20, 2025
b8514cc
fix spring boot test
SylvainJuge May 20, 2025
08a316c
fix generated class annotation test
SylvainJuge May 20, 2025
8e74e0e
fix logback tests
SylvainJuge May 20, 2025
675db5f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge May 21, 2025
17d25d9
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge May 21, 2025
336cc0a
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge May 22, 2025
4b8960b
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge May 23, 2025
15f867f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge May 23, 2025
3785329
relax a bit assertions for grails
SylvainJuge May 23, 2025
b380442
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge May 23, 2025
b52c197
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge May 26, 2025
3bfb356
add comment for future semconv 1.33.0 update
SylvainJuge May 26, 2025
3be4b7a
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge Jun 2, 2025
91c682b
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge Jun 10, 2025
10ed2d5
fix typo
SylvainJuge Jun 10, 2025
928aa33
fix pebkc
SylvainJuge Jun 10, 2025
980baaa
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge Jun 11, 2025
d589f8e
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge Jun 12, 2025
0711411
add semconv stability for code
SylvainJuge Jun 12, 2025
06b8967
wip
SylvainJuge Jun 12, 2025
94307f4
refactor testing
SylvainJuge Jun 12, 2025
66e85cb
wip
SylvainJuge Jun 12, 2025
7f697b4
wip
SylvainJuge Jun 12, 2025
d8cc51c
wip
SylvainJuge Jun 12, 2025
caf1db7
wip
SylvainJuge Jun 12, 2025
3162e50
wip
SylvainJuge Jun 12, 2025
6d407f2
wip
SylvainJuge Jun 12, 2025
3734344
fix finatra compilation issue
SylvainJuge Jun 12, 2025
87b8527
wip
SylvainJuge Jun 12, 2025
2e90c2d
wip
SylvainJuge Jun 12, 2025
8dff938
wip
SylvainJuge Jun 13, 2025
3971229
wip
SylvainJuge Jun 13, 2025
61d7a38
wip
SylvainJuge Jun 13, 2025
4e4fd26
wip
SylvainJuge Jun 13, 2025
6cea7d7
wip
SylvainJuge Jun 13, 2025
90b0b91
wip
SylvainJuge Jun 13, 2025
f10d4d5
wip
SylvainJuge Jun 13, 2025
8cd97cf
wip
SylvainJuge Jun 13, 2025
0846080
wip
SylvainJuge Jun 13, 2025
d629917
wip
SylvainJuge Jun 13, 2025
3d33231
wip
SylvainJuge Jun 13, 2025
9cd067a
fix logback
SylvainJuge Jun 13, 2025
62de4d1
wip
SylvainJuge Jun 16, 2025
bf47648
wip
SylvainJuge Jun 16, 2025
8411054
log4j test stable and incubating semconv
SylvainJuge Jun 16, 2025
aeae7e8
fix jaxrs
SylvainJuge Jun 16, 2025
2067cbc
./gradlew spotlessApply
otelbot[bot] Jun 16, 2025
f05ac6f
fix test
SylvainJuge Jun 16, 2025
7e8beac
ignore checkstyle issue
SylvainJuge Jun 16, 2025
d36b345
fix stuff
SylvainJuge Jun 16, 2025
e955cc3
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge Jun 16, 2025
35ed6c6
remove unused imports in scala
SylvainJuge Jun 17, 2025
72a3db9
add semconv test for @WithSpan test
SylvainJuge Jun 17, 2025
4db44bd
fix scala compile error
SylvainJuge Jun 17, 2025
8cf6f0d
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge Jun 17, 2025
572b362
./gradlew spotlessApply
otelbot[bot] Jun 17, 2025
8e2788d
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge Jun 19, 2025
665d142
post-review changes
SylvainJuge Jun 24, 2025
6575f22
post-review changes again
SylvainJuge Jun 24, 2025
c7c8192
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-i…
SylvainJuge Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

import static io.opentelemetry.api.common.AttributeKey.booleanKey;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
import static io.opentelemetry.semconv.incubating.CodeIncubatingAttributes.CODE_FUNCTION;
import static io.opentelemetry.semconv.incubating.CodeIncubatingAttributes.CODE_NAMESPACE;
import static io.opentelemetry.semconv.incubating.CodeIncubatingAttributes.CODE_FUNCTION_NAME;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable;

Expand All @@ -19,7 +18,6 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

@SuppressWarnings("deprecation") // CodeIncubatingAttributes.CODE_FUNCTION is deprecated
public abstract class AbstractWithSpanTest<T extends U, U> {

@RegisterExtension
Expand Down Expand Up @@ -59,8 +57,9 @@ void success() {
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(CODE_NAMESPACE, traced.getClass().getName()),
equalTo(CODE_FUNCTION, "completable"))));
equalTo(
CODE_FUNCTION_NAME,
traced.getClass().getName() + ".completable"))));
}

@Test
Expand All @@ -82,8 +81,9 @@ void failure() {
.hasStatus(StatusData.error())
.hasException(AbstractTraced.FAILURE)
.hasAttributesSatisfyingExactly(
equalTo(CODE_NAMESPACE, traced.getClass().getName()),
equalTo(CODE_FUNCTION, "completable"))));
equalTo(
CODE_FUNCTION_NAME,
traced.getClass().getName() + ".completable"))));
}

@Test
Expand All @@ -100,8 +100,8 @@ void canceled() {
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(CODE_NAMESPACE, traced.getClass().getName()),
equalTo(CODE_FUNCTION, "completable"),
equalTo(
CODE_FUNCTION_NAME, traced.getClass().getName() + ".completable"),
equalTo(booleanKey(canceledKey()), true))));
}

Expand All @@ -118,8 +118,9 @@ void immediateSuccess() {
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(CODE_NAMESPACE, traced.getClass().getName()),
equalTo(CODE_FUNCTION, "alreadySucceeded"))));
equalTo(
CODE_FUNCTION_NAME,
traced.getClass().getName() + ".alreadySucceeded"))));
}

@Test
Expand All @@ -138,7 +139,8 @@ void immediateFailure() {
.hasStatus(StatusData.error())
.hasException(AbstractTraced.FAILURE)
.hasAttributesSatisfyingExactly(
equalTo(CODE_NAMESPACE, traced.getClass().getName()),
equalTo(CODE_FUNCTION, "alreadyFailed"))));
equalTo(
CODE_FUNCTION_NAME,
traced.getClass().getName() + ".alreadyFailed"))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ public final class CodeAttributesExtractor<REQUEST, RESPONSE>
implements AttributesExtractor<REQUEST, RESPONSE> {

// copied from CodeIncubatingAttributes
private static final AttributeKey<String> CODE_FUNCTION = AttributeKey.stringKey("code.function");
private static final AttributeKey<String> CODE_NAMESPACE =
AttributeKey.stringKey("code.namespace");
private static final AttributeKey<String> CODE_FUNCTION_NAME =
AttributeKey.stringKey("code.function.name");

/** Creates the code attributes extractor. */
public static <REQUEST, RESPONSE> AttributesExtractor<REQUEST, RESPONSE> create(
Expand All @@ -40,11 +39,21 @@ private CodeAttributesExtractor(CodeAttributesGetter<REQUEST> getter) {

@Override
public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST request) {
StringBuilder sb = new StringBuilder();
Class<?> cls = getter.getCodeClass(request);
if (cls != null) {
internalSet(attributes, CODE_NAMESPACE, cls.getName());
sb.append(cls.getName());
}
String methodName = getter.getMethodName(request);
if (methodName != null) {
if (sb.length() > 0) {
sb.append(".");
}
sb.append(methodName);
}
if (sb.length() > 0) {
internalSet(attributes, CODE_FUNCTION_NAME, sb.toString());
}
internalSet(attributes, CODE_FUNCTION, getter.getMethodName(request));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ void shouldExtractAllAttributes() {
// then
assertThat(startAttributes.build())
.containsOnly(
entry(CodeIncubatingAttributes.CODE_NAMESPACE, TestClass.class.getName()),
entry(CodeIncubatingAttributes.CODE_FUNCTION, "doSomething"));
entry(
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
TestClass.class.getName() + ".doSomething"));

assertThat(endAttributes.build().isEmpty()).isTrue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.opentelemetry.instrumentation.testing.internal.AutoCleanupExtension;
import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import io.opentelemetry.sdk.testing.assertj.AttributeAssertion;
import io.opentelemetry.semconv.incubating.CodeIncubatingAttributes;
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
import java.io.File;
Expand Down Expand Up @@ -79,11 +80,7 @@ void emptyRepository() {
span.hasName("DocRepository.findAll")
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
DocRepository.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "findAll")),
.hasAttributesSatisfyingExactly(assertFunctionName("findAll")),
span ->
span.hasName("SearchAction")
.hasKind(SpanKind.CLIENT)
Expand Down Expand Up @@ -113,11 +110,7 @@ void crud() {
span.hasName("DocRepository.index")
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
DocRepository.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "index")),
.hasAttributesSatisfyingExactly(assertFunctionName("index")),
span ->
span.hasName("IndexAction")
.hasKind(SpanKind.CLIENT)
Expand Down Expand Up @@ -162,11 +155,7 @@ void crud() {
span.hasName("DocRepository.findById")
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
DocRepository.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "findById")),
.hasAttributesSatisfyingExactly(assertFunctionName("findById")),
span ->
span.hasName("GetAction")
.hasKind(SpanKind.CLIENT)
Expand Down Expand Up @@ -196,11 +185,7 @@ void crud() {
span.hasName("DocRepository.index")
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
DocRepository.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "index")),
.hasAttributesSatisfyingExactly(assertFunctionName("index")),
span ->
span.hasName("IndexAction")
.hasKind(SpanKind.CLIENT)
Expand Down Expand Up @@ -240,11 +225,7 @@ void crud() {
span.hasName("DocRepository.findById")
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
DocRepository.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "findById")),
.hasAttributesSatisfyingExactly(assertFunctionName("findById")),
span ->
span.hasName("GetAction")
.hasKind(SpanKind.CLIENT)
Expand Down Expand Up @@ -272,11 +253,7 @@ void crud() {
span.hasName("DocRepository.deleteById")
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
DocRepository.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "deleteById")),
.hasAttributesSatisfyingExactly(assertFunctionName("deleteById")),
span ->
span.hasName("DeleteAction")
.hasKind(SpanKind.CLIENT)
Expand Down Expand Up @@ -315,11 +292,7 @@ void crud() {
span.hasName("DocRepository.findAll")
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
DocRepository.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "findAll")),
.hasAttributesSatisfyingExactly(assertFunctionName("findAll")),
span ->
span.hasName("SearchAction")
.hasKind(SpanKind.CLIENT)
Expand All @@ -334,4 +307,10 @@ void crud() {
equalTo(stringKey("elasticsearch.request.indices"), "test-index"),
equalTo(stringKey("elasticsearch.request.search.types"), "doc"))));
}

private static AttributeAssertion assertFunctionName(String methodName) {
return equalTo(
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
DocRepository.class.getName() + "." + methodName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ void testMethodWithAnnotationShouldBeTraced() {
span.hasName("AnnotationTracedCallable.call")
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
AnnotationTracedCallable.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "call"))));
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
AnnotationTracedCallable.class.getName() + ".call"))));
}

static class AnnotationTracedCallable implements Callable<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import io.opentelemetry.sdk.testing.assertj.AttributeAssertion;
import io.opentelemetry.sdk.trace.data.StatusData;
import io.opentelemetry.semconv.incubating.CodeIncubatingAttributes;
import io.opentracing.contrib.dropwizard.Trace;
import java.util.concurrent.Callable;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

@SuppressWarnings("deprecation") // using deprecated semconv
class TraceAnnotationsTest {

@RegisterExtension
Expand All @@ -36,11 +36,13 @@ void testSimpleCaseAnnotations() {
span.hasName("SayTracedHello.sayHello")
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
SayTracedHello.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "sayHello"),
equalTo(stringKey("myattr"), "test"))));
assertCodeFunction("sayHello"), equalTo(stringKey("myattr"), "test"))));
}

private static AttributeAssertion assertCodeFunction(String methodName) {
return equalTo(
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
SayTracedHello.class.getName() + "." + methodName);
}

@Test
Expand All @@ -55,29 +57,18 @@ void testComplexCaseAnnotations() {
span.hasName("SayTracedHello.sayHelloSayHa")
.hasNoParent()
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
SayTracedHello.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "sayHelloSayHa"),
assertCodeFunction("sayHelloSayHa"),
equalTo(stringKey("myattr"), "test2")),
span ->
span.hasName("SayTracedHello.sayHello")
.hasParent(trace.getSpan(0))
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
SayTracedHello.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "sayHello"),
equalTo(stringKey("myattr"), "test")),
assertCodeFunction("sayHello"), equalTo(stringKey("myattr"), "test")),
span ->
span.hasName("SayTracedHello.sayHello")
.hasParent(trace.getSpan(0))
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
SayTracedHello.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "sayHello"),
equalTo(stringKey("myattr"), "test"))));
assertCodeFunction("sayHello"), equalTo(stringKey("myattr"), "test"))));
}

@Test
Expand All @@ -91,11 +82,7 @@ void testExceptionExit() {
span.hasName("SayTracedHello.sayError")
.hasStatus(StatusData.error())
.hasException(thrown)
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
SayTracedHello.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "sayError"))));
.hasAttributesSatisfyingExactly(assertCodeFunction("sayError"))));
}

@Test
Expand All @@ -110,9 +97,8 @@ void testAnonymousClassAnnotations() {
span.hasName("SayTracedHello$1.call")
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
SayTracedHello.class.getName() + "$1"),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "call"))));
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
SayTracedHello.class.getName() + "$1.call"))));

// Test anonymous classes with no package
new Callable<String>() {
Expand All @@ -130,17 +116,15 @@ public String call() {
span.hasName("SayTracedHello$1.call")
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
SayTracedHello.class.getName() + "$1"),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "call"))),
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
SayTracedHello.class.getName() + "$1.call"))),
trace ->
trace.hasSpansSatisfyingExactly(
span ->
span.hasName("TraceAnnotationsTest$1.call")
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
TraceAnnotationsTest.class.getName() + "$1"),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "call"))));
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
TraceAnnotationsTest.class.getName() + "$1.call"))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class TraceProvidersTest {
@RegisterExtension
static final InstrumentationExtension testing = AgentInstrumentationExtension.create();

@SuppressWarnings("deprecation") // using deprecated semconv
@ParameterizedTest
@EnumSource(TraceProvider.class)
void testShouldSupportProvider(TraceProvider provider) {
Expand All @@ -35,10 +34,8 @@ void testShouldSupportProvider(TraceProvider provider) {
span.hasName("SayTracedHello." + provider.testMethodName())
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE,
SayTracedHello.class.getName()),
equalTo(
CodeIncubatingAttributes.CODE_FUNCTION, provider.testMethodName()),
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
SayTracedHello.class.getName() + "." + provider.testMethodName()),
equalTo(stringKey("providerAttr"), provider.name()))));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ void testCallingTheseMethodsShouldBeTraced() {
span.hasName("TestClass.annotated")
.hasAttributesSatisfyingExactly(
equalTo(
CodeIncubatingAttributes.CODE_NAMESPACE, TestClass.class.getName()),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "annotated"))));
CodeIncubatingAttributes.CODE_FUNCTION_NAME,
TestClass.class.getName() + ".annotated"))));
}

@Test
Expand Down
Loading
Loading