Clean up old operation name terminology
MODIFY
instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test_before_1_11_106/groovy/Aws0ClientTest.groovy
instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test_before_1_11_106/groovy/Aws0ClientTest.groovy
@@ -274,8 +274,4 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
}
}
}
-
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
}

MODIFY
instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractAws1ClientTest.groovy
instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractAws1ClientTest.groovy
@@ -244,8 +244,4 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
}
}
}
-
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
}

MODIFY
instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy
instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy
@@ -544,8 +544,4 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
}
}
}
-
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
}

MODIFY
instrumentation/elasticsearch/elasticsearch-rest-5.0/javaagent/src/test/groovy/Elasticsearch5RestClientTest.groovy
instrumentation/elasticsearch/elasticsearch-rest-5.0/javaagent/src/test/groovy/Elasticsearch5RestClientTest.groovy
@@ -78,8 +78,4 @@ class Elasticsearch5RestClientTest extends AgentInstrumentationSpecification {
}
}
}
-
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
}

MODIFY
instrumentation/elasticsearch/elasticsearch-rest-6.4/javaagent/src/test/groovy/Elasticsearch6RestClientTest.groovy
instrumentation/elasticsearch/elasticsearch-rest-6.4/javaagent/src/test/groovy/Elasticsearch6RestClientTest.groovy
@@ -73,8 +73,4 @@ class Elasticsearch6RestClientTest extends AgentInstrumentationSpecification {
}
}
}
-
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
}

MODIFY
instrumentation/elasticsearch/elasticsearch-rest-7.0/javaagent/src/test/groovy/Elasticsearch7RestClientTest.groovy
instrumentation/elasticsearch/elasticsearch-rest-7.0/javaagent/src/test/groovy/Elasticsearch7RestClientTest.groovy
@@ -120,8 +120,4 @@ class Elasticsearch7RestClientTest extends AgentInstrumentationSpecification {
}
}
}
-
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
}

