Conversation
|
A new plugin test(not UT) is required like this, https://github.com/apache/skywalking-java/tree/main/test/plugin/scenarios/dubbo-2.7.x-scenario. We have plugin development doc to guide you how to write a plugin test. |
witness classes and methods added, and extract common code of both dubbo 2.7 and 3 into individual maven module.
This is on the road... |
The dubbo plugin is not very complex like JDBC, do we really need the common package and set up this complex hierarchy structure? Dubbo v2 will dead(EOL) one day, keeping them separate will make us easier to remove Dubbo 2 plugin and keep 3 plugin w/o change. |
Ok, rollback. TODO:
|
# by using this command
./test/plugin/run.sh -f dubbo-2.7.x-scenarioTurns out that I didn't |
|
Have you passed maven install and both plugin cases locally? |
Yes, it passed (without this pr). With this pr I can pass other scenarios except dubbo2.7 and 3. So it turns out I broke something. |
|
I think it is better you reset anything back to main branch, then add your new plugin implementation with witness class. |
Yes, I did exactly the same thing. Checked out the main branch, add witness class only to dubbo2.7 and it's conflict patch, do nothing with dubbo3. Then the 2.7 scenario test broke. However, with these witness class, my 2.7 demo and 3 demo works as expect (the log file in logs folder shows that 2.7 demo dosen't meet 3's witness, and vice versa, and agent can produce spans which appear on skywalking ui as expect). It needs some more time, I will keep on working on this. |
|
Thanks for updating. If there is any help we could provide, please let us know. |
|
I got the point why the scenario test failed. It's because the chosen witness classes fit one minor (patch) version but not for other minor (patch) versions. |
|
We had a contributed contributing this tool to help you locate the witness, https://github.com/SkyAPM/uranus. BTW, it doesn't have to be a witness class, a method signature is also works. |
|
@tedli Any luck with this plugin? |
Hi, the witness methods works fine, by adding witness methods like this: // dubbo 2.7.x
@Override
protected List<WitnessMethod> witnessMethods() {
return Collections.singletonList(new WitnessMethod(
"org.apache.dubbo.rpc.RpcContext",
named("getServerContext").and(returns(named("org.apache.dubbo.rpc.RpcContext")))));
}
// dubbo 3.x
@Override
protected List<WitnessMethod> witnessMethods() {
return Collections.singletonList(new WitnessMethod(
"org.apache.dubbo.rpc.RpcContext",
named("getServerContext").and(returns(named("org.apache.dubbo.rpc.RpcContextAttachment")))));
}the agent mechanism accurately load the correct plugin. And the scenario test of 2.7.x passed as it is. How ever the scenario test of 3 still failed, It need some further investigation about how to construct a span for dubbo 3. 😭 It's the end of the year, I have to handle some of my own mess, which has higher priority. I'm very glad to continue working on this issue. I will make some time for this. |
|
Got it. Make your time, no hurry about this. I just want to check the status, and we will plan to release the next 8.9.0 for agent after we have Dubbo plugin. Because we know people at China love Dubbo project, and would require this plugin. |
|
Hi, @wu-sheng FYI // dubbo 2.7.x
@Activate(group = {PROVIDER, CONSUMER})
public class MonitorFilter implements Filter, Filter.Listener {
}
// dubbo 3.x
@Activate(group = {PROVIDER})
public class MonitorFilter implements Filter, Filter.Listener {
}After some debugging, I found out why the scenario test of dubbo3 failed, it's because the occasion that It need to find other filters to adjust instrumentation class intercepting behavior, so that consumer side can also produce spans. |
|
Is any |
Yes, there is. I notice that some other plugins has different instrumentation classes for server and client like the grpc plugin. I'm trying to add an instrumentation class for dubbo 3 consumer in the same way. |
|
Sure, you could disable the whole |
|
Hi @wu-sheng , I found that if using the same scenario test code like dubbo 2.7.x, the consumer proxy object will use an InJvmInvoker, or if explicitly set inJvm to false, a DubboInvoker will be used, neither of them loads filters. Then I ran a EmbeddedZooKeeper, by using a registry, @Override
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
if (UrlUtils.isRegistry(url)) {
return protocol.refer(type, url);
}
FilterChainBuilder builder = getFilterChainBuilder(url);
return builder.buildInvokerChain(protocol.refer(type, url), REFERENCE_FILTER_KEY, CommonConstants.CONSUMER);
}the consumer proxy object loads filters. So skywalking interceptor on consumer side affects. The produced spans are as expect. segmentItems:
- serviceName: dubbo-3.x-scenario
segmentSize: 3
segments:
- segmentId: 42afe68bf5ad435787439867ed63a554.64.16390270335870000
spans:
- operationName: HEAD:/dubbo-3.x-scenario/case/healthCheck
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: 1639027033589
endTime: 1639027033684
componentId: 1
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/dubbo-3.x-scenario/case/healthCheck'}
- {key: http.method, value: HEAD}
- segmentId: 42afe68bf5ad435787439867ed63a554.86.16390270340630000
spans:
- operationName: org.apache.skywalking.apm.testcase.dubbo3.services.GreetService.doBusiness(String)
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: RPCFramework
startTime: 1639027034063
endTime: 1639027034068
componentId: 3
isError: false
spanType: Entry
peer: 172.17.0.2:40328
skipAnalysis: false
tags:
- {key: url, value: 'dubbo://172.17.0.2:20080/org.apache.skywalking.apm.testcase.dubbo3.services.GreetService.doBusiness(String)'}
- {key: arguments, value: helloWorld}
refs:
- {parentEndpoint: 'GET:/dubbo-3.x-scenario/case/dubbo', networkAddress: '172.17.0.2:0',
refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: 42afe68bf5ad435787439867ed63a554.65.16390270336920000,
parentServiceInstance: ae9af82e06fe419097b7483b8e2d6522@172.17.0.2, parentService: dubbo-3.x-scenario,
traceId: 42afe68bf5ad435787439867ed63a554.65.16390270336920001}
- segmentId: 42afe68bf5ad435787439867ed63a554.65.16390270336920000
spans:
- operationName: org.apache.skywalking.apm.testcase.dubbo3.services.GreetService.doBusiness(String)
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: RPCFramework
startTime: 1639027033946
endTime: 1639027034073
componentId: 3
isError: false
spanType: Exit
peer: 172.17.0.2:0
skipAnalysis: false
tags:
- {key: url, value: 'dubbo://172.17.0.2:0/org.apache.skywalking.apm.testcase.dubbo3.services.GreetService.doBusiness(String)'}
- {key: arguments, value: helloWorld}
- operationName: GET:/dubbo-3.x-scenario/case/dubbo
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: 1639027033692
endTime: 1639027034075
componentId: 1
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/dubbo-3.x-scenario/case/dubbo'}
- {key: http.method, value: GET}However, because a registry is used, the And I didn't find something like |
Yes, that is fine. |
|
You need to add your case into GHA control file, then I could activate CI for you. |
4f07c82 to
a6073e9
Compare
|
|
07efff8 to
1c35946
Compare
I saw that the checking for By the way, I saw |
|
The name of skywalking-plugin.def provides the bootstrap configurable capabilities to disable this plugin directly though config file or system env, rather than removing jar files. So it is better to rename preview to dubbo2.x and add dubbo3.x |
|
retransform case should only fail unrelatedly. I guess. I can rerun if it happens again. Don't need to worry for now. |
|
When will a new version support this new feature be released |
|
In this month, maybe. We are waiting for a grpc next release. |
Add an agent plugin to support dubbo3
There is already one (for dubbo 2.5 and 2.7)There is already one (for dubbo 2.5 and 2.7)CHANGESlog.