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:
吴晟 Wu Sheng 2017-12-30 18:44:14 +08:00 committed by GitHub
commit 6b4219650d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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\" }"));