Merge pull request #715 from ascrutae/fix/mongodb-operation-name-issue
[Agent] make the operation name of mongodb span more sences
This commit is contained in:
commit
6b4219650d
|
|
@ -173,7 +173,7 @@ public class MongoDBMethodInterceptor implements InstanceMethodsAroundIntercepto
|
|||
|
||||
String executeMethod = arguments[0].getClass().getSimpleName();
|
||||
String remotePeer = (String)objInst.getSkyWalkingDynamicField();
|
||||
AbstractSpan span = ContextManager.createExitSpan(MONGO_DB_OP_PREFIX + method.getName(), new ContextCarrier(), remotePeer);
|
||||
AbstractSpan span = ContextManager.createExitSpan(MONGO_DB_OP_PREFIX + executeMethod, new ContextCarrier(), remotePeer);
|
||||
span.setComponent(ComponentsDefine.MONGODB);
|
||||
Tags.DB_TYPE.set(span, DB_TYPE);
|
||||
SpanLayer.asDB(span);
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public class MongoDBMethodInterceptorTest {
|
|||
}
|
||||
|
||||
private void assertRedisSpan(AbstractTracingSpan span) {
|
||||
assertThat(span.getOperationName(), is("MongoDB/getUsedDatabases"));
|
||||
assertThat(span.getOperationName(), is("MongoDB/FindOperation"));
|
||||
assertThat(SpanHelper.getComponentId(span), is(9));
|
||||
List<KeyValuePair> tags = SpanHelper.getTags(span);
|
||||
assertThat(tags.get(1).getValue(), is("FindOperation { \"name\" : \"by\" }"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue