Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add [Agent] Jedis LETTUCE client plugin #832

Closed
wants to merge 26 commits into from
Closed

Conversation

lytscu
Copy link
Contributor

@lytscu lytscu commented Feb 27, 2018

Please answer these questions before submitting pull request


Bug fix

  • Bug description.

  • How to fix?


New feature or improvement

@lytscu lytscu requested review from wu-sheng and ascrutae and removed request for wu-sheng and ascrutae February 27, 2018 01:40
@coveralls
Copy link

coveralls commented Feb 27, 2018

Coverage Status

Coverage decreased (-0.003%) to 19.428% when pulling 49cd58f on lytscu:jedis into 9e9c08d on apache:master.

@wu-sheng
Copy link
Member

@lytscu Please run your test again, after ci passed.

@wu-sheng wu-sheng added this to the 5.0.0-alpha milestone Feb 27, 2018
@wu-sheng wu-sheng added agent Language agent related. feature New feature labels Feb 27, 2018
AbstractSpan span = ContextManager.activeSpan();
span.errorOccurred();
}
ContextManager.stopSpan();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It maybe cause exception if the commandType equals AUTH, because of I saw that StatefulRedisClusterConnectionImplInterceptor doesn't create span if the commandType equals AUTH

AbstractSpan span = ContextManager.activeSpan();
span.errorOccurred();
}
ContextManager.stopSpan();
Copy link
Member

@ascrutae ascrutae Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It maybe cause exception if the command type is ignore command type, because of I saw that StatefulRedisClusterConnectionImplInterceptor doesn't create span if the command type is ignore command type

Copy link
Contributor Author

@lytscu lytscu Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot see any update

/**
* Check the comandtype ,ignore "AUTH" "CLIENT" "CLUSTER" .
*/
private Boolean checkIgnoreCommandType(String comandType) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is make confuse. I suggest that the method name change to checkIfNotIgnoreCommandType

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

String comandType = String.valueOf(command.getType());
if (!"AUTH".equals(comandType)) {
Iterable<RedisURI> redisURIs = (Iterable<RedisURI>)objInst.getSkyWalkingDynamicField();
AbstractSpan span = ContextManager.createExitSpan("REDIS-Lettuce/" + comandType, redisURIs.toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what the value about redisURIs.toString() look like. Can you show me an example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redisURIs.toString()=[RedisURI [host='100.100.144.134', port=30001]]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a typical peer. In traditional, the peer like ip1:port1,ip2:port2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

RedisCommand command = (RedisCommand)allArguments[0];
String comandType = String.valueOf(command.getType());
if (null != command.getOutput().getError()) {
AbstractSpan span = ContextManager.activeSpan();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It maybe cause exception if the command type equals AUTH, because of I saw that StatefulRedisClusterConnectionImplInterceptor doesn't create span if the command type equals AUTH

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

MatcherAssert.assertThat(segmentStorage.getTraceSegments().size(), is(1));
TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
assertMongoSpan(spans.get(0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name should be assertLettuceSpan


interceptor = new StatefulRedisConnectionImplInterceptor();

Config.Plugin.MongoDB.TRACE_PARAM = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line should be remove


@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
AbstractSpan span = ContextManager.activeSpan();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also check the command type


@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
AbstractSpan span = ContextManager.activeSpan();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also check the command type

ascrutae
ascrutae previously approved these changes Feb 28, 2018
@ascrutae
Copy link
Member

Could you post the latest test report? @lytscu

@wu-sheng
Copy link
Member

Could you post the latest test report? @lytscu

+1 I agree we should run the test again before merge.

@wu-sheng wu-sheng modified the milestones: 5.0.0-alpha, 5.0.0-beta Mar 5, 2018
@wu-sheng
Copy link
Member

wu-sheng commented Mar 5, 2018

I move this pr to 5.0.0 beta, because our codes of 5.0.0 alpha is about to be frozen. @lytscu

@wu-sheng wu-sheng mentioned this pull request Mar 5, 2018
4 tasks
@wu-sheng
Copy link
Member

@ascrutae What is the status of this plugin? And @lytscu please resolve the conflicts.

@ascrutae
Copy link
Member

The duration of ExitSpan created by StatefulRedisConnectionImplInterceptor is incorrect. because the StatefulRedisConnectionImpl#dispatch method only create an redis command and this command will execute in other thread.

@wu-sheng
Copy link
Member

wu-sheng commented May 2, 2018

@lytscu Would you continue work on this pr?

@wu-sheng wu-sheng modified the milestones: 5.0.0-beta, 5.0.0-beta2 May 3, 2018
@wu-sheng
Copy link
Member

wu-sheng commented Aug 8, 2018

Closing this, no update more than 3 months.

@wu-sheng wu-sheng closed this Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Language agent related. feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants