Allow serviceName, resourceName, and spanType to be set via tags.

This commit is contained in:
Tyler Benson 2017-07-06 14:41:04 -07:00
parent 84226a0912
commit e69c9d25dc
1 changed files with 11 additions and 0 deletions

View File

@ -177,6 +177,17 @@ public class DDSpanContext implements io.opentracing.SpanContext {
* @param value the value of the value
*/
public synchronized void setTag(String tag, Object value) {
if (tag.equals(DDTags.SERVICE_NAME)) {
setServiceName(value.toString());
return;
} else if (tag.equals(DDTags.RESOURCE_NAME)) {
setResourceName(value.toString());
return;
} else if (tag.equals(DDTags.SPAN_TYPE)) {
setSpanType(value.toString());
return;
}
if (this.tags.isEmpty()) {
this.tags = new HashMap<String, Object>();
}