Adding jdbc instrumentation (#1959)

fixes gh-1930
This commit is contained in:
Marcin Grzejszczak
2021-05-26 10:00:14 +02:00
committed by GitHub
parent b591e0f474
commit 190a15de57
51 changed files with 5293 additions and 89 deletions

View File

@@ -99,6 +99,17 @@ public interface Span extends SpanCustomizer {
return this;
}
/**
* Sets the remote url on the span.
* @param ip remote ip
* @param port remote port
* @return this span
* @since 3.1.0
*/
default Span remoteIpAndPort(String ip, int port) {
return this;
}
/**
* Type of span. Can be used to specify additional relationships between spans in
* addition to a parent/child relationship.
@@ -204,10 +215,11 @@ public interface Span extends SpanCustomizer {
/**
* Sets the remote URL for the span.
* @param remoteUrl remote service name
* @param ip remote service ip
* @param port remote service port
* @return this
*/
default Builder remoteUrl(String remoteUrl) {
default Builder remoteIpAndPort(String ip, int port) {
return this;
}

View File

@@ -16,13 +16,15 @@
package org.springframework.cloud.sleuth;
import java.io.Closeable;
/**
* Container object for {@link Span} and its corresponding {@link Tracer.SpanInScope}.
*
* @author Marcin Grzejszczak
* @since 3.1.0
*/
public class SpanAndScope {
public class SpanAndScope implements Closeable {
private final Span span;
@@ -46,4 +48,10 @@ public class SpanAndScope {
return "SpanAndScope{" + "span=" + this.span + '}';
}
@Override
public void close() {
this.scope.close();
this.span.end();
}
}