Updating decorators due the new behavior
This commit is contained in:
parent
549943ec63
commit
b152036327
|
@ -2,7 +2,6 @@ package com.datadoghq.trace.integration;
|
|||
|
||||
import com.datadoghq.trace.DDSpanContext;
|
||||
import com.datadoghq.trace.DDTags;
|
||||
|
||||
import io.opentracing.tag.Tags;
|
||||
|
||||
/**
|
||||
|
@ -25,9 +24,7 @@ public class DBComponent extends DDSpanContextDecorator {
|
|||
context.setSpanType("db");
|
||||
|
||||
//Assign resource name
|
||||
if(tag.equals(Tags.DB_STATEMENT.getKey())){
|
||||
context.setResourceName(String.valueOf(value));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -16,7 +16,7 @@ public abstract class DDSpanContextDecorator {
|
|||
private String setValue;
|
||||
|
||||
public boolean afterSetTag(DDSpanContext context, String tag, Object value) {
|
||||
if(tag.equals(this.getMatchingTag()) && (this.getMatchingValue()==null || value.equals(this.getMatchingValue()))){
|
||||
if ((this.getMatchingValue() == null || value.equals(this.getMatchingValue()))) {
|
||||
String targetTag = getSetTag() == null ? tag : getSetTag();
|
||||
String targetValue = getSetValue() == null ? String.valueOf(value) : getSetTag();
|
||||
context.setTag(targetTag, targetValue);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.datadoghq.trace.integration;
|
|||
|
||||
import com.datadoghq.trace.DDSpanContext;
|
||||
import com.datadoghq.trace.DDTags;
|
||||
|
||||
import io.opentracing.tag.Tags;
|
||||
|
||||
|
||||
|
@ -22,6 +21,7 @@ public class HTTPComponent extends DDSpanContextDecorator {
|
|||
public boolean afterSetTag(DDSpanContext context, String tag, Object value) {
|
||||
//Assign service name
|
||||
if (super.afterSetTag(context, tag, value)) {
|
||||
|
||||
//Assign span type to WEB
|
||||
context.setSpanType("web");
|
||||
return true;
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package com.datadoghq.trace.integration;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import com.datadoghq.trace.DDSpanContext;
|
||||
import com.datadoghq.trace.DDTags;
|
||||
|
||||
import io.opentracing.tag.Tags;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
public class URLAsResourceName extends DDSpanContextDecorator {
|
||||
|
||||
public URLAsResourceName() {
|
||||
|
@ -18,7 +17,6 @@ public class URLAsResourceName extends DDSpanContextDecorator {
|
|||
@Override
|
||||
public boolean afterSetTag(DDSpanContext context, String tag, Object value) {
|
||||
//Assign resource name
|
||||
if(tag.equals(Tags.HTTP_URL.getKey())){
|
||||
try {
|
||||
String path = new java.net.URL(String.valueOf(value)).getPath();
|
||||
context.setTag(this.getSetTag(), path);
|
||||
|
@ -26,9 +24,6 @@ public class URLAsResourceName extends DDSpanContextDecorator {
|
|||
context.setResourceName(String.valueOf(value));
|
||||
}
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue