未验证 提交 10ddf0c3 编写于 作者: D Darcy 提交者: GitHub

fix a bug that spring-mvc set an error endpoint name (#6783)

上级 db1d655b
...@@ -17,7 +17,8 @@ Release Notes. ...@@ -17,7 +17,8 @@ Release Notes.
* Add Seata in the component definition. Seata plugin hosts on Seata project. * Add Seata in the component definition. Seata plugin hosts on Seata project.
* Extended Kafka plugin to properly trace consumers that have topic partitions directly assigned. * Extended Kafka plugin to properly trace consumers that have topic partitions directly assigned.
* Support print SkyWalking context to logs. * Support print SkyWalking context to logs.
* Add `MessageListener` enhancement in pulsar plugin * Add `MessageListener` enhancement in pulsar plugin.
* fix a bug that spring-mvc set an error endpoint name if the controller class annotation implements an interface.
* Add an optional agent plugin to support mybatis. * Add an optional agent plugin to support mybatis.
#### OAP-Backend #### OAP-Backend
......
...@@ -22,6 +22,7 @@ import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache; ...@@ -22,6 +22,7 @@ import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
import org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache; import org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/** /**
...@@ -32,7 +33,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte ...@@ -32,7 +33,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte
@Override @Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = ""; String basePath = "";
RequestMapping basePathRequestMapping = objInst.getClass().getAnnotation(RequestMapping.class); RequestMapping basePathRequestMapping = AnnotationUtils.findAnnotation(objInst.getClass(), RequestMapping.class);
if (basePathRequestMapping != null) { if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) { if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0]; basePath = basePathRequestMapping.value()[0];
......
...@@ -22,6 +22,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI ...@@ -22,6 +22,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache; import org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache;
import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache; import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/** /**
...@@ -42,7 +43,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte ...@@ -42,7 +43,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte
@Override @Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = ""; String basePath = "";
RequestMapping basePathRequestMapping = objInst.getClass().getAnnotation(RequestMapping.class); RequestMapping basePathRequestMapping = AnnotationUtils.findAnnotation(objInst.getClass(), RequestMapping.class);
if (basePathRequestMapping != null) { if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) { if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0]; basePath = basePathRequestMapping.value()[0];
......
...@@ -22,13 +22,14 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI ...@@ -22,13 +22,14 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
import org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache; import org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache;
import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache; import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
public class ControllerForLowVersionConstructorInterceptor implements InstanceConstructorInterceptor { public class ControllerForLowVersionConstructorInterceptor implements InstanceConstructorInterceptor {
@Override @Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = ""; String basePath = "";
RequestMapping basePathRequestMapping = objInst.getClass().getAnnotation(RequestMapping.class); RequestMapping basePathRequestMapping = AnnotationUtils.findAnnotation(objInst.getClass(), RequestMapping.class);
if (basePathRequestMapping != null) { if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) { if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0]; basePath = basePathRequestMapping.value()[0];
......
...@@ -22,6 +22,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI ...@@ -22,6 +22,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache; import org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache;
import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache; import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/** /**
...@@ -42,7 +43,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte ...@@ -42,7 +43,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte
@Override @Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = ""; String basePath = "";
RequestMapping basePathRequestMapping = objInst.getClass().getAnnotation(RequestMapping.class); RequestMapping basePathRequestMapping = AnnotationUtils.findAnnotation(objInst.getClass(), RequestMapping.class);
if (basePathRequestMapping != null) { if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) { if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0]; basePath = basePathRequestMapping.value()[0];
......
...@@ -35,11 +35,7 @@ public class RequestMappingMethodInterceptor extends AbstractMethodInterceptor { ...@@ -35,11 +35,7 @@ public class RequestMappingMethodInterceptor extends AbstractMethodInterceptor {
String requestURL = null; String requestURL = null;
RequestMapping methodRequestMapping = AnnotationUtils.getAnnotation(m, RequestMapping.class); RequestMapping methodRequestMapping = AnnotationUtils.getAnnotation(m, RequestMapping.class);
if (methodRequestMapping != null) { if (methodRequestMapping != null) {
if (methodRequestMapping.value().length > 0) { requestURL = methodRequestMapping.value().length > 0 ? methodRequestMapping.value()[0] : "";
requestURL = methodRequestMapping.value()[0];
} else if (methodRequestMapping.path().length > 0) {
requestURL = methodRequestMapping.path()[0];
}
} }
return requestURL; return requestURL;
}); });
......
...@@ -14,52 +14,130 @@ ...@@ -14,52 +14,130 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
segmentItems: segmentItems:
- serviceName: spring-3.0.x-scenario - serviceName: spring-3.0.x-scenario
segmentSize: ge 2 segmentSize: ge 4
segments: segments:
- segmentId: not null - segmentId: not null
spans: spans:
- operationName: /healthCheck - operationName: /healthCheck
operationId: 0 operationId: 0
parentSpanId: -1 parentSpanId: -1
spanId: 0 spanId: 0
spanLayer: Http spanLayer: Http
startTime: nq 0 startTime: nq 0
endTime: nq 0 endTime: nq 0
componentId: 14 componentId: 14
isError: false isError: false
spanType: Entry spanType: Entry
peer: '' peer: ''
tags: skipAnalysis: false
- {key: url, value: 'http://localhost:8080/spring-3.0.x-scenario/healthCheck'} tags:
- {key: http.method, value: HEAD} - {key: url, value: 'http://localhost:8080/spring-3.0.x-scenario/healthCheck'}
skipAnalysis: 'false' - {key: http.method, value: HEAD}
- segmentId: not null - segmentId: not null
spans: spans:
- {operationName: test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod, - operationName: /impl/requestmapping
operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq operationId: 0
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', parentSpanId: -1
skipAnalysis: 'false'} spanId: 0
- {operationName: test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff, spanLayer: Http
operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq startTime: nq 0
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', endTime: nq 0
skipAnalysis: 'false'} componentId: 14
- {operationName: test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness, isError: false
operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq spanType: Entry
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', peer: ''
skipAnalysis: 'false'} skipAnalysis: false
- operationName: /case/spring3 tags:
operationId: 0 - {key: url, value: 'http://localhost:8080/spring-3.0.x-scenario/impl/requestmapping'}
parentSpanId: -1 - {key: http.method, value: GET}
spanId: 0 refs:
spanLayer: Http - {parentEndpoint: /case/spring3, networkAddress: 'localhost:8080', refType: CrossProcess,
startTime: nq 0 parentSpanId: 5, parentTraceSegmentId: not null,
endTime: nq 0 parentServiceInstance: not null, parentService: spring-3.0.x-scenario,
componentId: 14 traceId: not null}
isError: false - segmentId: not null
spanType: Entry spans:
peer: '' - operationName: '{GET}/impl/restmapping'
tags: operationId: 0
- {key: url, value: 'http://localhost:8080/spring-3.0.x-scenario/case/spring3'} parentSpanId: -1
- {key: http.method, value: GET} spanId: 0
skipAnalysis: 'false' spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 14
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-3.0.x-scenario/impl/restmapping'}
- {key: http.method, value: GET}
refs:
- {parentEndpoint: /case/spring3, networkAddress: 'localhost:8080', refType: CrossProcess,
parentSpanId: 6, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: spring-3.0.x-scenario,
traceId: not null}
- segmentId: not null
spans:
- {operationName: test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq 0,
endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: false}
- {operationName: test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq 0,
endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: false}
- {operationName: test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq 0,
endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: false}
- operationName: /spring-3.0.x-scenario/impl/requestmapping
operationId: 0
parentSpanId: 4
spanId: 5
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 13
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-3.0.x-scenario/impl/requestmapping'}
- {key: http.method, value: GET}
- operationName: /spring-3.0.x-scenario/impl/restmapping
operationId: 0
parentSpanId: 4
spanId: 6
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 13
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-3.0.x-scenario/impl/restmapping'}
- {key: http.method, value: GET}
- {operationName: test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doInvokeImplCase,
operationId: 0, parentSpanId: 0, spanId: 4, spanLayer: Unknown, startTime: nq 0,
endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: false}
- operationName: /case/spring3
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 14
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-3.0.x-scenario/case/spring3'}
- {key: http.method, value: GET}
...@@ -36,6 +36,7 @@ public class CaseController { ...@@ -36,6 +36,7 @@ public class CaseController {
@ResponseBody @ResponseBody
public String updateUser() { public String updateUser() {
testServiceBean.doSomeBusiness("test"); testServiceBean.doSomeBusiness("test");
testServiceBean.doInvokeImplCase();
return SUCCESS; return SUCCESS;
} }
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package test.apache.skywalking.apm.testcase.spring3.implinterface;
import org.springframework.stereotype.Controller;
@Controller
public class TestCaseController implements TestCaseInterface {
@Override
public String implRequestMappingAnnotationTestCase() {
return "implRequestMappingAnnotationTestCase";
}
@Override
public String implRestAnnotationTestCase() {
return "implRestAnnotationTestCase";
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package test.apache.skywalking.apm.testcase.spring3.implinterface;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@RequestMapping("/impl")
public interface TestCaseInterface {
@RequestMapping("/requestmapping")
@ResponseBody
String implRequestMappingAnnotationTestCase();
@RequestMapping(value = "/restmapping", method = RequestMethod.GET)
@ResponseBody
String implRestAnnotationTestCase();
}
...@@ -20,11 +20,14 @@ package test.apache.skywalking.apm.testcase.spring3.service; ...@@ -20,11 +20,14 @@ package test.apache.skywalking.apm.testcase.spring3.service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean; import test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean;
import test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean; import test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean;
@Service @Service
public class TestServiceBean { public class TestServiceBean {
public static final String URL = "http://localhost:8080/spring-3.0.x-scenario";
@Autowired @Autowired
private TestComponentBean componentBean; private TestComponentBean componentBean;
...@@ -35,4 +38,10 @@ public class TestServiceBean { ...@@ -35,4 +38,10 @@ public class TestServiceBean {
componentBean.componentMethod(name); componentBean.componentMethod(name);
repositoryBean.doSomeStuff(name); repositoryBean.doSomeStuff(name);
} }
public void doInvokeImplCase() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.getForObject(URL + "/impl/requestmapping", String.class);
restTemplate.getForObject(URL + "/impl/restmapping", String.class);
}
} }
...@@ -14,236 +14,315 @@ ...@@ -14,236 +14,315 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
segmentItems: segmentItems:
- serviceName: spring-3.1.x-scenario - serviceName: spring-3.1.x-scenario
segmentSize: ge 7 segmentSize: ge 9
segments: segments:
- segmentId: not null - segmentId: not null
spans: spans:
- operationName: /healthCheck - operationName: /healthCheck
operationId: 0 operationId: 0
parentSpanId: -1 parentSpanId: -1
spanId: 0 spanId: 0
spanLayer: Http spanLayer: Http
startTime: nq 0 startTime: nq 0
endTime: nq 0 endTime: nq 0
componentId: 14 componentId: 14
isError: false isError: false
spanType: Entry spanType: Entry
peer: '' peer: ''
tags: skipAnalysis: false
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/healthCheck'} tags:
- {key: http.method, value: HEAD} - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/healthCheck'}
skipAnalysis: 'false' - {key: http.method, value: HEAD}
- segmentId: not null - segmentId: not null
spans: spans:
- {operationName: test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod, - {operationName: test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq 0,
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: 'false'} skipAnalysis: false}
- {operationName: test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff, - {operationName: test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq 0,
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: 'false'} skipAnalysis: false}
- {operationName: test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness, - {operationName: test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq 0,
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: 'false'} skipAnalysis: false}
- operationName: /case/spring3 - operationName: /case/spring3
operationId: 0 operationId: 0
parentSpanId: -1 parentSpanId: -1
spanId: 0 spanId: 0
spanLayer: Http spanLayer: Http
startTime: nq 0 startTime: nq 0
endTime: nq 0 endTime: nq 0
componentId: 14 componentId: 14
isError: false isError: false
spanType: Entry spanType: Entry
peer: '' peer: ''
tags: skipAnalysis: false
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/case/spring3/'} tags:
- {key: http.method, value: GET} - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/case/spring3/'}
refs: - {key: http.method, value: GET}
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, refs:
parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
null, parentService: spring-3.1.x-scenario, traceId: not null} parentSpanId: 1, parentTraceSegmentId: not null,
skipAnalysis: 'false' parentServiceInstance: not null, parentService: spring-3.1.x-scenario,
- segmentId: not null traceId: not null}
spans: - segmentId: not null
- operationName: '{POST}/create/' spans:
operationId: 0 - operationName: '{POST}/create/'
parentSpanId: -1 operationId: 0
spanId: 0 parentSpanId: -1
spanLayer: Http spanId: 0
startTime: nq 0 spanLayer: Http
endTime: nq 0 startTime: nq 0
componentId: 14 endTime: nq 0
isError: false componentId: 14
spanType: Entry isError: false
peer: '' spanType: Entry
tags: peer: ''
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/create/'} skipAnalysis: false
- {key: http.method, value: POST} tags:
refs: - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/create/'}
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, - {key: http.method, value: POST}
parentSpanId: 2, parentTraceSegmentId: not null, parentServiceInstance: not refs:
null, parentService: spring-3.1.x-scenario, traceId: not null} - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
skipAnalysis: 'false' parentSpanId: 2, parentTraceSegmentId: not null,
- segmentId: not null parentServiceInstance: not null, parentService: spring-3.1.x-scenario,
spans: traceId: not null}
- operationName: '{GET}/get/{id}' - segmentId: not null
operationId: 0 spans:
parentSpanId: -1 - operationName: '{GET}/get/{id}'
spanId: 0 operationId: 0
spanLayer: Http parentSpanId: -1
startTime: nq 0 spanId: 0
endTime: nq 0 spanLayer: Http
componentId: 14 startTime: nq 0
isError: false endTime: nq 0
spanType: Entry componentId: 14
peer: '' isError: false
tags: spanType: Entry
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/get/1'} peer: ''
- {key: http.method, value: GET} skipAnalysis: false
refs: tags:
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/get/1'}
parentSpanId: 3, parentTraceSegmentId: not null, parentServiceInstance: not - {key: http.method, value: GET}
null, parentService: spring-3.1.x-scenario, traceId: not null} refs:
skipAnalysis: 'false' - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
- segmentId: not null parentSpanId: 3, parentTraceSegmentId: not null,
spans: parentServiceInstance: not null, parentService: spring-3.1.x-scenario,
- operationName: '{DELETE}/delete/{id}' traceId: not null}
operationId: 0 - segmentId: not null
parentSpanId: -1 spans:
spanId: 0 - operationName: '{DELETE}/delete/{id}'
spanLayer: Http operationId: 0
startTime: nq 0 parentSpanId: -1
endTime: nq 0 spanId: 0
componentId: 14 spanLayer: Http
isError: false startTime: nq 0
spanType: Entry endTime: nq 0
peer: '' componentId: 14
tags: isError: false
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/delete/1'} spanType: Entry
- {key: http.method, value: DELETE} peer: ''
refs: skipAnalysis: false
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, tags:
parentSpanId: 5, parentTraceSegmentId: not null, parentServiceInstance: not - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/delete/1'}
null, parentService: spring-3.1.x-scenario, traceId: not null} - {key: http.method, value: DELETE}
skipAnalysis: 'false' refs:
- segmentId: not null - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
spans: parentSpanId: 5, parentTraceSegmentId: not null,
- operationName: /spring-3.1.x-scenario/case/spring3/ parentServiceInstance: not null, parentService: spring-3.1.x-scenario,
operationId: 0 traceId: not null}
parentSpanId: 0 - segmentId: not null
spanId: 1 spans:
spanLayer: Http - operationName: '{PUT}/update/{id}'
startTime: nq 0 operationId: 0
endTime: nq 0 parentSpanId: -1
componentId: 12 spanId: 0
isError: false spanLayer: Http
spanType: Exit startTime: nq 0
peer: localhost:8080 endTime: nq 0
tags: componentId: 14
- {key: http.method, value: GET} isError: false
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/case/spring3/'} spanType: Entry
skipAnalysis: 'false' peer: ''
- operationName: /spring-3.1.x-scenario/create/ skipAnalysis: false
operationId: 0 tags:
parentSpanId: 0 - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/update/1'}
spanId: 2 - {key: http.method, value: PUT}
spanLayer: Http refs:
startTime: nq 0 - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
endTime: nq 0 parentSpanId: 4, parentTraceSegmentId: not null,
componentId: 13 parentServiceInstance: not null, parentService: spring-3.1.x-scenario,
isError: false traceId: not null}
spanType: Exit - segmentId: not null
peer: localhost:8080 spans:
tags: - operationName: /impl/requestmapping
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/create/'} operationId: 0
- {key: http.method, value: POST} parentSpanId: -1
skipAnalysis: 'false' spanId: 0
- operationName: /spring-3.1.x-scenario/get/1 spanLayer: Http
operationId: 0 startTime: nq 0
parentSpanId: 0 endTime: nq 0
spanId: 3 componentId: 14
spanLayer: Http isError: false
startTime: nq 0 spanType: Entry
endTime: nq 0 peer: ''
componentId: 13 skipAnalysis: false
isError: false tags:
spanType: Exit - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/impl/requestmapping'}
peer: localhost:8080 - {key: http.method, value: GET}
tags: refs:
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/get/1'} - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
- {key: http.method, value: GET} parentSpanId: 6, parentTraceSegmentId: not null,
skipAnalysis: 'false' parentServiceInstance: not null, parentService: spring-3.1.x-scenario,
- operationName: /spring-3.1.x-scenario/update/1 traceId: not null}
operationId: 0 - segmentId: not null
parentSpanId: 0 spans:
spanId: 4 - operationName: /spring-3.1.x-scenario/case/spring3/
spanLayer: Http operationId: 0
startTime: nq 0 parentSpanId: 0
endTime: nq 0 spanId: 1
componentId: 13 spanLayer: Http
isError: false startTime: nq 0
spanType: Exit endTime: nq 0
peer: localhost:8080 componentId: 12
tags: isError: false
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/update/1'} spanType: Exit
- {key: http.method, value: PUT} peer: localhost:8080
skipAnalysis: 'false' skipAnalysis: false
- operationName: /spring-3.1.x-scenario/delete/1 tags:
operationId: 0 - {key: http.method, value: GET}
parentSpanId: 0 - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/case/spring3/'}
spanId: 5 - operationName: /spring-3.1.x-scenario/create/
spanLayer: Http operationId: 0
startTime: nq 0 parentSpanId: 0
endTime: nq 0 spanId: 2
componentId: 13 spanLayer: Http
isError: false startTime: nq 0
spanType: Exit endTime: nq 0
peer: localhost:8080 componentId: 13
tags: isError: false
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/delete/1'} spanType: Exit
- {key: http.method, value: DELETE} peer: localhost:8080
skipAnalysis: 'false' skipAnalysis: false
- operationName: /case/resttemplate tags:
operationId: 0 - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/create/'}
parentSpanId: -1 - {key: http.method, value: POST}
spanId: 0 - operationName: /spring-3.1.x-scenario/get/1
spanLayer: Http operationId: 0
startTime: nq 0 parentSpanId: 0
endTime: nq 0 spanId: 3
componentId: 14 spanLayer: Http
isError: false startTime: nq 0
spanType: Entry endTime: nq 0
peer: '' componentId: 13
tags: isError: false
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/case/resttemplate'} spanType: Exit
- {key: http.method, value: GET} peer: localhost:8080
- key: http.params skipAnalysis: false
value: |- tags:
q1=[v1] - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/get/1'}
chinese=[中文] - {key: http.method, value: GET}
skipAnalysis: 'false' - operationName: /spring-3.1.x-scenario/update/1
- segmentId: not null operationId: 0
spans: parentSpanId: 0
- operationName: '{PUT}/update/{id}' spanId: 4
operationId: 0 spanLayer: Http
parentSpanId: -1 startTime: nq 0
spanId: 0 endTime: nq 0
spanLayer: Http componentId: 13
startTime: nq 0 isError: false
endTime: nq 0 spanType: Exit
componentId: 14 peer: localhost:8080
isError: false skipAnalysis: false
spanType: Entry tags:
peer: '' - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/update/1'}
tags: - {key: http.method, value: PUT}
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/update/1'} - operationName: /spring-3.1.x-scenario/delete/1
- {key: http.method, value: PUT} operationId: 0
refs: parentSpanId: 0
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, spanId: 5
parentSpanId: 4, parentTraceSegmentId: not null, parentServiceInstance: not spanLayer: Http
null, parentService: spring-3.1.x-scenario, traceId: not null} startTime: nq 0
skipAnalysis: 'false' endTime: nq 0
componentId: 13
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/delete/1'}
- {key: http.method, value: DELETE}
- operationName: /spring-3.1.x-scenario/impl/requestmapping
operationId: 0
parentSpanId: 0
spanId: 6
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 12
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/impl/requestmapping'}
- operationName: /spring-3.1.x-scenario/impl/restmapping
operationId: 0
parentSpanId: 0
spanId: 7
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 12
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/impl/restmapping'}
- operationName: /case/resttemplate
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 14
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/case/resttemplate'}
- {key: http.method, value: GET}
- key: http.params
value: |-
q1=[v1]
chinese=[中文]
- segmentId: not null
spans:
- operationName: '{GET}/impl/restmapping'
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 14
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/impl/restmapping'}
- {key: http.method, value: GET}
refs:
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
parentSpanId: 7, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: spring-3.1.x-scenario,
traceId: not null}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package test.apache.skywalking.apm.testcase.implinterface;
import org.springframework.stereotype.Controller;
@Controller
public class TestCaseController implements TestCaseInterface {
@Override
public String implRequestMappingAnnotationTestCase() {
return "implRequestMappingAnnotationTestCase";
}
@Override
public String implRestAnnotationTestCase() {
return "implRestAnnotationTestCase";
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package test.apache.skywalking.apm.testcase.implinterface;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@RequestMapping("/impl")
public interface TestCaseInterface {
@RequestMapping("/requestmapping")
@ResponseBody
String implRequestMappingAnnotationTestCase();
@RequestMapping(value = "/restmapping", method = RequestMethod.GET)
@ResponseBody
String implRestAnnotationTestCase();
}
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
package test.apache.skywalking.apm.testcase.resttemplate; package test.apache.skywalking.apm.testcase.resttemplate;
import java.io.IOException; import java.io.IOException;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
...@@ -61,6 +62,14 @@ public class RestTemplateController { ...@@ -61,6 +62,14 @@ public class RestTemplateController {
//Delete user //Delete user
new RestTemplate().delete(URL + "/delete/{id}", 1); new RestTemplate().delete(URL + "/delete/{id}", 1);
Request implRequestMappingRequest = new Request.Builder().url(URL + "/impl/requestmapping").build();
response = new OkHttpClient().newCall(implRequestMappingRequest).execute();
LOGGER.info(response.toString());
Request implRestMappingRequest = new Request.Builder().url(URL + "/impl/restmapping").build();
response = new OkHttpClient().newCall(implRestMappingRequest).execute();
LOGGER.info(response.toString());
return SUCCESS; return SUCCESS;
} }
......
...@@ -14,232 +14,312 @@ ...@@ -14,232 +14,312 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
segmentItems: segmentItems:
- serviceName: spring-4.1.x-scenario - serviceName: spring-4.1.x-scenario
segmentSize: ge 7 segmentSize: ge 9
segments: segments:
- segmentId: not null - segmentId: not null
spans: spans:
- operationName: /healthCheck - operationName: /healthCheck
operationId: 0 operationId: 0
parentSpanId: -1 parentSpanId: -1
spanId: 0 spanId: 0
spanLayer: Http spanLayer: Http
startTime: nq 0 startTime: nq 0
endTime: nq 0 endTime: nq 0
componentId: 14 componentId: 14
isError: false isError: false
spanType: Entry spanType: Entry
peer: '' peer: ''
tags: skipAnalysis: false
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/healthCheck'} tags:
- {key: http.method, value: HEAD} - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/healthCheck'}
skipAnalysis: 'false' - {key: http.method, value: HEAD}
- segmentId: not null - segmentId: not null
spans: spans:
- {operationName: test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod, - {operationName: test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq 0,
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: 'false'} skipAnalysis: false}
- {operationName: test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff, - {operationName: test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq 0,
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: 'false'} skipAnalysis: false}
- {operationName: test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness, - {operationName: test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq 0,
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '', endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
skipAnalysis: 'false'} skipAnalysis: false}
- operationName: /case/spring3 - operationName: /case/spring3
operationId: 0 operationId: 0
parentSpanId: -1 parentSpanId: -1
spanId: 0 spanId: 0
spanLayer: Http spanLayer: Http
startTime: nq 0 startTime: nq 0
endTime: nq 0 endTime: nq 0
componentId: 14 componentId: 14
isError: false isError: false
spanType: Entry spanType: Entry
peer: '' peer: ''
tags: skipAnalysis: false
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/case/spring3/'} tags:
- {key: http.method, value: GET} - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/case/spring3/'}
refs: - {key: http.method, value: GET}
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, refs:
parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
null, parentService: spring-4.1.x-scenario, traceId: not null} parentSpanId: 1, parentTraceSegmentId: not null,
skipAnalysis: 'false' parentServiceInstance: not null, parentService: spring-4.1.x-scenario,
- segmentId: not null traceId: not null}
spans: - segmentId: not null
- operationName: '{POST}/create/' spans:
operationId: 0 - operationName: '{POST}/create/'
parentSpanId: -1 operationId: 0
spanId: 0 parentSpanId: -1
spanLayer: Http spanId: 0
startTime: nq 0 spanLayer: Http
endTime: nq 0 startTime: nq 0
componentId: 14 endTime: nq 0
isError: false componentId: 14
spanType: Entry isError: false
peer: '' spanType: Entry
tags: peer: ''
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/create/'} skipAnalysis: false
- {key: http.method, value: POST} tags:
refs: - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/create/'}
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, - {key: http.method, value: POST}
parentSpanId: 2, parentTraceSegmentId: not null, parentServiceInstance: not refs:
null, parentService: spring-4.1.x-scenario, traceId: not null} - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
skipAnalysis: 'false' parentSpanId: 2, parentTraceSegmentId: not null,
- segmentId: not null parentServiceInstance: not null, parentService: spring-4.1.x-scenario,
spans: traceId: not null}
- operationName: '{GET}/get/{id}' - segmentId: not null
operationId: 0 spans:
parentSpanId: -1 - operationName: '{GET}/get/{id}'
spanId: 0 operationId: 0
spanLayer: Http parentSpanId: -1
startTime: nq 0 spanId: 0
endTime: nq 0 spanLayer: Http
componentId: 14 startTime: nq 0
isError: false endTime: nq 0
spanType: Entry componentId: 14
peer: '' isError: false
tags: spanType: Entry
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/get/1'} peer: ''
- {key: http.method, value: GET} skipAnalysis: false
refs: tags:
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/get/1'}
parentSpanId: 3, parentTraceSegmentId: not null, parentServiceInstance: not - {key: http.method, value: GET}
null, parentService: spring-4.1.x-scenario, traceId: not null} refs:
skipAnalysis: 'false' - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
- segmentId: not null parentSpanId: 3, parentTraceSegmentId: not null,
spans: parentServiceInstance: not null, parentService: spring-4.1.x-scenario,
- operationName: '{DELETE}/delete/{id}' traceId: not null}
operationId: 0 - segmentId: not null
parentSpanId: -1 spans:
spanId: 0 - operationName: '{PUT}/update/{id}'
spanLayer: Http operationId: 0
startTime: nq 0 parentSpanId: -1
endTime: nq 0 spanId: 0
componentId: 14 spanLayer: Http
isError: false startTime: nq 0
spanType: Entry endTime: nq 0
peer: '' componentId: 14
tags: isError: false
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/delete/1'} spanType: Entry
- {key: http.method, value: DELETE} peer: ''
refs: skipAnalysis: false
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, tags:
parentSpanId: 5, parentTraceSegmentId: not null, parentServiceInstance: not - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/update/1'}
null, parentService: spring-4.1.x-scenario, traceId: not null} - {key: http.method, value: PUT}
skipAnalysis: 'false' refs:
- segmentId: not null - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
spans: parentSpanId: 4, parentTraceSegmentId: not null,
- operationName: /spring-4.1.x-scenario/case/spring3/ parentServiceInstance: not null, parentService: spring-4.1.x-scenario,
operationId: 0 traceId: not null}
parentSpanId: 0 - segmentId: not null
spanId: 1 spans:
spanLayer: Http - operationName: '{DELETE}/delete/{id}'
startTime: nq 0 operationId: 0
endTime: nq 0 parentSpanId: -1
componentId: 12 spanId: 0
isError: false spanLayer: Http
spanType: Exit startTime: nq 0
peer: localhost:8080 endTime: nq 0
tags: componentId: 14
- {key: http.method, value: GET} isError: false
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/case/spring3/'} spanType: Entry
skipAnalysis: 'false' peer: ''
- operationName: /spring-4.1.x-scenario/create/ skipAnalysis: false
operationId: 0 tags:
parentSpanId: 0 - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/delete/1'}
spanId: 2 - {key: http.method, value: DELETE}
spanLayer: Http refs:
startTime: nq 0 - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
endTime: nq 0 parentSpanId: 5, parentTraceSegmentId: not null,
componentId: 13 parentServiceInstance: not null, parentService: spring-4.1.x-scenario,
isError: false traceId: not null}
spanType: Exit - segmentId: not null
peer: localhost:8080 spans:
tags: - operationName: /impl/requestmapping
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/create/'} operationId: 0
- {key: http.method, value: POST} parentSpanId: -1
skipAnalysis: 'false' spanId: 0
- operationName: /spring-4.1.x-scenario/get/1 spanLayer: Http
operationId: 0 startTime: nq 0
parentSpanId: 0 endTime: nq 0
spanId: 3 componentId: 14
spanLayer: Http isError: false
startTime: nq 0 spanType: Entry
endTime: nq 0 peer: ''
componentId: 13 skipAnalysis: false
isError: false tags:
spanType: Exit - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/impl/requestmapping'}
peer: localhost:8080 - {key: http.method, value: GET}
tags: refs:
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/get/1'} - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
- {key: http.method, value: GET} parentSpanId: 6, parentTraceSegmentId: not null,
skipAnalysis: 'false' parentServiceInstance: not null, parentService: spring-4.1.x-scenario,
- operationName: /spring-4.1.x-scenario/update/1 traceId: not null}
operationId: 0 - segmentId: not null
parentSpanId: 0 spans:
spanId: 4 - operationName: /spring-4.1.x-scenario/case/spring3/
spanLayer: Http operationId: 0
startTime: nq 0 parentSpanId: 0
endTime: nq 0 spanId: 1
componentId: 13 spanLayer: Http
isError: false startTime: nq 0
spanType: Exit endTime: nq 0
peer: localhost:8080 componentId: 12
tags: isError: false
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/update/1'} spanType: Exit
- {key: http.method, value: PUT} peer: localhost:8080
skipAnalysis: 'false' skipAnalysis: false
- operationName: /spring-4.1.x-scenario/delete/1 tags:
operationId: 0 - {key: http.method, value: GET}
parentSpanId: 0 - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/case/spring3/'}
spanId: 5 - operationName: /spring-4.1.x-scenario/create/
spanLayer: Http operationId: 0
startTime: nq 0 parentSpanId: 0
endTime: nq 0 spanId: 2
componentId: 13 spanLayer: Http
isError: false startTime: nq 0
spanType: Exit endTime: nq 0
peer: localhost:8080 componentId: 13
tags: isError: false
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/delete/1'} spanType: Exit
- {key: http.method, value: DELETE} peer: localhost:8080
skipAnalysis: 'false' skipAnalysis: false
- operationName: /case/resttemplate tags:
operationId: 0 - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/create/'}
parentSpanId: -1 - {key: http.method, value: POST}
spanId: 0 - operationName: /spring-4.1.x-scenario/get/1
spanLayer: Http operationId: 0
startTime: nq 0 parentSpanId: 0
endTime: nq 0 spanId: 3
componentId: 14 spanLayer: Http
isError: false startTime: nq 0
spanType: Entry endTime: nq 0
peer: '' componentId: 13
tags: isError: false
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/case/resttemplate'} spanType: Exit
- {key: http.method, value: GET} peer: localhost:8080
skipAnalysis: 'false' skipAnalysis: false
- segmentId: not null tags:
spans: - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/get/1'}
- operationName: '{PUT}/update/{id}' - {key: http.method, value: GET}
operationId: 0 - operationName: /spring-4.1.x-scenario/update/1
parentSpanId: -1 operationId: 0
spanId: 0 parentSpanId: 0
spanLayer: Http spanId: 4
startTime: nq 0 spanLayer: Http
endTime: nq 0 startTime: nq 0
componentId: 14 endTime: nq 0
isError: false componentId: 13
spanType: Entry isError: false
peer: '' spanType: Exit
tags: peer: localhost:8080
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/update/1'} skipAnalysis: false
- {key: http.method, value: PUT} tags:
refs: - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/update/1'}
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess, - {key: http.method, value: PUT}
parentSpanId: 4, parentTraceSegmentId: not null, parentServiceInstance: not - operationName: /spring-4.1.x-scenario/delete/1
null, parentService: spring-4.1.x-scenario, traceId: not null} operationId: 0
skipAnalysis: 'false' parentSpanId: 0
spanId: 5
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 13
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/delete/1'}
- {key: http.method, value: DELETE}
- operationName: /spring-4.1.x-scenario/impl/requestmapping
operationId: 0
parentSpanId: 0
spanId: 6
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 12
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/impl/requestmapping'}
- operationName: /spring-4.1.x-scenario/impl/restmapping
operationId: 0
parentSpanId: 0
spanId: 7
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 12
isError: false
spanType: Exit
peer: localhost:8080
skipAnalysis: false
tags:
- {key: http.method, value: GET}
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/impl/restmapping'}
- operationName: /case/resttemplate
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 14
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/case/resttemplate'}
- {key: http.method, value: GET}
- segmentId: not null
spans:
- operationName: '{GET}/impl/restmapping'
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 14
isError: false
spanType: Entry
peer: ''
skipAnalysis: false
tags:
- {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/impl/restmapping'}
- {key: http.method, value: GET}
refs:
- {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080', refType: CrossProcess,
parentSpanId: 7, parentTraceSegmentId: not null,
parentServiceInstance: not null, parentService: spring-4.1.x-scenario,
traceId: not null}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package test.apache.skywalking.apm.testcase.implinterface;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestCaseController implements TestCaseInterface {
@Override
public String implRequestMappingAnnotationTestCase() {
return "implRequestMappingAnnotationTestCase";
}
@Override
public String implRestAnnotationTestCase() {
return "implRestAnnotationTestCase";
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package test.apache.skywalking.apm.testcase.implinterface;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@RequestMapping("/impl")
public interface TestCaseInterface {
@RequestMapping("/requestmapping")
String implRequestMappingAnnotationTestCase();
@RequestMapping(value = "/restmapping", method = RequestMethod.GET)
String implRestAnnotationTestCase();
}
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
package test.apache.skywalking.apm.testcase.resttemplate; package test.apache.skywalking.apm.testcase.resttemplate;
import java.io.IOException; import java.io.IOException;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
...@@ -61,6 +62,14 @@ public class RestTemplateController { ...@@ -61,6 +62,14 @@ public class RestTemplateController {
//Delete user //Delete user
new RestTemplate().delete(URL + "/delete/{id}", 1); new RestTemplate().delete(URL + "/delete/{id}", 1);
Request implRequestMappingRequest = new Request.Builder().url(URL + "/impl/requestmapping").build();
response = new OkHttpClient().newCall(implRequestMappingRequest).execute();
LOGGER.info(response.toString());
Request implRestMappingRequest = new Request.Builder().url(URL + "/impl/restmapping").build();
response = new OkHttpClient().newCall(implRestMappingRequest).execute();
LOGGER.info(response.toString());
return SUCCESS; return SUCCESS;
} }
......
...@@ -21,10 +21,11 @@ package test.apache.skywalking.apm.testcase.implinterface; ...@@ -21,10 +21,11 @@ package test.apache.skywalking.apm.testcase.implinterface;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/impl")
public interface TestCaseInterface { public interface TestCaseInterface {
@RequestMapping("/impl/requestmapping") @RequestMapping(path = "/requestmapping")
String implRequestMappingAnnotationTestCase(); String implRequestMappingAnnotationTestCase();
@GetMapping("/impl/restmapping") @GetMapping("/restmapping")
String implRestAnnotationTestCase(); String implRestAnnotationTestCase();
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册