This commit is contained in:
lytscu 2017-11-16 21:04:11 +08:00
parent 96633124da
commit 4215fc628c
2 changed files with 6 additions and 3 deletions

View File

@ -37,8 +37,11 @@ import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptR
import org.skywalking.apm.network.trace.component.ComponentsDefine;
/**
* {@link MongoDBCollectionMethodInterceptor} intercept {@link com.mongodb.DBCollectionImpl}{@link com.mongodb.DBCollection}class,
* create the exit span when the client call the interceptor methods.
* {@link MongoDBCollectionMethodInterceptor}create the exit span when the client call the interceptor methods.
* <p>
* {@link MongoDBCollectionMethodInterceptor} intercept constructor of {@link com.mongodb.DBCollection}or {@link com.mongodb.DBCollectionImpl} for
* record the ServerAddress.
*
*/
public class MongoDBCollectionMethodInterceptor implements InstanceMethodsAroundInterceptor, InstanceConstructorInterceptor {

View File

@ -204,7 +204,7 @@ public class MongoDBMethodInterceptor implements InstanceMethodsAroundIntercepto
ServerAddress address = description.getAddress();
peers.append(address.getHost() + ":" + address.getPort() + ";");
}
objInst.setSkyWalkingDynamicField(peers.subSequence(0, peers.length() - 1).toString());
}
}