Update instrumentation to be compliant with HTTP semantic conventions (#227)

* Update HTTP client-side span names

* Add query and fragment to  http.url for HTTP client spans

* Add query and fragment to http.url for HTTP server spans

* Update HTTP server span names to be the matched route or resource

* Use net.peer.* instead of peer.* attributes
This commit is contained in:
Han Zhang 2020-03-12 18:49:52 -07:00 committed by GitHub
parent f5c5e57020
commit 5b1218cdb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
127 changed files with 790 additions and 686 deletions

View File

@ -22,8 +22,6 @@ import io.opentelemetry.trace.Status;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Method;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.concurrent.ExecutionException;
@ -69,8 +67,8 @@ public abstract class BaseDecorator {
if (remoteConnection != null) {
onPeerConnection(span, remoteConnection.getAddress());
span.setAttribute(Tags.PEER_HOSTNAME, remoteConnection.getHostName());
span.setAttribute(Tags.PEER_PORT, remoteConnection.getPort());
span.setAttribute(MoreTags.NET_PEER_NAME, remoteConnection.getHostName());
span.setAttribute(MoreTags.NET_PEER_PORT, remoteConnection.getPort());
}
return span;
}
@ -78,12 +76,8 @@ public abstract class BaseDecorator {
public Span onPeerConnection(final Span span, final InetAddress remoteAddress) {
assert span != null;
if (remoteAddress != null) {
span.setAttribute(Tags.PEER_HOSTNAME, remoteAddress.getHostName());
if (remoteAddress instanceof Inet4Address) {
span.setAttribute(Tags.PEER_HOST_IPV4, remoteAddress.getHostAddress());
} else if (remoteAddress instanceof Inet6Address) {
span.setAttribute(Tags.PEER_HOST_IPV6, remoteAddress.getHostAddress());
}
span.setAttribute(MoreTags.NET_PEER_NAME, remoteAddress.getHostName());
span.setAttribute(MoreTags.NET_PEER_IP, remoteAddress.getHostAddress());
}
return span;
}

View File

@ -28,6 +28,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public abstract class HttpClientDecorator<REQUEST, RESPONSE> extends ClientDecorator {
public static final String DEFAULT_SPAN_NAME = "HTTP request";
protected abstract String method(REQUEST request);
protected abstract URI url(REQUEST request) throws URISyntaxException;
@ -48,6 +50,14 @@ public abstract class HttpClientDecorator<REQUEST, RESPONSE> extends ClientDecor
return null;
}
public String spanNameForRequest(final REQUEST request) {
if (request == null) {
return DEFAULT_SPAN_NAME;
}
final String method = method(request);
return method != null ? "HTTP " + method : DEFAULT_SPAN_NAME;
}
public Span onRequest(final Span span, final REQUEST request) {
assert span != null;
if (request != null) {
@ -60,33 +70,39 @@ public abstract class HttpClientDecorator<REQUEST, RESPONSE> extends ClientDecor
try {
final URI url = url(request);
if (url != null) {
final StringBuilder urlNoParams = new StringBuilder();
final StringBuilder urlBuilder = new StringBuilder();
if (url.getScheme() != null) {
urlNoParams.append(url.getScheme());
urlNoParams.append("://");
urlBuilder.append(url.getScheme());
urlBuilder.append("://");
}
if (url.getHost() != null) {
urlNoParams.append(url.getHost());
urlBuilder.append(url.getHost());
if (url.getPort() > 0 && url.getPort() != 80 && url.getPort() != 443) {
urlNoParams.append(":");
urlNoParams.append(url.getPort());
urlBuilder.append(":");
urlBuilder.append(url.getPort());
}
}
final String path = url.getPath();
if (path.isEmpty()) {
urlNoParams.append("/");
urlBuilder.append("/");
} else {
urlNoParams.append(path);
urlBuilder.append(path);
}
final String query = url.getQuery();
if (query != null) {
urlBuilder.append("?").append(query);
}
final String fragment = url.getFragment();
if (fragment != null) {
urlBuilder.append("#").append(fragment);
}
span.setAttribute(Tags.HTTP_URL, urlNoParams.toString());
span.setAttribute(Tags.HTTP_URL, urlBuilder.toString());
if (Config.get().isHttpClientTagQueryString()) {
final String query = url.getQuery();
if (query != null) {
span.setAttribute(MoreTags.HTTP_QUERY, query);
}
final String fragment = url.getFragment();
if (fragment != null) {
span.setAttribute(MoreTags.HTTP_FRAGMENT, fragment);
}
@ -98,7 +114,7 @@ public abstract class HttpClientDecorator<REQUEST, RESPONSE> extends ClientDecor
final String hostname = hostname(request);
if (hostname != null) {
span.setAttribute(Tags.PEER_HOSTNAME, hostname);
span.setAttribute(MoreTags.NET_PEER_NAME, hostname);
if (Config.get().isHttpClientSplitByDomain()) {
span.setAttribute(MoreTags.SERVICE_NAME, hostname);
@ -107,7 +123,7 @@ public abstract class HttpClientDecorator<REQUEST, RESPONSE> extends ClientDecor
final Integer port = port(request);
// Negative or Zero ports might represent an unset/null value for an int type. Skip setting.
if (port != null && port > 0) {
span.setAttribute(Tags.PEER_PORT, port);
span.setAttribute(MoreTags.NET_PEER_PORT, port);
}
}
return span;

View File

@ -23,17 +23,12 @@ import io.opentelemetry.trace.Span;
import io.opentelemetry.trace.Status;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.regex.Pattern;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public abstract class HttpServerDecorator<REQUEST, CONNECTION, RESPONSE> extends ServerDecorator {
public static final String SPAN_ATTRIBUTE = "io.opentelemetry.auto.span";
// Source: https://www.regextester.com/22
private static final Pattern VALID_IPV4_ADDRESS =
Pattern.compile(
"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$");
public static final String DEFAULT_SPAN_NAME = "HTTP request";
protected abstract String method(REQUEST request);
@ -50,6 +45,14 @@ public abstract class HttpServerDecorator<REQUEST, CONNECTION, RESPONSE> extends
return SpanTypes.HTTP_SERVER;
}
public String spanNameForRequest(final REQUEST request) {
if (request == null) {
return DEFAULT_SPAN_NAME;
}
final String method = method(request);
return method != null ? "HTTP " + method : DEFAULT_SPAN_NAME;
}
public Span onRequest(final Span span, final REQUEST request) {
assert span != null;
if (request != null) {
@ -59,26 +62,34 @@ public abstract class HttpServerDecorator<REQUEST, CONNECTION, RESPONSE> extends
try {
final URI url = url(request);
if (url != null) {
final StringBuilder urlNoParams = new StringBuilder();
final StringBuilder urlBuilder = new StringBuilder();
if (url.getScheme() != null) {
urlNoParams.append(url.getScheme());
urlNoParams.append("://");
urlBuilder.append(url.getScheme());
urlBuilder.append("://");
}
if (url.getHost() != null) {
urlNoParams.append(url.getHost());
urlBuilder.append(url.getHost());
if (url.getPort() > 0 && url.getPort() != 80 && url.getPort() != 443) {
urlNoParams.append(":");
urlNoParams.append(url.getPort());
urlBuilder.append(":");
urlBuilder.append(url.getPort());
}
}
final String path = url.getPath();
if (path.isEmpty()) {
urlNoParams.append("/");
urlBuilder.append("/");
} else {
urlNoParams.append(path);
urlBuilder.append(path);
}
final String query = url.getQuery();
if (query != null) {
urlBuilder.append("?").append(query);
}
final String fragment = url.getFragment();
if (fragment != null) {
urlBuilder.append("#").append(fragment);
}
span.setAttribute(Tags.HTTP_URL, urlNoParams.toString());
span.setAttribute(Tags.HTTP_URL, urlBuilder.toString());
if (Config.get().isHttpServerTagQueryString()) {
if (url.getQuery() != null) {
@ -102,16 +113,12 @@ public abstract class HttpServerDecorator<REQUEST, CONNECTION, RESPONSE> extends
if (connection != null) {
final String ip = peerHostIP(connection);
if (ip != null) {
if (VALID_IPV4_ADDRESS.matcher(ip).matches()) {
span.setAttribute(Tags.PEER_HOST_IPV4, ip);
} else if (ip.contains(":")) {
span.setAttribute(Tags.PEER_HOST_IPV6, ip);
}
span.setAttribute(MoreTags.NET_PEER_IP, ip);
}
final Integer port = peerPort(connection);
// Negative or Zero ports might represent an unset/null value for an int type. Skip setting.
if (port != null && port > 0) {
span.setAttribute(Tags.PEER_PORT, port);
span.setAttribute(MoreTags.NET_PEER_PORT, port);
}
}
return span;

View File

@ -46,17 +46,12 @@ class BaseDecoratorTest extends AgentSpecification {
then:
if (connection.getAddress()) {
2 * span.setAttribute(Tags.PEER_HOSTNAME, connection.hostName)
2 * span.setAttribute(MoreTags.NET_PEER_NAME, connection.hostName)
1 * span.setAttribute(MoreTags.NET_PEER_IP, connection.address.hostAddress)
} else {
1 * span.setAttribute(Tags.PEER_HOSTNAME, connection.hostName)
}
1 * span.setAttribute(Tags.PEER_PORT, connection.port)
if (connection.address instanceof Inet4Address) {
1 * span.setAttribute(Tags.PEER_HOST_IPV4, connection.address.hostAddress)
}
if (connection.address instanceof Inet6Address) {
1 * span.setAttribute(Tags.PEER_HOST_IPV6, connection.address.hostAddress)
1 * span.setAttribute(MoreTags.NET_PEER_NAME, connection.hostName)
}
1 * span.setAttribute(MoreTags.NET_PEER_PORT, connection.port)
0 * _
where:

View File

@ -44,8 +44,8 @@ class HttpClientDecoratorTest extends ClientDecoratorTest {
if (req) {
1 * span.setAttribute(Tags.HTTP_METHOD, req.method)
1 * span.setAttribute(Tags.HTTP_URL, "$req.url")
1 * span.setAttribute(Tags.PEER_HOSTNAME, req.host)
1 * span.setAttribute(Tags.PEER_PORT, req.port)
1 * span.setAttribute(MoreTags.NET_PEER_NAME, req.host)
1 * span.setAttribute(MoreTags.NET_PEER_PORT, req.port)
if (renameService) {
1 * span.setAttribute(MoreTags.SERVICE_NAME, req.host)
}
@ -87,16 +87,16 @@ class HttpClientDecoratorTest extends ClientDecoratorTest {
tagQueryString | url | expectedUrl | expectedQuery | expectedFragment
false | null | null | null | null
false | "" | "/" | "" | null
false | "/path?query" | "/path" | "" | null
false | "/path?query" | "/path?query" | "" | null
false | "https://host:0" | "https://host/" | "" | null
false | "https://host/path" | "https://host/path" | "" | null
false | "http://host:99/path?query#fragment" | "http://host:99/path" | "" | null
false | "http://host:99/path?query#fragment" | "http://host:99/path?query#fragment" | "" | null
true | null | null | null | null
true | "" | "/" | null | null
true | "/path?encoded+%28query%29%3F" | "/path" | "encoded+(query)?" | null
true | "/path?encoded+%28query%29%3F" | "/path?encoded+(query)?" | "encoded+(query)?" | null
true | "https://host:0" | "https://host/" | null | null
true | "https://host/path" | "https://host/path" | null | null
true | "http://host:99/path?query#encoded+%28fragment%29%3F" | "http://host:99/path" | "query" | "encoded+(fragment)?"
true | "http://host:99/path?query#encoded+%28fragment%29%3F" | "http://host:99/path?query#encoded+(fragment)?" | "query" | "encoded+(fragment)?"
req = [url: url == null ? null : new URI(url)]
}

View File

@ -44,7 +44,7 @@ class HttpServerDecoratorTest extends ServerDecoratorTest {
where:
req | url
null | _
[method: "test-method", url: URI.create("http://test-url?some=query")] | "http://test-url/"
[method: "test-method", url: URI.create("http://test-url?some=query")] | "http://test-url/?some=query"
[method: "test-method", url: URI.create("http://a:80/")] | "http://a/"
[method: "test-method", url: URI.create("https://10.0.0.1:443")] | "https://10.0.0.1/"
[method: "test-method", url: URI.create("https://localhost:0/1/")] | "https://localhost/1/"
@ -79,17 +79,17 @@ class HttpServerDecoratorTest extends ServerDecoratorTest {
tagQueryString | url | expectedUrl | expectedQuery | expectedFragment
false | null | null | null | null
false | "" | "/" | "" | null
false | "/path?query" | "/path" | "" | null
false | "/path?query" | "/path?query" | "" | null
false | "https://host:0" | "https://host/" | "" | null
false | "https://host/path" | "https://host/path" | "" | null
false | "http://host:99/path?query#fragment" | "http://host:99/path" | "" | null
false | "http://host:99/path?query#fragment" | "http://host:99/path?query#fragment" | "" | null
true | null | null | null | null
true | "" | "/" | null | null
true | "/path?encoded+%28query%29%3F?" | "/path" | "encoded+(query)??" | null
true | "/path?encoded+%28query%29%3F?" | "/path?encoded+(query)??" | "encoded+(query)??" | null
true | "https://host:0" | "https://host/" | null | null
true | "https://host/path" | "https://host/path" | null | null
true | "http://host:99/path?query#enc+%28fragment%29%3F" | "http://host:99/path" | "query" | "enc+(fragment)?"
true | "http://host:99/path?query#enc+%28fragment%29%3F?tail" | "http://host:99/path" | "query" | "enc+(fragment)??tail"
true | "http://host:99/path?query#enc+%28fragment%29%3F" | "http://host:99/path?query#enc+(fragment)?" | "query" | "enc+(fragment)?"
true | "http://host:99/path?query#enc+%28fragment%29%3F?tail" | "http://host:99/path?query#enc+(fragment)??tail" | "query" | "enc+(fragment)??tail"
req = [url: url == null ? null : new URI(url)]
}
@ -103,11 +103,11 @@ class HttpServerDecoratorTest extends ServerDecoratorTest {
then:
if (conn) {
1 * span.setAttribute(Tags.PEER_PORT, 555)
1 * span.setAttribute(MoreTags.NET_PEER_PORT, 555)
if (ipv4) {
1 * span.setAttribute(Tags.PEER_HOST_IPV4, "10.0.0.1")
1 * span.setAttribute(MoreTags.NET_PEER_IP, "10.0.0.1")
} else if (ipv4 != null) {
1 * span.setAttribute(Tags.PEER_HOST_IPV6, "3ffe:1900:4545:3:200:f8ff:fe21:67cf")
1 * span.setAttribute(MoreTags.NET_PEER_IP, "3ffe:1900:4545:3:200:f8ff:fe21:67cf")
}
}
0 * _

View File

@ -17,6 +17,7 @@ import akka.NotUsed
import akka.stream.javadsl.Source
import akka.stream.testkit.TestSubscriber.Probe
import akka.stream.testkit.javadsl.TestSink
import io.opentelemetry.auto.decorator.HttpServerDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -76,7 +77,7 @@ class LagomTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "akka-http.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
@ -113,7 +114,7 @@ class LagomTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 1) {
span(0) {
operationName "akka-http.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored true
tags {
@ -127,4 +128,8 @@ class LagomTest extends AgentTestRunner {
}
}
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpServerDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -96,7 +96,8 @@ public final class AkkaHttpClientInstrumentation extends Instrumenter.Default {
return null;
}
final Span span = TRACER.spanBuilder("akka-http.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
DECORATE.afterStart(span);
DECORATE.onRequest(span, request);

View File

@ -111,7 +111,8 @@ public final class AkkaHttpServerInstrumentation extends Instrumenter.Default {
public static class WrapperHelper {
public static SpanWithScope createSpan(final HttpRequest request) {
final Span.Builder spanBuilder = TRACER.spanBuilder("akka-http.request").setSpanKind(SERVER);
final Span.Builder spanBuilder =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(SERVER);
try {
final SpanContext extractedContext = TRACER.getHttpTextFormat().extract(request, GETTER);
spanBuilder.setParent(extractedContext);

View File

@ -19,6 +19,7 @@ import akka.http.javadsl.model.HttpMethods
import akka.http.javadsl.model.HttpRequest
import akka.http.javadsl.model.headers.RawHeader
import akka.stream.ActorMaterializer
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.akkahttp.AkkaHttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
@ -58,11 +59,6 @@ class AkkaHttpClientInstrumentationTest extends HttpClientTest<AkkaHttpClientDec
return AkkaHttpClientDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "akka-http.request"
}
@Override
boolean testRedirects() {
false
@ -79,7 +75,7 @@ class AkkaHttpClientInstrumentationTest extends HttpClientTest<AkkaHttpClientDec
trace(0, 1) {
span(0) {
parent()
operationName "akka-http.request"
operationName HttpClientDecorator.DEFAULT_SPAN_NAME
spanKind CLIENT
errored true
tags {

View File

@ -32,11 +32,6 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest<Object,
return AkkaHttpServerDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "akka-http.request"
}
@Override
boolean testExceptionBody() {
false
@ -55,7 +50,7 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest<Object,
void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", ServerEndpoint endpoint = SUCCESS) {
trace.span(index) {
operationName expectedOperationName()
operationName expectedOperationName(method)
spanKind SERVER
errored endpoint.errored
if (parentID != null) {
@ -67,7 +62,7 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest<Object,
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" serverDecorator.getComponentName()
"$Tags.HTTP_URL" "${endpoint.resolve(address)}"
"$Tags.HTTP_URL" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
"$Tags.HTTP_METHOD" method
"$Tags.HTTP_STATUS" endpoint.status
if (endpoint.errored) {

View File

@ -15,6 +15,7 @@
*/
package io.opentelemetry.auto.instrumentation.apachehttpasyncclient;
import static io.opentelemetry.auto.decorator.HttpClientDecorator.DEFAULT_SPAN_NAME;
import static io.opentelemetry.auto.instrumentation.apachehttpasyncclient.ApacheHttpAsyncClientDecorator.DECORATE;
import static io.opentelemetry.auto.instrumentation.apachehttpasyncclient.ApacheHttpAsyncClientDecorator.TRACER;
import static io.opentelemetry.auto.instrumentation.apachehttpasyncclient.HttpHeadersInjectAdapter.SETTER;
@ -100,7 +101,7 @@ public class ApacheHttpAsyncClientInstrumentation extends Instrumenter.Default {
@Advice.Argument(value = 3, readOnly = false) FutureCallback<?> futureCallback) {
final Span parentSpan = TRACER.getCurrentSpan();
final Span clientSpan = TRACER.spanBuilder("http.request").setSpanKind(CLIENT).startSpan();
final Span clientSpan = TRACER.spanBuilder(DEFAULT_SPAN_NAME).setSpanKind(CLIENT).startSpan();
DECORATE.afterStart(clientSpan);
requestProducer = new DelegatingRequestProducer(clientSpan, requestProducer);
@ -140,6 +141,7 @@ public class ApacheHttpAsyncClientInstrumentation extends Instrumenter.Default {
@Override
public HttpRequest generateRequest() throws IOException, HttpException {
final HttpRequest request = delegate.generateRequest();
span.updateName(DECORATE.spanNameForRequest(request));
DECORATE.onRequest(span, request);
TRACER.getHttpTextFormat().inject(span.getContext(), request, SETTER);

View File

@ -85,7 +85,11 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
if (callDepth > 0) {
return null;
}
final Span span = TRACER.spanBuilder("http.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER
.spanBuilder(DECORATE.spanNameForRequest(httpMethod))
.setSpanKind(CLIENT)
.startSpan();
final Scope scope = TRACER.withSpan(span);
DECORATE.afterStart(span);

View File

@ -171,7 +171,8 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
public static class HelperMethods {
public static SpanWithScope doMethodEnter(final HttpUriRequest request) {
final Span span = TRACER.spanBuilder("http.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
final Scope scope = TRACER.withSpan(span);
DECORATE.afterStart(span);

View File

@ -47,7 +47,8 @@ public class TracingRequestHandler extends RequestHandler2 {
@Override
public void beforeRequest(final Request<?> request) {
final Span span = TRACER.spanBuilder("aws.http").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(decorate.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
decorate.afterStart(span);
decorate.onRequest(span, request);
request.addHandlerContext(

View File

@ -43,6 +43,7 @@ import com.amazonaws.services.s3.AmazonS3ClientBuilder
import com.amazonaws.services.sqs.AmazonSQSClientBuilder
import com.amazonaws.services.sqs.model.CreateQueueRequest
import com.amazonaws.services.sqs.model.SendMessageRequest
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -150,7 +151,7 @@ class AWSClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "aws.http"
operationName expectedOperationName(method)
spanKind CLIENT
errored false
parent()
@ -172,15 +173,15 @@ class AWSClientTest extends AgentTestRunner {
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName(method)
spanKind CLIENT
errored false
childOf(span(0))
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "${server.address}${path}"
"$Tags.HTTP_METHOD" "$method"
"$Tags.HTTP_STATUS" 200
@ -241,7 +242,7 @@ class AWSClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "aws.http"
operationName expectedOperationName(method)
spanKind CLIENT
errored true
parent()
@ -263,15 +264,15 @@ class AWSClientTest extends AgentTestRunner {
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName(method)
spanKind CLIENT
errored true
childOf(span(0))
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" UNUSABLE_PORT
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" UNUSABLE_PORT
"$Tags.HTTP_URL" "http://localhost:${UNUSABLE_PORT}/$url"
"$Tags.HTTP_METHOD" "$method"
errorTags HttpHostConnectException, ~/Connection refused/
@ -304,7 +305,7 @@ class AWSClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 1) {
span(0) {
operationName "aws.http"
operationName expectedOperationName("HEAD")
spanKind CLIENT
errored true
parent()
@ -349,7 +350,7 @@ class AWSClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 5) {
span(0) {
operationName "aws.http"
operationName expectedOperationName("GET")
spanKind CLIENT
errored true
parent()
@ -374,15 +375,15 @@ class AWSClientTest extends AgentTestRunner {
}
(1..4).each {
span(it) {
operationName "http.request"
operationName expectedOperationName("GET")
spanKind CLIENT
errored true
childOf(span(0))
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$server.address/someBucket/someKey"
"$Tags.HTTP_METHOD" "GET"
try {
@ -399,4 +400,8 @@ class AWSClientTest extends AgentTestRunner {
cleanup:
server.close()
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpClientDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -30,6 +30,7 @@ import com.amazonaws.services.rds.AmazonRDSClient
import com.amazonaws.services.rds.model.DeleteOptionGroupRequest
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.services.s3.S3ClientOptions
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -113,7 +114,7 @@ class AWSClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "aws.http"
operationName expectedOperationName(method)
spanKind CLIENT
errored false
parent()
@ -135,15 +136,15 @@ class AWSClientTest extends AgentTestRunner {
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName(method)
spanKind CLIENT
errored false
childOf(span(0))
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "${server.address}${path}"
"$Tags.HTTP_METHOD" "$method"
"$Tags.HTTP_STATUS" 200
@ -186,7 +187,7 @@ class AWSClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "aws.http"
operationName expectedOperationName(method)
spanKind CLIENT
errored true
parent()
@ -208,15 +209,15 @@ class AWSClientTest extends AgentTestRunner {
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName(method)
spanKind CLIENT
errored true
childOf(span(0))
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" UNUSABLE_PORT
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" UNUSABLE_PORT
"$Tags.HTTP_URL" "http://localhost:${UNUSABLE_PORT}/$url"
"$Tags.HTTP_METHOD" "$method"
errorTags HttpHostConnectException, ~/Connection refused/
@ -249,7 +250,7 @@ class AWSClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 1) {
span(0) {
operationName "aws.http"
operationName expectedOperationName("GET")
spanKind CLIENT
errored true
parent()
@ -295,7 +296,7 @@ class AWSClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 5) {
span(0) {
operationName "aws.http"
operationName expectedOperationName("GET")
spanKind CLIENT
errored true
parent()
@ -316,15 +317,15 @@ class AWSClientTest extends AgentTestRunner {
}
(1..4).each {
span(it) {
operationName "http.request"
operationName expectedOperationName("GET")
spanKind CLIENT
errored true
childOf(span(0))
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$server.address/someBucket/someKey"
"$Tags.HTTP_METHOD" "GET"
try {
@ -341,4 +342,8 @@ class AWSClientTest extends AgentTestRunner {
cleanup:
server.close()
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpClientDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -15,6 +15,7 @@
*/
package io.opentelemetry.auto.instrumentation.aws.v2;
import static io.opentelemetry.auto.decorator.HttpClientDecorator.DEFAULT_SPAN_NAME;
import static io.opentelemetry.auto.instrumentation.aws.v2.AwsSdkClientDecorator.DECORATE;
import static io.opentelemetry.auto.instrumentation.aws.v2.AwsSdkClientDecorator.TRACER;
import static io.opentelemetry.trace.Span.Kind.CLIENT;
@ -48,7 +49,7 @@ public class TracingExecutionInterceptor implements ExecutionInterceptor {
@Override
public void beforeExecution(
final Context.BeforeExecution context, final ExecutionAttributes executionAttributes) {
final Span span = TRACER.spanBuilder("aws.http").setSpanKind(CLIENT).startSpan();
final Span span = TRACER.spanBuilder(DEFAULT_SPAN_NAME).setSpanKind(CLIENT).startSpan();
try (final Scope scope = TRACER.withSpan(span)) {
DECORATE.afterStart(span);
executionAttributes.putAttribute(SPAN_ATTRIBUTE, span);
@ -60,6 +61,7 @@ public class TracingExecutionInterceptor implements ExecutionInterceptor {
final Context.AfterMarshalling context, final ExecutionAttributes executionAttributes) {
final Span span = executionAttributes.getAttribute(SPAN_ATTRIBUTE);
span.updateName(DECORATE.spanNameForRequest(context.httpRequest()));
DECORATE.onRequest(span, context.httpRequest());
DECORATE.onSdkRequest(span, context.request());
DECORATE.onAttributes(span, executionAttributes);

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -91,7 +92,7 @@ class AwsClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "aws.http"
operationName expectedOperationName(method)
spanKind CLIENT
errored false
parent()
@ -100,9 +101,9 @@ class AwsClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "$service.$operation"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$Tags.HTTP_URL" "${server.address}${path}"
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" { it.startsWith("${server.address}${path}") }
"$Tags.HTTP_METHOD" "$method"
"$Tags.HTTP_STATUS" 200
"aws.service" "$service"
@ -123,16 +124,16 @@ class AwsClientTest extends AgentTestRunner {
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName(method)
spanKind CLIENT
errored false
childOf(span(0))
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$Tags.HTTP_URL" "${server.address}${path}"
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" { it.startsWith("${server.address}${path}") }
"$Tags.HTTP_METHOD" "$method"
"$Tags.HTTP_STATUS" 200
}
@ -197,7 +198,7 @@ class AwsClientTest extends AgentTestRunner {
assertTraces(2) {
trace(0, 1) {
span(0) {
operationName "aws.http"
operationName expectedOperationName(method)
spanKind CLIENT
errored false
parent()
@ -206,9 +207,9 @@ class AwsClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "$service.$operation"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$Tags.HTTP_URL" "${server.address}${path}"
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" { it.startsWith("${server.address}${path}") }
"$Tags.HTTP_METHOD" "$method"
"$Tags.HTTP_STATUS" 200
"aws.service" "$service"
@ -232,17 +233,17 @@ class AwsClientTest extends AgentTestRunner {
// TODO: this should be part of the same trace but netty instrumentation doesn't cooperate
trace(1, 1) {
span(0) {
operationName "netty.client.request"
operationName expectedOperationName(method)
spanKind CLIENT
errored false
parent()
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "netty-client"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" server.address.port
"$Tags.HTTP_URL" "${server.address}${path}"
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" { it.startsWith("${server.address}${path}") }
"$Tags.HTTP_METHOD" "$method"
"$Tags.HTTP_STATUS" 200
}
@ -314,7 +315,7 @@ class AwsClientTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 5) {
span(0) {
operationName "aws.http"
operationName expectedOperationName("GET")
spanKind CLIENT
errored true
parent()
@ -323,8 +324,8 @@ class AwsClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "S3.GetObject"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$server.address/somebucket/somekey"
"$Tags.HTTP_METHOD" "GET"
"aws.service" "S3"
@ -336,15 +337,15 @@ class AwsClientTest extends AgentTestRunner {
}
(1..4).each {
span(it) {
operationName "http.request"
operationName expectedOperationName("GET")
spanKind CLIENT
errored true
childOf(span(0))
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$server.address/somebucket/somekey"
"$Tags.HTTP_METHOD" "GET"
errorTags SocketTimeoutException, "Read timed out"
@ -357,4 +358,8 @@ class AwsClientTest extends AgentTestRunner {
cleanup:
server.close()
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpClientDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -20,7 +20,6 @@ import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Session;
import io.opentelemetry.auto.decorator.DatabaseClientDecorator;
import io.opentelemetry.auto.instrumentation.api.SpanTypes;
import io.opentelemetry.auto.instrumentation.api.Tags;
import io.opentelemetry.trace.Span;
public class CassandraClientDecorator extends DatabaseClientDecorator<Session> {
@ -59,8 +58,7 @@ public class CassandraClientDecorator extends DatabaseClientDecorator<Session> {
public Span onResponse(final Span span, final ResultSet result) {
if (result != null) {
final Host host = result.getExecutionInfo().getQueriedHost();
span.setAttribute(Tags.PEER_PORT, host.getSocketAddress().getPort());
onPeerConnection(span, host.getSocketAddress().getAddress());
onPeerConnection(span, host.getSocketAddress());
}
return span;
}

View File

@ -136,9 +136,9 @@ class CassandraClientTest extends AgentTestRunner {
"$MoreTags.SERVICE_NAME" renameService && keyspace ? keyspace : "cassandra"
"$MoreTags.SPAN_TYPE" SpanTypes.CASSANDRA
"$Tags.COMPONENT" "java-cassandra"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" EmbeddedCassandraServerHelper.getNativeTransportPort()
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" EmbeddedCassandraServerHelper.getNativeTransportPort()
"$Tags.DB_TYPE" "cassandra"
"$Tags.DB_INSTANCE" keyspace
"$Tags.DB_STATEMENT" statement

View File

@ -30,7 +30,7 @@ import com.couchbase.client.java.transcoder.crypto.JsonCryptoTranscoder;
import com.google.auto.service.AutoService;
import io.opentelemetry.auto.bootstrap.ContextStore;
import io.opentelemetry.auto.bootstrap.InstrumentationContext;
import io.opentelemetry.auto.instrumentation.api.Tags;
import io.opentelemetry.auto.instrumentation.api.MoreTags;
import io.opentelemetry.auto.tooling.Instrumenter;
import io.opentelemetry.trace.Span;
import java.util.Map;
@ -92,13 +92,13 @@ public class CouchbaseNetworkInstrumentation extends Instrumenter.Default {
final Span span = contextStore.get(request);
if (span != null) {
span.setAttribute(Tags.PEER_HOSTNAME, remoteHostname);
span.setAttribute(MoreTags.NET_PEER_NAME, remoteHostname);
if (remoteSocket != null) {
final int splitIndex = remoteSocket.lastIndexOf(":");
if (splitIndex != -1) {
span.setAttribute(
Tags.PEER_PORT, Integer.parseInt(remoteSocket.substring(splitIndex + 1)));
MoreTags.NET_PEER_PORT, Integer.parseInt(remoteSocket.substring(splitIndex + 1)));
}
}

View File

@ -41,8 +41,8 @@ class CouchbaseSpanUtil {
"$Tags.COMPONENT" "couchbase-client"
// Because of caching, not all requests hit the server so these tags may be absent
"$Tags.PEER_HOSTNAME" { it == "localhost" || it == "127.0.0.1" || it == null }
"$Tags.PEER_PORT" { it == null || Number }
"$MoreTags.NET_PEER_NAME" { it == "localhost" || it == "127.0.0.1" || it == null }
"$MoreTags.NET_PEER_PORT" { it == null || Number }
"$Tags.DB_TYPE" "couchbase"
if (bucketName != null) {

View File

@ -20,6 +20,7 @@ import io.dropwizard.setup.Environment
import javax.ws.rs.GET
import javax.ws.rs.Path
import javax.ws.rs.PathParam
import javax.ws.rs.QueryParam
import javax.ws.rs.container.AsyncResponse
import javax.ws.rs.container.Suspended
@ -28,6 +29,7 @@ import java.util.concurrent.Executors
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.EXCEPTION
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.QUERY_PARAM
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.REDIRECT
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.SUCCESS
@ -106,5 +108,15 @@ class DropwizardAsyncTest extends DropwizardTest {
}
}
}
@GET
@Path("path/{id}/param")
Response path_param(@PathParam("id") int param, @Suspended final AsyncResponse asyncResponse) {
executor.execute {
controller(PATH_PARAM) {
asyncResponse.resume(Response.status(PATH_PARAM.status).entity(param.toString()).build())
}
}
}
}
}

View File

@ -32,11 +32,13 @@ import org.eclipse.jetty.servlet.ServletHandler
import javax.ws.rs.GET
import javax.ws.rs.Path
import javax.ws.rs.PathParam
import javax.ws.rs.QueryParam
import javax.ws.rs.core.Response
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.EXCEPTION
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.QUERY_PARAM
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.REDIRECT
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.SUCCESS
@ -79,11 +81,6 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport, Servlet3Decor
}
}
@Override
String expectedOperationName() {
return "servlet.request"
}
@Override
boolean hasHandlerSpan() {
true
@ -94,6 +91,11 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport, Servlet3Decor
false
}
@Override
boolean testPathParam() {
true
}
boolean testExceptionBody() {
false
}
@ -119,7 +121,7 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport, Servlet3Decor
@Override
void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", ServerEndpoint endpoint = SUCCESS) {
trace.span(index) {
operationName expectedOperationName()
operationName "$method ${endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path}"
spanKind SERVER
errored endpoint.errored
if (parentID != null) {
@ -129,12 +131,12 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport, Servlet3Decor
parent()
}
tags {
"$MoreTags.RESOURCE_NAME" "$method ${endpoint.resolve(address).path}"
"$MoreTags.RESOURCE_NAME" "$method ${endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path}"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" serverDecorator.getComponentName()
"$Tags.PEER_HOST_IPV4" { it == null || it == "127.0.0.1" } // Optional
"$Tags.PEER_PORT" Long
"$Tags.HTTP_URL" "${endpoint.resolve(address)}"
"$MoreTags.NET_PEER_IP" { it == null || it == "127.0.0.1" } // Optional
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
"$Tags.HTTP_METHOD" method
"$Tags.HTTP_STATUS" endpoint.status
"span.origin.type" ServletHandler.CachedChain.name
@ -211,6 +213,14 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport, Servlet3Decor
}
return null
}
@GET
@Path("path/{id}/param")
Response path_param(@PathParam("id") int param) {
controller(PATH_PARAM) {
Response.status(PATH_PARAM.status).entity(param.toString()).build()
}
}
}
@Path("/")

View File

@ -17,6 +17,7 @@ package io.opentelemetry.auto.instrumentation.elasticsearch;
import io.opentelemetry.OpenTelemetry;
import io.opentelemetry.auto.decorator.DatabaseClientDecorator;
import io.opentelemetry.auto.instrumentation.api.MoreTags;
import io.opentelemetry.auto.instrumentation.api.SpanTypes;
import io.opentelemetry.auto.instrumentation.api.Tags;
import io.opentelemetry.trace.Span;
@ -67,8 +68,8 @@ public class ElasticsearchRestClientDecorator extends DatabaseClientDecorator {
public Span onResponse(final Span span, final Response response) {
if (response != null && response.getHost() != null) {
span.setAttribute(Tags.PEER_HOSTNAME, response.getHost().getHostName());
span.setAttribute(Tags.PEER_PORT, response.getHost().getPort());
span.setAttribute(MoreTags.NET_PEER_NAME, response.getHost().getHostName());
span.setAttribute(MoreTags.NET_PEER_PORT, response.getHost().getPort());
}
return span;
}

View File

@ -14,6 +14,7 @@
* limitations under the License.
*/
import groovy.json.JsonSlurper
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -103,15 +104,15 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
"$MoreTags.SERVICE_NAME" "elasticsearch"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" httpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" httpPort
"$Tags.HTTP_URL" "_cluster/health"
"$Tags.HTTP_METHOD" "GET"
"$Tags.DB_TYPE" "elasticsearch"
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
tags {
@ -125,4 +126,8 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
}
}
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpClientDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -14,6 +14,7 @@
* limitations under the License.
*/
import groovy.json.JsonSlurper
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -107,15 +108,15 @@ class Elasticsearch5RestClientTest extends AgentTestRunner {
"$MoreTags.SERVICE_NAME" "elasticsearch"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" httpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" httpPort
"$Tags.HTTP_URL" "_cluster/health"
"$Tags.HTTP_METHOD" "GET"
"$Tags.DB_TYPE" "elasticsearch"
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
tags {
@ -129,4 +130,8 @@ class Elasticsearch5RestClientTest extends AgentTestRunner {
}
}
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpClientDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -14,6 +14,7 @@
* limitations under the License.
*/
import groovy.json.JsonSlurper
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -107,15 +108,15 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
"$MoreTags.SERVICE_NAME" "elasticsearch"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" httpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" httpPort
"$Tags.HTTP_URL" "_cluster/health"
"$Tags.HTTP_METHOD" "GET"
"$Tags.DB_TYPE" "elasticsearch"
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
tags {
@ -138,4 +139,8 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
@Override
protected void registerDerivedNodeNameWithLogger(String nodeName) {}
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpClientDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -14,6 +14,7 @@
* limitations under the License.
*/
import groovy.json.JsonSlurper
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -103,15 +104,15 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
"$MoreTags.SERVICE_NAME" "elasticsearch"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" httpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" httpPort
"$Tags.HTTP_URL" "_cluster/health"
"$Tags.HTTP_METHOD" "GET"
"$Tags.DB_TYPE" "elasticsearch"
}
}
span(1) {
operationName "http.request"
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
tags {
@ -125,4 +126,8 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
}
}
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpClientDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -106,9 +106,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "ClusterHealthAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "ClusterHealthAction"
"elasticsearch.request" "ClusterHealthRequest"
@ -209,9 +209,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CreateIndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "CreateIndexAction"
"elasticsearch.request" "CreateIndexRequest"
@ -228,9 +228,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "ClusterHealthAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "ClusterHealthAction"
"elasticsearch.request" "ClusterHealthRequest"
@ -246,9 +246,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"
@ -284,9 +284,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"
@ -304,9 +304,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"

View File

@ -18,7 +18,7 @@ package io.opentelemetry.auto.instrumentation.elasticsearch2;
import static io.opentelemetry.auto.instrumentation.elasticsearch.ElasticsearchTransportClientDecorator.DECORATE;
import com.google.common.base.Joiner;
import io.opentelemetry.auto.instrumentation.api.Tags;
import io.opentelemetry.auto.instrumentation.api.MoreTags;
import io.opentelemetry.trace.Span;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
@ -71,9 +71,9 @@ public class TransportActionListener<T extends ActionResponse> implements Action
@Override
public void onResponse(final T response) {
if (response.remoteAddress() != null) {
span.setAttribute(Tags.PEER_HOSTNAME, response.remoteAddress().getHost());
span.setAttribute(Tags.PEER_HOST_IPV4, response.remoteAddress().getAddress());
span.setAttribute(Tags.PEER_PORT, response.remoteAddress().getPort());
span.setAttribute(MoreTags.NET_PEER_NAME, response.remoteAddress().getHost());
span.setAttribute(MoreTags.NET_PEER_IP, response.remoteAddress().getAddress());
span.setAttribute(MoreTags.NET_PEER_PORT, response.remoteAddress().getPort());
}
if (response instanceof GetResponse) {

View File

@ -226,9 +226,9 @@ class Elasticsearch2NodeClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"
@ -264,9 +264,9 @@ class Elasticsearch2NodeClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"
@ -284,9 +284,9 @@ class Elasticsearch2NodeClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"

View File

@ -107,9 +107,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "ClusterHealthAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "127.0.0.1"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "127.0.0.1"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "ClusterHealthAction"
"elasticsearch.request" "ClusterHealthRequest"
@ -139,9 +139,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "ClusterStatsAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "127.0.0.1"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "127.0.0.1"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "ClusterStatsAction"
"elasticsearch.request" "ClusterStatsRequest"
@ -243,9 +243,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CreateIndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "127.0.0.1"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "127.0.0.1"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "CreateIndexAction"
"elasticsearch.request" "CreateIndexRequest"
@ -262,9 +262,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "ClusterHealthAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "127.0.0.1"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "127.0.0.1"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "ClusterHealthAction"
"elasticsearch.request" "ClusterHealthRequest"
@ -280,9 +280,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "127.0.0.1"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "127.0.0.1"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"
@ -318,9 +318,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "127.0.0.1"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "127.0.0.1"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"
@ -338,9 +338,9 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "127.0.0.1"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "127.0.0.1"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"

View File

@ -98,9 +98,9 @@ class Elasticsearch2SpringRepositoryTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"
@ -145,9 +145,9 @@ class Elasticsearch2SpringRepositoryTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"
@ -179,9 +179,9 @@ class Elasticsearch2SpringRepositoryTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"
@ -218,9 +218,9 @@ class Elasticsearch2SpringRepositoryTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"
@ -251,9 +251,9 @@ class Elasticsearch2SpringRepositoryTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "DeleteAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "DeleteAction"
"elasticsearch.request" "DeleteRequest"

View File

@ -227,9 +227,9 @@ class Elasticsearch2SpringTemplateTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "local"
"$Tags.PEER_HOST_IPV4" "0.0.0.0"
"$Tags.PEER_PORT" 0
"$MoreTags.NET_PEER_NAME" "local"
"$MoreTags.NET_PEER_IP" "0.0.0.0"
"$MoreTags.NET_PEER_PORT" 0
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"

View File

@ -18,7 +18,7 @@ package io.opentelemetry.auto.instrumentation.elasticsearch5;
import static io.opentelemetry.auto.instrumentation.elasticsearch.ElasticsearchTransportClientDecorator.DECORATE;
import com.google.common.base.Joiner;
import io.opentelemetry.auto.instrumentation.api.Tags;
import io.opentelemetry.auto.instrumentation.api.MoreTags;
import io.opentelemetry.trace.Span;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
@ -73,9 +73,9 @@ public class TransportActionListener<T extends ActionResponse> implements Action
@Override
public void onResponse(final T response) {
if (response.remoteAddress() != null) {
span.setAttribute(Tags.PEER_HOSTNAME, response.remoteAddress().getHost());
span.setAttribute(Tags.PEER_HOST_IPV4, response.remoteAddress().getAddress());
span.setAttribute(Tags.PEER_PORT, response.remoteAddress().getPort());
span.setAttribute(MoreTags.NET_PEER_NAME, response.remoteAddress().getHost());
span.setAttribute(MoreTags.NET_PEER_IP, response.remoteAddress().getAddress());
span.setAttribute(MoreTags.NET_PEER_PORT, response.remoteAddress().getPort());
}
if (response instanceof GetResponse) {

View File

@ -113,9 +113,9 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "ClusterHealthAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" String
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" String
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "ClusterHealthAction"
"elasticsearch.request" "ClusterHealthRequest"
@ -216,9 +216,9 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CreateIndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" String
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" String
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "CreateIndexAction"
"elasticsearch.request" "CreateIndexRequest"
@ -235,9 +235,9 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" String
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" String
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"
@ -272,9 +272,9 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" String
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" String
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"
@ -296,9 +296,9 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" String
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" String
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"

View File

@ -18,7 +18,7 @@ package io.opentelemetry.auto.instrumentation.elasticsearch5_3;
import static io.opentelemetry.auto.instrumentation.elasticsearch.ElasticsearchTransportClientDecorator.DECORATE;
import com.google.common.base.Joiner;
import io.opentelemetry.auto.instrumentation.api.Tags;
import io.opentelemetry.auto.instrumentation.api.MoreTags;
import io.opentelemetry.trace.Span;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
@ -74,9 +74,9 @@ public class TransportActionListener<T extends ActionResponse> implements Action
@Override
public void onResponse(final T response) {
if (response.remoteAddress() != null) {
span.setAttribute(Tags.PEER_HOSTNAME, response.remoteAddress().getHost());
span.setAttribute(Tags.PEER_HOST_IPV4, response.remoteAddress().getAddress());
span.setAttribute(Tags.PEER_PORT, response.remoteAddress().getPort());
span.setAttribute(MoreTags.NET_PEER_NAME, response.remoteAddress().getHost());
span.setAttribute(MoreTags.NET_PEER_IP, response.remoteAddress().getAddress());
span.setAttribute(MoreTags.NET_PEER_PORT, response.remoteAddress().getPort());
}
if (response instanceof GetResponse) {

View File

@ -113,9 +113,9 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "ClusterHealthAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "ClusterHealthAction"
"elasticsearch.request" "ClusterHealthRequest"
@ -216,9 +216,9 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CreateIndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "CreateIndexAction"
"elasticsearch.request" "CreateIndexRequest"
@ -235,9 +235,9 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"
@ -272,9 +272,9 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"
@ -297,9 +297,9 @@ class Elasticsearch53TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"

View File

@ -18,7 +18,7 @@ package io.opentelemetry.auto.instrumentation.elasticsearch6;
import static io.opentelemetry.auto.instrumentation.elasticsearch.ElasticsearchTransportClientDecorator.DECORATE;
import com.google.common.base.Joiner;
import io.opentelemetry.auto.instrumentation.api.Tags;
import io.opentelemetry.auto.instrumentation.api.MoreTags;
import io.opentelemetry.trace.Span;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
@ -78,9 +78,9 @@ public class TransportActionListener<T extends ActionResponse> implements Action
@Override
public void onResponse(final T response) {
if (response.remoteAddress() != null) {
span.setAttribute(Tags.PEER_HOSTNAME, response.remoteAddress().address().getHostName());
span.setAttribute(Tags.PEER_HOST_IPV4, response.remoteAddress().getAddress());
span.setAttribute(Tags.PEER_PORT, response.remoteAddress().getPort());
span.setAttribute(MoreTags.NET_PEER_NAME, response.remoteAddress().address().getHostName());
span.setAttribute(MoreTags.NET_PEER_IP, response.remoteAddress().getAddress());
span.setAttribute(MoreTags.NET_PEER_PORT, response.remoteAddress().getPort());
}
if (response instanceof GetResponse) {

View File

@ -110,9 +110,9 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "ClusterHealthAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "ClusterHealthAction"
"elasticsearch.request" "ClusterHealthRequest"
@ -213,9 +213,9 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CreateIndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "CreateIndexAction"
"elasticsearch.request" "CreateIndexRequest"
@ -232,9 +232,9 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"
@ -269,9 +269,9 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "IndexAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "IndexAction"
"elasticsearch.request" "IndexRequest"
@ -294,9 +294,9 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GetAction"
"$MoreTags.SPAN_TYPE" SpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" tcpPort
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" tcpPort
"$Tags.DB_TYPE" "elasticsearch"
"elasticsearch.action" "GetAction"
"elasticsearch.request" "GetRequest"

View File

@ -30,6 +30,7 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import com.google.auto.service.AutoService;
import com.twitter.finagle.http.Request;
import com.twitter.finagle.http.Response;
import com.twitter.finatra.http.contexts.RouteInfo;
import com.twitter.util.Future;
import com.twitter.util.FutureEventListener;
import io.opentelemetry.auto.config.Config;
@ -91,15 +92,16 @@ public class FinatraInstrumentation extends Instrumenter.Default {
@Advice.OnMethodEnter(suppress = Throwable.class)
public static SpanWithScope nameSpan(
@Advice.Argument(0) final Request request,
@Advice.FieldValue("path") final String path,
@Advice.FieldValue("routeInfo") final RouteInfo routeInfo,
@Advice.FieldValue("clazz") final Class clazz,
@Advice.Origin final Method method) {
// Update the parent "netty.request"
final Span parent = TRACER.getCurrentSpan();
parent.setAttribute(MoreTags.RESOURCE_NAME, request.method().name() + " " + path);
final String resourceName = request.method().name() + " " + routeInfo.path();
parent.setAttribute(MoreTags.RESOURCE_NAME, resourceName);
parent.setAttribute(Tags.COMPONENT, "finatra");
parent.updateName("finatra.request");
parent.updateName(resourceName);
final Span span = TRACER.spanBuilder("finatra.controller").startSpan();
DECORATE.afterStart(span);

View File

@ -29,6 +29,7 @@ import java.util.concurrent.TimeoutException
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.ERROR
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.EXCEPTION
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM
import static io.opentelemetry.auto.test.base.HttpServerTest.ServerEndpoint.SUCCESS
import static io.opentelemetry.trace.Span.Kind.INTERNAL
import static io.opentelemetry.trace.Span.Kind.SERVER
@ -80,8 +81,8 @@ class FinatraServerTest extends HttpServerTest<HttpServer, FinatraDecorator> {
}
@Override
String expectedOperationName() {
return "finatra.request"
boolean testPathParam() {
true
}
@Override
@ -107,7 +108,7 @@ class FinatraServerTest extends HttpServerTest<HttpServer, FinatraDecorator> {
@Override
void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", ServerEndpoint endpoint = SUCCESS) {
trace.span(index) {
operationName expectedOperationName()
operationName "$method ${endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.resolvePath(address).path}"
spanKind SERVER
errored endpoint.errored
if (parentID != null) {
@ -117,12 +118,12 @@ class FinatraServerTest extends HttpServerTest<HttpServer, FinatraDecorator> {
parent()
}
tags {
"$MoreTags.RESOURCE_NAME" "$method ${endpoint.resolve(address).path}"
"$MoreTags.RESOURCE_NAME" "$method ${endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.resolvePath(address).path}"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" serverDecorator.getComponentName()
"$Tags.PEER_PORT" Long
"$Tags.PEER_HOST_IPV4" { it == null || it == "127.0.0.1" } // Optional
"$Tags.HTTP_URL" "${endpoint.resolve(address)}"
"$MoreTags.NET_PEER_PORT" Long
"$MoreTags.NET_PEER_IP" { it == null || it == "127.0.0.1" } // Optional
"$Tags.HTTP_URL" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
"$Tags.HTTP_METHOD" method
"$Tags.HTTP_STATUS" endpoint.status
if (endpoint.query) {

View File

@ -68,4 +68,12 @@ class FinatraController extends Controller {
}
})
}
any("/path/:id/param") { request : Request =>
controller(PATH_PARAM, new Closure[Response](null) {
override def call(): Response = {
response.ok(request.params("id"))
}
})
}
}

View File

@ -105,7 +105,11 @@ public class GoogleHttpClientInstrumentation extends Instrumenter.Default {
if (state == null) {
state =
new RequestState(TRACER.spanBuilder("http.request").setSpanKind(CLIENT).startSpan());
new RequestState(
TRACER
.spanBuilder(DECORATE.spanNameForRequest(request))
.setSpanKind(CLIENT)
.startSpan());
contextStore.put(request, state);
}
@ -153,7 +157,8 @@ public class GoogleHttpClientInstrumentation extends Instrumenter.Default {
@Advice.OnMethodEnter(suppress = Throwable.class)
public static void methodEnter(@Advice.This final HttpRequest request) {
final Span span = TRACER.spanBuilder("http.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
final ContextStore<HttpRequest, RequestState> contextStore =
InstrumentationContext.get(HttpRequest.class, RequestState.class);

View File

@ -79,9 +79,9 @@ abstract class AbstractGoogleHttpClientTest extends HttpClientTest<GoogleHttpCli
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "google-http-client"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" Long
"$Tags.HTTP_URL" "${uri.resolve(uri.path)}"
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "${uri}"
"$Tags.HTTP_METHOD" method
"$Tags.HTTP_STATUS" 500
"$MoreTags.ERROR_MSG" "Server Error"

View File

@ -85,7 +85,8 @@ public class GrizzlyHttpHandlerInstrumentation extends Instrumenter.Default {
return null;
}
final Span.Builder spanBuilder = TRACER.spanBuilder("grizzly.request").setSpanKind(SERVER);
final Span.Builder spanBuilder =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(SERVER);
try {
final SpanContext extractedContext = TRACER.getHttpTextFormat().extract(request, GETTER);
spanBuilder.setParent(extractedContext);

View File

@ -56,11 +56,6 @@ class GrizzlyTest extends HttpServerTest<HttpServer, GrizzlyDecorator> {
return GrizzlyDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "grizzly.request"
}
static class SimpleExceptionMapper implements ExceptionMapper<Throwable> {
@Override

View File

@ -138,8 +138,6 @@ public class HttpUrlConnectionInstrumentation extends Instrumenter.Default {
public static class HttpUrlState {
public static final String OPERATION_NAME = "http.request";
public static final ContextStore.Factory<HttpUrlState> FACTORY =
new ContextStore.Factory<HttpUrlState>() {
@Override
@ -152,7 +150,11 @@ public class HttpUrlConnectionInstrumentation extends Instrumenter.Default {
private volatile boolean finished = false;
public Span start(final HttpURLConnection connection) {
span = TRACER.spanBuilder(OPERATION_NAME).setSpanKind(CLIENT).startSpan();
span =
TRACER
.spanBuilder(DECORATE.spanNameForRequest(connection))
.setSpanKind(CLIENT)
.startSpan();
try (final Scope scope = TRACER.withSpan(span)) {
DECORATE.afterStart(span);
DECORATE.onRequest(span, connection);

View File

@ -96,10 +96,10 @@ public class UrlInstrumentation extends Instrumenter.Default {
try (final Scope scope = TRACER.withSpan(span)) {
span.setAttribute(Tags.HTTP_URL, url.toString());
span.setAttribute(Tags.PEER_PORT, url.getPort() == -1 ? 80 : url.getPort());
span.setAttribute(MoreTags.NET_PEER_PORT, url.getPort() == -1 ? 80 : url.getPort());
final String host = url.getHost();
if (host != null && !host.isEmpty()) {
span.setAttribute(Tags.PEER_HOSTNAME, host);
span.setAttribute(MoreTags.NET_PEER_NAME, host);
if (Config.get().isHttpClientSplitByDomain()) {
span.setAttribute(MoreTags.SERVICE_NAME, host);
}

View File

@ -23,7 +23,6 @@ import spock.lang.Ignore
import spock.lang.Requires
import sun.net.www.protocol.https.HttpsURLConnectionImpl
import static io.opentelemetry.auto.instrumentation.http_url_connection.HttpUrlConnectionInstrumentation.HttpUrlState.OPERATION_NAME
import static io.opentelemetry.auto.test.utils.ConfigUtils.withConfigOverride
import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace
import static io.opentelemetry.trace.Span.Kind.CLIENT
@ -104,7 +103,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
}
}
span(1) {
operationName OPERATION_NAME
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
errored false
@ -113,15 +112,15 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
"$MoreTags.RESOURCE_NAME" "GET $url.path"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "http-url-connection"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$url"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" STATUS
}
}
span(2) {
operationName OPERATION_NAME
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
errored false
@ -130,8 +129,8 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
"$MoreTags.RESOURCE_NAME" "GET $url.path"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "http-url-connection"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$url"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" STATUS
@ -186,7 +185,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
}
}
span(1) {
operationName OPERATION_NAME
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
errored false
@ -195,15 +194,15 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
"$MoreTags.RESOURCE_NAME" "GET $url.path"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "http-url-connection"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$url"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" STATUS
}
}
span(2) {
operationName OPERATION_NAME
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
errored false
@ -212,8 +211,8 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
"$MoreTags.RESOURCE_NAME" "GET $url.path"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "http-url-connection"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$url"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" STATUS
@ -253,7 +252,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
}
}
span(1) {
operationName OPERATION_NAME
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
errored false
@ -262,8 +261,8 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
"$MoreTags.RESOURCE_NAME" "GET $url.path"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "http-url-connection"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$url"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" STATUS
@ -319,7 +318,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
}
}
span(1) {
operationName OPERATION_NAME
operationName expectedOperationName("POST")
spanKind CLIENT
childOf span(0)
errored false
@ -328,8 +327,8 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpUrlConnectionDecorator> {
"$MoreTags.RESOURCE_NAME" "POST $url.path"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "http-url-connection"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" server.address.port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" server.address.port
"$Tags.HTTP_URL" "$url"
"$Tags.HTTP_METHOD" "POST"
"$Tags.HTTP_STATUS" STATUS

View File

@ -15,13 +15,13 @@
*/
import io.opentelemetry.auto.bootstrap.AgentClassLoader
import io.opentelemetry.auto.config.Config
import io.opentelemetry.auto.decorator.HttpClientDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
import io.opentelemetry.auto.instrumentation.http_url_connection.UrlInstrumentation
import io.opentelemetry.auto.test.AgentTestRunner
import static io.opentelemetry.auto.instrumentation.http_url_connection.HttpUrlConnectionInstrumentation.HttpUrlState.OPERATION_NAME
import static io.opentelemetry.auto.test.utils.ConfigUtils.withConfigOverride
import static io.opentelemetry.auto.test.utils.PortUtils.UNUSABLE_PORT
import static io.opentelemetry.auto.test.utils.TraceUtils.runUnderTrace
@ -56,7 +56,7 @@ class UrlConnectionTest extends AgentTestRunner {
}
}
span(1) {
operationName OPERATION_NAME
operationName expectedOperationName("GET")
spanKind CLIENT
childOf span(0)
errored true
@ -64,8 +64,8 @@ class UrlConnectionTest extends AgentTestRunner {
"$MoreTags.SERVICE_NAME" renameService ? "localhost" : null
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "http-url-connection"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_PORT" UNUSABLE_PORT
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_PORT" UNUSABLE_PORT
"$Tags.HTTP_URL" "$url/"
"$Tags.HTTP_METHOD" "GET"
errorTags ConnectException, String
@ -115,7 +115,7 @@ class UrlConnectionTest extends AgentTestRunner {
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" UrlInstrumentation.COMPONENT
"$Tags.PEER_PORT" 80
"$MoreTags.NET_PEER_PORT" 80
// FIXME: These tags really make no sense for non-http connections, why do we set them?
"$Tags.HTTP_URL" "$url"
errorTags IllegalArgumentException, String
@ -155,4 +155,8 @@ class UrlConnectionTest extends AgentTestRunner {
}
}
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpClientDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -89,7 +89,11 @@ public final class JaxRsClientV1Instrumentation extends Instrumenter.Default {
// WARNING: this might be a chain...so we only have to trace the first in the chain.
final boolean isRootClientHandler = null == request.getProperties().get(SPAN_ATTRIBUTE);
if (isRootClientHandler) {
final Span span = TRACER.spanBuilder("jax-rs.client.call").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER
.spanBuilder(DECORATE.spanNameForRequest(request))
.setSpanKind(CLIENT)
.startSpan();
DECORATE.afterStart(span);
DECORATE.onRequest(span, request);
request.getProperties().put(SPAN_ATTRIBUTE, span);

View File

@ -48,11 +48,6 @@ class JaxRsClientV1Test extends HttpClientTest<JaxRsClientV1Decorator> {
return JaxRsClientV1Decorator.DECORATE
}
@Override
String expectedOperationName() {
return "jax-rs.client.call"
}
boolean testCircularRedirects() {
false
}

View File

@ -37,7 +37,11 @@ public class ClientTracingFilter implements ClientRequestFilter, ClientResponseF
@Override
public void filter(final ClientRequestContext requestContext) {
final Span span = TRACER.spanBuilder("jax-rs.client.call").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER
.spanBuilder(DECORATE.spanNameForRequest(requestContext))
.setSpanKind(CLIENT)
.startSpan();
try (final Scope scope = TRACER.withSpan(span)) {
DECORATE.afterStart(span);
DECORATE.onRequest(span, requestContext);

View File

@ -64,11 +64,6 @@ abstract class JaxRsClientAsyncTest extends HttpClientTest<JaxRsClientDecorator>
return JaxRsClientDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "jax-rs.client.call"
}
abstract ClientBuilder builder()
}

View File

@ -48,11 +48,6 @@ abstract class JaxRsClientTest extends HttpClientTest<JaxRsClientDecorator> {
return JaxRsClientDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "jax-rs.client.call"
}
abstract ClientBuilder builder()
}

View File

@ -75,6 +75,7 @@ public class JaxRsAnnotationsDecorator extends BaseDecorator {
span.setAttribute(Tags.COMPONENT, "jax-rs");
if (!resourceName.isEmpty()) {
span.updateName(resourceName);
span.setAttribute(MoreTags.RESOURCE_NAME, resourceName);
}
}

View File

@ -67,7 +67,7 @@ class JaxRsAnnotationsInstrumentationTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "test"
operationName name
parent()
tags {
"$MoreTags.RESOURCE_NAME" name

View File

@ -46,7 +46,7 @@ class JerseyTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "test.span"
operationName expectedResourceName
tags {
"$MoreTags.RESOURCE_NAME" expectedResourceName
"$Tags.COMPONENT" "jax-rs"

View File

@ -86,6 +86,7 @@ public class JaxRsAnnotationsDecorator extends BaseDecorator {
span.setAttribute(Tags.COMPONENT, "jax-rs");
if (!resourceName.isEmpty()) {
span.updateName(resourceName);
span.setAttribute(MoreTags.RESOURCE_NAME, resourceName);
}
}

View File

@ -67,7 +67,7 @@ class JaxRsAnnotationsInstrumentationTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "test"
operationName name
parent()
tags {
"$MoreTags.RESOURCE_NAME" name

View File

@ -74,7 +74,7 @@ abstract class JaxRsFilterTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "test.span"
operationName parentResourceName != null ? parentResourceName : "test.span"
tags {
"$MoreTags.RESOURCE_NAME" parentResourceName
"$Tags.COMPONENT" "jax-rs"

View File

@ -42,7 +42,8 @@ public class JettyHandlerAdvice {
return null;
}
final Span.Builder spanBuilder = TRACER.spanBuilder("jetty.request").setSpanKind(SERVER);
final String resourceName = req.getMethod() + " " + source.getClass().getName();
final Span.Builder spanBuilder = TRACER.spanBuilder(resourceName).setSpanKind(SERVER);
try {
final SpanContext extractedContext = TRACER.getHttpTextFormat().extract(req, GETTER);
spanBuilder.setParent(extractedContext);
@ -56,7 +57,6 @@ public class JettyHandlerAdvice {
DECORATE.afterStart(span);
DECORATE.onConnection(span, req);
DECORATE.onRequest(span, req);
final String resourceName = req.getMethod() + " " + source.getClass().getName();
span.setAttribute(MoreTags.RESOURCE_NAME, resourceName);
req.setAttribute(SPAN_ATTRIBUTE, span);

View File

@ -77,11 +77,6 @@ class JettyHandlerTest extends HttpServerTest<Server, JettyDecorator> {
return JettyDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "jetty.request"
}
@Override
boolean testExceptionBody() {
false
@ -134,7 +129,7 @@ class JettyHandlerTest extends HttpServerTest<Server, JettyDecorator> {
void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", ServerEndpoint endpoint = SUCCESS) {
def handlerName = handler().class.name
trace.span(index) {
operationName expectedOperationName()
operationName "$method $handlerName"
spanKind SERVER
errored endpoint.errored
if (parentID != null) {
@ -147,9 +142,9 @@ class JettyHandlerTest extends HttpServerTest<Server, JettyDecorator> {
"$MoreTags.RESOURCE_NAME" "$method $handlerName"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" serverDecorator.getComponentName()
"$Tags.PEER_HOST_IPV4" { it == null || it == "127.0.0.1" } // Optional
"$Tags.PEER_PORT" Long
"$Tags.HTTP_URL" "${endpoint.resolve(address)}"
"$MoreTags.NET_PEER_IP" { it == null || it == "127.0.0.1" } // Optional
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
"$Tags.HTTP_METHOD" method
"$Tags.HTTP_STATUS" endpoint.status
"span.origin.type" handlerName

View File

@ -14,6 +14,7 @@
* limitations under the License.
*/
import com.google.common.io.Files
import io.opentelemetry.auto.decorator.HttpServerDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -106,14 +107,14 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
trace(0, 3) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/$jspFileName"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
@ -174,15 +175,15 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
trace(0, 3) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/getQuery.jsp"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/getQuery.jsp?$queryString"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
@ -239,14 +240,14 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
trace(0, 3) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("POST")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/post.jsp"
"$Tags.HTTP_METHOD" "POST"
"$Tags.HTTP_STATUS" 200
@ -301,14 +302,14 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
trace(0, 3) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored true
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/$jspFileName"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 500
@ -382,14 +383,14 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
trace(0, 3) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/includes/includeHtml.jsp"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
@ -443,14 +444,14 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
trace(0, 7) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/includes/includeMulti.jsp"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
@ -552,14 +553,14 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
trace(0, 2) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored true
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/$jspFileName"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 500
@ -610,7 +611,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
span(0) {
parent()
// serviceName jspWebappContext
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
// FIXME: this is not a great resource name for serving static content.
// resourceName "GET /$jspWebappContext/$staticFile"
@ -618,8 +619,8 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/$staticFile"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
@ -637,4 +638,8 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
where:
staticFile = "common/hello.html"
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpServerDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -14,6 +14,7 @@
* limitations under the License.
*/
import com.google.common.io.Files
import io.opentelemetry.auto.decorator.HttpServerDecorator
import io.opentelemetry.auto.instrumentation.api.MoreTags
import io.opentelemetry.auto.instrumentation.api.SpanTypes
import io.opentelemetry.auto.instrumentation.api.Tags
@ -105,14 +106,14 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
trace(0, 5) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/$forwardFromFileName"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
@ -196,14 +197,14 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
trace(0, 3) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/forwards/forwardToHtml.jsp"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
@ -257,14 +258,14 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
trace(0, 9) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/forwards/forwardToIncludeMulti.jsp"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
@ -393,14 +394,14 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
trace(0, 7) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/forwards/forwardToJspForward.jsp"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
@ -504,14 +505,14 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
trace(0, 4) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored true
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/forwards/forwardToCompileError.jsp"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 500
@ -580,14 +581,14 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
trace(0, 3) {
span(0) {
parent()
operationName "servlet.request"
operationName expectedOperationName("GET")
spanKind SERVER
errored false
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "java-web-servlet"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "http://localhost:$port/$jspWebappContext/forwards/forwardToNonExistent.jsp"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 404
@ -627,4 +628,8 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
cleanup:
res.close()
}
String expectedOperationName(String method) {
return method != null ? "HTTP $method" : HttpServerDecorator.DEFAULT_SPAN_NAME
}
}

View File

@ -64,8 +64,8 @@ public class LettuceClientDecorator extends DatabaseClientDecorator<RedisURI> {
@Override
public Span onConnection(final Span span, final RedisURI connection) {
if (connection != null) {
span.setAttribute(Tags.PEER_HOSTNAME, connection.getHost());
span.setAttribute(Tags.PEER_PORT, connection.getPort());
span.setAttribute(MoreTags.NET_PEER_NAME, connection.getHost());
span.setAttribute(MoreTags.NET_PEER_PORT, connection.getPort());
span.setAttribute("db.redis.dbIndex", connection.getDatabase());
span.setAttribute(

View File

@ -140,8 +140,8 @@ class LettuceAsyncClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CONNECT:" + dbAddr
"$MoreTags.SPAN_TYPE" SpanTypes.REDIS
"$Tags.COMPONENT" "redis-client"
"$Tags.PEER_HOSTNAME" HOST
"$Tags.PEER_PORT" port
"$MoreTags.NET_PEER_NAME" HOST
"$MoreTags.NET_PEER_PORT" port
"$Tags.DB_TYPE" "redis"
"db.redis.dbIndex" 0
}
@ -177,8 +177,8 @@ class LettuceAsyncClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CONNECT:" + dbAddrNonExistent
"$MoreTags.SPAN_TYPE" SpanTypes.REDIS
"$Tags.COMPONENT" "redis-client"
"$Tags.PEER_HOSTNAME" HOST
"$Tags.PEER_PORT" incorrectPort
"$MoreTags.NET_PEER_NAME" HOST
"$MoreTags.NET_PEER_PORT" incorrectPort
"$Tags.DB_TYPE" "redis"
"db.redis.dbIndex" 0
errorTags CompletionException, String

View File

@ -120,8 +120,8 @@ class LettuceSyncClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CONNECT:" + dbAddr
"$MoreTags.SPAN_TYPE" SpanTypes.REDIS
"$Tags.COMPONENT" "redis-client"
"$Tags.PEER_HOSTNAME" HOST
"$Tags.PEER_PORT" port
"$MoreTags.NET_PEER_NAME" HOST
"$MoreTags.NET_PEER_PORT" port
"$Tags.DB_TYPE" "redis"
"db.redis.dbIndex" 0
}
@ -154,8 +154,8 @@ class LettuceSyncClientTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "CONNECT:" + dbAddrNonExistent
"$MoreTags.SPAN_TYPE" SpanTypes.REDIS
"$Tags.COMPONENT" "redis-client"
"$Tags.PEER_HOSTNAME" HOST
"$Tags.PEER_PORT" incorrectPort
"$MoreTags.NET_PEER_NAME" HOST
"$MoreTags.NET_PEER_PORT" incorrectPort
"$Tags.DB_TYPE" "redis"
"db.redis.dbIndex" 0
errorTags CompletionException, String

View File

@ -264,9 +264,9 @@ class MongoClientTest extends MongoBaseTest {
"$MoreTags.RESOURCE_NAME" { it.replace(" ", "") == statement }
"$MoreTags.SPAN_TYPE" SpanTypes.MONGO
"$Tags.COMPONENT" "java-mongo"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" port
"$Tags.DB_STATEMENT" {
it.replace(" ", "") == statement
}

View File

@ -267,9 +267,9 @@ class MongoClientTest extends MongoBaseTest {
"$MoreTags.RESOURCE_NAME" { it.replace(" ", "") == statement }
"$MoreTags.SPAN_TYPE" SpanTypes.MONGO
"$Tags.COMPONENT" "java-mongo"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" port
"$Tags.DB_STATEMENT" {
it.replace(" ", "") == statement
}

View File

@ -302,9 +302,9 @@ class MongoAsyncClientTest extends MongoBaseTest {
"$MoreTags.RESOURCE_NAME" statementEval
"$MoreTags.SPAN_TYPE" SpanTypes.MONGO
"$Tags.COMPONENT" "java-mongo"
"$Tags.PEER_HOSTNAME" "localhost"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" port
"$MoreTags.NET_PEER_NAME" "localhost"
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" port
"$Tags.DB_STATEMENT" statementEval
"$Tags.DB_TYPE" "mongo"
"$Tags.DB_INSTANCE" instance

View File

@ -56,7 +56,8 @@ public class HttpClientRequestTracingHandler extends ChannelOutboundHandlerAdapt
ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY).set(null);
}
final Span span = TRACER.spanBuilder("netty.client.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
try (final Scope scope = TRACER.withSpan(span)) {
DECORATE.afterStart(span);
DECORATE.onRequest(span, request);

View File

@ -47,7 +47,8 @@ public class HttpServerRequestTracingHandler extends ChannelInboundHandlerAdapte
final HttpRequest request = (HttpRequest) msg;
final Span.Builder spanBuilder = TRACER.spanBuilder("netty.request").setSpanKind(SERVER);
final Span.Builder spanBuilder =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(SERVER);
try {
final SpanContext extractedContext =
TRACER.getHttpTextFormat().extract(request.headers(), GETTER);

View File

@ -59,11 +59,6 @@ class Netty40ClientTest extends HttpClientTest<NettyHttpClientDecorator> {
return NettyHttpClientDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "netty.client.request"
}
@Override
boolean testRedirects() {
false

View File

@ -123,9 +123,4 @@ class Netty40ServerTest extends HttpServerTest<EventLoopGroup, NettyHttpServerDe
NettyHttpServerDecorator decorator() {
NettyHttpServerDecorator.DECORATE
}
@Override
String expectedOperationName() {
"netty.request"
}
}

View File

@ -56,7 +56,8 @@ public class HttpClientRequestTracingHandler extends ChannelOutboundHandlerAdapt
ctx.channel().attr(AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY).set(null);
}
final Span span = TRACER.spanBuilder("netty.client.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
try (final Scope scope = TRACER.withSpan(span)) {
DECORATE.afterStart(span);
DECORATE.onRequest(span, request);

View File

@ -47,7 +47,8 @@ public class HttpServerRequestTracingHandler extends ChannelInboundHandlerAdapte
final HttpRequest request = (HttpRequest) msg;
final Span.Builder spanBuilder = TRACER.spanBuilder("netty.request").setSpanKind(SERVER);
final Span.Builder spanBuilder =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(SERVER);
try {
final SpanContext extractedContext =
TRACER.getHttpTextFormat().extract(request.headers(), GETTER);

View File

@ -65,11 +65,6 @@ class Netty41ClientTest extends HttpClientTest<NettyHttpClientDecorator> {
return NettyHttpClientDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "netty.client.request"
}
@Override
boolean testRedirects() {
false

View File

@ -122,9 +122,4 @@ class Netty41ServerTest extends HttpServerTest<EventLoopGroup, NettyHttpServerDe
NettyHttpServerDecorator decorator() {
NettyHttpServerDecorator.DECORATE
}
@Override
String expectedOperationName() {
"netty.request"
}
}

View File

@ -36,7 +36,11 @@ public class TracingInterceptor implements Interceptor {
@Override
public Response intercept(final Chain chain) throws IOException {
final Span span = TRACER.spanBuilder("okhttp.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER
.spanBuilder(DECORATE.spanNameForRequest(chain.request()))
.setSpanKind(CLIENT)
.startSpan();
try (final Scope scope = TRACER.withSpan(span)) {
DECORATE.afterStart(span);

View File

@ -38,18 +38,11 @@ class OkHttp3Test extends HttpClientTest<OkHttpClientDecorator> {
return response.code()
}
@Override
OkHttpClientDecorator decorator() {
return OkHttpClientDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "okhttp.request"
}
boolean testRedirects() {
false
}

View File

@ -89,7 +89,8 @@ public class PlayWSClientInstrumentation extends Instrumenter.Default {
@Advice.Argument(0) final Request request,
@Advice.Argument(value = 1, readOnly = false) AsyncHandler asyncHandler) {
final Span span = TRACER.spanBuilder("play-ws.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
DECORATE.afterStart(span);
DECORATE.onRequest(span, request);

View File

@ -78,10 +78,6 @@ class PlayWSClientTest extends HttpClientTest<PlayWSClientDecorator> {
return PlayWSClientDecorator.DECORATE
}
String expectedOperationName() {
return "play-ws.request"
}
@Override
boolean testCircularRedirects() {
return false

View File

@ -92,7 +92,8 @@ public class PlayWSClientInstrumentation extends Instrumenter.Default {
@Advice.Argument(0) final Request request,
@Advice.Argument(value = 1, readOnly = false) AsyncHandler asyncHandler) {
final Span span = TRACER.spanBuilder("play-ws.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
DECORATE.afterStart(span);
DECORATE.onRequest(span, request);

View File

@ -78,10 +78,6 @@ class PlayWSClientTest extends HttpClientTest<PlayWSClientDecorator> {
return PlayWSClientDecorator.DECORATE
}
String expectedOperationName() {
return "play-ws.request"
}
@Override
boolean testCircularRedirects() {
return false

View File

@ -89,7 +89,8 @@ public class PlayWSClientInstrumentation extends Instrumenter.Default {
@Advice.Argument(0) final Request request,
@Advice.Argument(value = 1, readOnly = false) AsyncHandler asyncHandler) {
final Span span = TRACER.spanBuilder("play-ws.request").setSpanKind(CLIENT).startSpan();
final Span span =
TRACER.spanBuilder(DECORATE.spanNameForRequest(request)).setSpanKind(CLIENT).startSpan();
DECORATE.afterStart(span);
DECORATE.onRequest(span, request);

View File

@ -78,10 +78,6 @@ class PlayWSClientTest extends HttpClientTest<PlayWSClientDecorator> {
return PlayWSClientDecorator.DECORATE
}
String expectedOperationName() {
return "play-ws.request"
}
@Override
boolean testCircularRedirects() {
return false

View File

@ -77,6 +77,7 @@ public class PlayHttpServerDecorator extends HttpServerDecorator<Request, Reques
final Option pathOption = request.tags().get("ROUTE_PATTERN");
if (!pathOption.isEmpty()) {
final String path = (String) pathOption.get();
span.updateName(request.method() + " " + path);
span.setAttribute(MoreTags.RESOURCE_NAME, request.method() + " " + path);
}
}

View File

@ -51,11 +51,6 @@ class PlayWSClientTest extends HttpClientTest<NettyHttpClientDecorator> {
return NettyHttpClientDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "netty.client.request"
}
@Override
boolean testRedirects() {
false

View File

@ -80,11 +80,6 @@ class PlayServerTest extends HttpServerTest<Server, NettyHttpServerDecorator> {
return NettyHttpServerDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "netty.request"
}
@Override
boolean hasHandlerSpan() {
true
@ -105,7 +100,7 @@ class PlayServerTest extends HttpServerTest<Server, NettyHttpServerDecorator> {
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" PlayHttpServerDecorator.DECORATE.getComponentName()
"$Tags.PEER_HOST_IPV4" { it == null || it == "127.0.0.1" } // Optional
"$MoreTags.NET_PEER_IP" { it == null || it == "127.0.0.1" } // Optional
"$Tags.HTTP_URL" String
"$Tags.HTTP_METHOD" String
"$Tags.HTTP_STATUS" Long

View File

@ -80,6 +80,7 @@ public class PlayHttpServerDecorator extends HttpServerDecorator<Request, Reques
request.attrs().get(Router.Attrs.HANDLER_DEF.underlying());
if (!defOption.isEmpty()) {
final String path = defOption.get().path();
span.updateName(request.method() + " " + path);
span.setAttribute(MoreTags.RESOURCE_NAME, request.method() + " " + path);
}
}

View File

@ -85,11 +85,6 @@ class PlayServerTest extends HttpServerTest<Server, AkkaHttpServerDecorator> {
return AkkaHttpServerDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "akka-http.request"
}
@Override
boolean hasHandlerSpan() {
true
@ -110,7 +105,7 @@ class PlayServerTest extends HttpServerTest<Server, AkkaHttpServerDecorator> {
tags {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" PlayHttpServerDecorator.DECORATE.getComponentName()
"$Tags.PEER_HOST_IPV4" { it == null || it == "127.0.0.1" } // Optional
"$MoreTags.NET_PEER_IP" { it == null || it == "127.0.0.1" } // Optional
"$Tags.HTTP_URL" String
"$Tags.HTTP_METHOD" String
"$Tags.HTTP_STATUS" Long
@ -126,7 +121,7 @@ class PlayServerTest extends HttpServerTest<Server, AkkaHttpServerDecorator> {
void serverSpan(TraceAssert trace, int index, String traceID = null, String parentID = null, String method = "GET", ServerEndpoint endpoint = SUCCESS) {
trace.span(index) {
operationName expectedOperationName()
operationName expectedOperationName(method)
spanKind SERVER
errored endpoint.errored
if (parentID != null) {
@ -139,7 +134,7 @@ class PlayServerTest extends HttpServerTest<Server, AkkaHttpServerDecorator> {
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" serverDecorator.getComponentName()
"$Tags.HTTP_STATUS" endpoint.status
"$Tags.HTTP_URL" "${endpoint.resolve(address)}"
"$Tags.HTTP_URL" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
"$Tags.HTTP_METHOD" method
if (endpoint.errored) {
"error.msg" { it == null || it == EXCEPTION.body }

View File

@ -47,7 +47,6 @@ import com.rabbitmq.client.MessageProperties;
import io.opentelemetry.auto.bootstrap.CallDepthThreadLocalMap;
import io.opentelemetry.auto.instrumentation.api.MoreTags;
import io.opentelemetry.auto.instrumentation.api.SpanWithScope;
import io.opentelemetry.auto.instrumentation.api.Tags;
import io.opentelemetry.auto.tooling.Instrumenter;
import io.opentelemetry.context.Scope;
import io.opentelemetry.trace.Span;
@ -149,7 +148,7 @@ public class RabbitChannelInstrumentation extends Instrumenter.Default {
}
final Span span = spanBuilder.startSpan();
span.setAttribute(MoreTags.RESOURCE_NAME, method);
span.setAttribute(Tags.PEER_PORT, connection.getPort());
span.setAttribute(MoreTags.NET_PEER_PORT, connection.getPort());
DECORATE.afterStart(span);
DECORATE.onPeerConnection(span, connection.getAddress());
CURRENT_RABBIT_SPAN.set(span);
@ -270,7 +269,7 @@ public class RabbitChannelInstrumentation extends Instrumenter.Default {
if (response != null) {
span.setAttribute("message.size", response.getBody().length);
}
span.setAttribute(Tags.PEER_PORT, connection.getPort());
span.setAttribute(MoreTags.NET_PEER_PORT, connection.getPort());
try (final Scope scope = TRACER.withSpan(span)) {
CONSUMER_DECORATE.afterStart(span);
CONSUMER_DECORATE.onGet(span, queue);

View File

@ -368,9 +368,9 @@ class RabbitMQTest extends AgentTestRunner {
"$MoreTags.SERVICE_NAME" "rabbitmq"
"$MoreTags.RESOURCE_NAME" resource
"$Tags.COMPONENT" "rabbitmq-amqp"
"$Tags.PEER_HOSTNAME" { it == null || it instanceof String }
"$Tags.PEER_HOST_IPV4" { "127.0.0.1" }
"$Tags.PEER_PORT" { it == null || it instanceof Long }
"$MoreTags.NET_PEER_NAME" { it == null || it instanceof String }
"$MoreTags.NET_PEER_IP" { "127.0.0.1" }
"$MoreTags.NET_PEER_PORT" { it == null || it instanceof Long }
switch (tag("amqp.command")?.stringValue) {
case "basic.publish":

View File

@ -89,6 +89,7 @@ public class RatpackServerDecorator extends HttpServerDecorator<Request, Request
final String resourceName = ctx.getRequest().getMethod().getName() + " " + description;
span.setAttribute(MoreTags.RESOURCE_NAME, resourceName);
span.updateName(resourceName);
return span;
}

View File

@ -82,7 +82,7 @@ class RatpackOtherTest extends AgentTestRunner {
assertTraces(1) {
trace(0, 2) {
span(0) {
operationName "netty.request"
operationName "GET /$route"
spanKind SERVER
parent()
errored false
@ -90,15 +90,15 @@ class RatpackOtherTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GET /$route"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "netty"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "${app.address.resolve(path)}"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200
}
}
span(1) {
operationName "ratpack.handler"
operationName "GET /$route"
spanKind INTERNAL
childOf(span(0))
errored false
@ -106,8 +106,8 @@ class RatpackOtherTest extends AgentTestRunner {
"$MoreTags.RESOURCE_NAME" "GET /$route"
"$MoreTags.SPAN_TYPE" SpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "ratpack"
"$Tags.PEER_HOST_IPV4" "127.0.0.1"
"$Tags.PEER_PORT" Long
"$MoreTags.NET_PEER_IP" "127.0.0.1"
"$MoreTags.NET_PEER_PORT" Long
"$Tags.HTTP_URL" "${app.address.resolve(path)}"
"$Tags.HTTP_METHOD" "GET"
"$Tags.HTTP_STATUS" 200

View File

@ -56,11 +56,6 @@ class RatpackHttpClientTest extends HttpClientTest<NettyHttpClientDecorator> {
return NettyHttpClientDecorator.DECORATE
}
@Override
String expectedOperationName() {
return "netty.client.request"
}
@Override
boolean testRedirects() {
false

Some files were not shown because too many files have changed in this diff Show More