MODIFY
instrumentation/http-url-connection/javaagent/src/test/groovy/HttpUrlConnectionTest.groovy
instrumentation/http-url-connection/javaagent/src/test/groovy/HttpUrlConnectionTest.groovy
@@ -103,7 +103,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
}
}
span(1) {
- name expectedOperationName("GET")
+ name "HTTP GET"
kind CLIENT
childOf span(0)
attributes {
@@ -124,7 +124,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
}
}
span(3) {
- name expectedOperationName("GET")
+ name "HTTP GET"
kind CLIENT
childOf span(0)
attributes {
@@ -172,7 +172,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
}
}
span(1) {
- name expectedOperationName("GET")
+ name "HTTP GET"
kind CLIENT
childOf span(0)
attributes {
@@ -230,7 +230,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
}
}
span(1) {
- name expectedOperationName("POST")
+ name "HTTP POST"
kind CLIENT
childOf span(0)
attributes {

MODIFY
instrumentation/http-url-connection/javaagent/src/test/groovy/UrlConnectionTest.groovy
instrumentation/http-url-connection/javaagent/src/test/groovy/UrlConnectionTest.groovy
@@ -38,7 +38,7 @@ class UrlConnectionTest extends AgentInstrumentationSpecification {
errorEvent ConnectException, String
}
span(1) {
- name expectedOperationName("GET")
+ name "HTTP GET"
kind CLIENT
childOf span(0)
status ERROR
@@ -60,8 +60,4 @@ class UrlConnectionTest extends AgentInstrumentationSpecification {
url = new URI("$scheme://localhost:$UNUSABLE_PORT").toURL()
}
-
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
}

MODIFY
instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-common/javaagent/src/test/groovy/JaxRsClientTest.groovy
instrumentation/jaxrs-client/jaxrs-client-2.0/jaxrs-client-2.0-common/javaagent/src/test/groovy/JaxRsClientTest.groovy
@@ -91,7 +91,7 @@ abstract class JaxRsClientTest extends HttpClientTest<Invocation.Builder> implem
trace(0, 2) {
span(0) {
hasNoParent()
- name expectedOperationName(method)
+ name "HTTP $method"
kind CLIENT
status ERROR
attributes {

MODIFY
instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWsClientTestBaseBase.groovy
instrumentation/play-ws/play-ws-testing/src/main/groovy/PlayWsClientTestBaseBase.groovy
@@ -56,10 +56,6 @@ abstract class PlayWsClientTestBaseBase<REQUEST> extends HttpClientTest<REQUEST>
system?.terminate()
}
- String expectedOperationName() {
- return "play-ws.request"
- }
-
@Override
int maxRedirects() {
3

MODIFY
instrumentation/rxjava/rxjava-1.0/library/src/main/java/io/opentelemetry/instrumentation/rxjava/TracedOnSubscribe.java
instrumentation/rxjava/rxjava-1.0/library/src/main/java/io/opentelemetry/instrumentation/rxjava/TracedOnSubscribe.java
@@ -16,18 +16,15 @@ import rx.__OpenTelemetryTracingUtil;
public class TracedOnSubscribe<T> implements Observable.OnSubscribe<T> {
private final Observable.OnSubscribe<T> delegate;
- private final String operationName;
+ private final String spanName;
private final Context parentContext;
private final BaseTracer tracer;
private final SpanKind spanKind;
public TracedOnSubscribe(
- Observable<T> originalObservable,
- String operationName,
- BaseTracer tracer,
- SpanKind spanKind) {
+ Observable<T> originalObservable, String spanName, BaseTracer tracer, SpanKind spanKind) {
delegate = __OpenTelemetryTracingUtil.extractOnSubscribe(originalObservable);
- this.operationName = operationName;
+ this.spanName = spanName;
this.tracer = tracer;
this.spanKind = spanKind;
@@ -36,7 +33,7 @@ public class TracedOnSubscribe<T> implements Observable.OnSubscribe<T> {
@Override
public void call(Subscriber<? super T> subscriber) {
- Context context = tracer.startSpan(parentContext, operationName, spanKind);
+ Context context = tracer.startSpan(parentContext, spanName, spanKind);
decorateSpan(Span.fromContext(context));
try (Scope ignored = context.makeCurrent()) {
delegate.call(new TracedSubscriber<>(context, subscriber, tracer));

MODIFY
instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/AdviceUtils.java
instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/AdviceUtils.java
@@ -25,17 +25,14 @@ public class AdviceUtils {
public static final String CONTEXT_ATTRIBUTE = AdviceUtils.class.getName() + ".Context";
- public static String parseOperationName(Object handler) {
+ public static String spanNameForHandler(Object handler) {
String className = SpanNames.spanNameForClass(handler.getClass());
- String operationName;
int lambdaIdx = className.indexOf("$$Lambda$");
if (lambdaIdx > -1) {
- operationName = className.substring(0, lambdaIdx) + ".lambda";
- } else {
- operationName = className + ".handle";
+ return className.substring(0, lambdaIdx) + ".lambda";
}
- return operationName;
+ return className + ".handle";
}
public static <T> Mono<T> setPublisherSpan(

MODIFY
instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/HandlerAdapterInstrumentation.java
instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/HandlerAdapterInstrumentation.java
@@ -70,19 +70,19 @@ public class HandlerAdapterInstrumentation implements TypeInstrumentation {
if (handler != null && context != null) {
Span span = Span.fromContext(context);
String handlerType;
- String operationName;
+ String spanName;
if (handler instanceof HandlerMethod) {
// Special case for requests mapped with annotations
HandlerMethod handlerMethod = (HandlerMethod) handler;
- operationName = SpanNames.spanNameForMethod(handlerMethod.getMethod());
+ spanName = SpanNames.spanNameForMethod(handlerMethod.getMethod());
handlerType = handlerMethod.getMethod().getDeclaringClass().getName();
} else {
- operationName = AdviceUtils.parseOperationName(handler);
+ spanName = AdviceUtils.spanNameForHandler(handler);
handlerType = handler.getClass().getName();
}
- span.updateName(operationName);
+ span.updateName(spanName);
if (SpringWebfluxConfig.captureExperimentalSpanAttributes()) {
span.setAttribute("spring-webflux.handler.type", handlerType);
}

MODIFY
instrumentation/twilio-6.6/javaagent/src/test/groovy/test/TwilioClientTest.groovy
instrumentation/twilio-6.6/javaagent/src/test/groovy/test/TwilioClientTest.groovy
@@ -608,8 +608,4 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
}
}
}
-
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
}

MODIFY
testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpClientTest.groovy
testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpClientTest.groovy
@@ -969,12 +969,8 @@ abstract class HttpClientTest<REQUEST> extends InstrumentationSpecification {
}
}
- String expectedOperationName(String method) {
- return method != null ? "HTTP $method" : "HTTP request"
- }
-
String expectedClientSpanName(URI uri, String method) {
- return expectedOperationName(method)
+ return method != null ? "HTTP $method" : "HTTP request"
}
void assertClientSpanErrorEvent(SpanAssert spanAssert, URI uri, Throwable exception) {

MODIFY
testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/utils/TraceUtils.groovy
testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/utils/TraceUtils.groovy
@@ -25,13 +25,13 @@ class TraceUtils {
private static final Tracer tracer = GlobalOpenTelemetry.getTracer("test")
- static <T> T runUnderServerTrace(final String rootOperationName, final Callable<T> r) {
- return ServerTraceUtils.runUnderServerTrace(rootOperationName, r)
+ static <T> T runUnderServerTrace(String spanName, Callable<T> r) {
+ return ServerTraceUtils.runUnderServerTrace(spanName, r)
}
- static <T> T runUnderTrace(final String rootOperationName, final Callable<T> r) {
+ static <T> T runUnderTrace(String spanName, Callable<T> r) {
try {
- final Span span = tracer.spanBuilder(rootOperationName).setSpanKind(SpanKind.INTERNAL).startSpan()
+ Span span = tracer.spanBuilder(spanName).setSpanKind(SpanKind.INTERNAL).startSpan()
try {
def result = span.makeCurrent().withCloseable {
@@ -39,7 +39,7 @@ class TraceUtils {
}
span.end()
return result
- } catch (final Exception e) {
+ } catch (Exception e) {
span.setStatus(StatusCode.ERROR)
span.recordException(e instanceof ExecutionException ? e.getCause() : e)
span.end()
@@ -100,8 +100,8 @@ class TraceUtils {
}
}
- static <T> T runUnderTraceWithoutExceptionCatch(final String rootOperationName, final Callable<T> r) {
- final Span span = tracer.spanBuilder(rootOperationName).setSpanKind(SpanKind.INTERNAL).startSpan()
+ static <T> T runUnderTraceWithoutExceptionCatch(String spanName, Callable<T> r) {
+ Span span = tracer.spanBuilder(spanName).setSpanKind(SpanKind.INTERNAL).startSpan()
try {
return span.makeCurrent().withCloseable {

Clean up old operation name terminology (#3282)