Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
10ddf0c3
S
SkyWalking
项目概览
killuaz丶x
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
10ddf0c3
编写于
4月 29, 2021
作者:
D
Darcy
提交者:
GitHub
4月 29, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix a bug that spring-mvc set an error endpoint name (#6783)
上级
db1d655b
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
994 addition
and
523 deletion
+994
-523
CHANGES.md
CHANGES.md
+2
-1
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v3/ControllerConstructorInterceptor.java
...lugin/spring/mvc/v3/ControllerConstructorInterceptor.java
+2
-1
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerConstructorInterceptor.java
...lugin/spring/mvc/v4/ControllerConstructorInterceptor.java
+2
-1
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerForLowVersionConstructorInterceptor.java
...mvc/v4/ControllerForLowVersionConstructorInterceptor.java
+2
-1
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/ControllerConstructorInterceptor.java
...lugin/spring/mvc/v5/ControllerConstructorInterceptor.java
+2
-1
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RequestMappingMethodInterceptor.java
.../commons/interceptor/RequestMappingMethodInterceptor.java
+1
-5
test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml
.../scenarios/spring-3.0.x-scenario/config/expectedData.yaml
+127
-49
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/CaseController.java
...pache/skywalking/apm/testcase/spring3/CaseController.java
+1
-0
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseController.java
...pm/testcase/spring3/implinterface/TestCaseController.java
+35
-0
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseInterface.java
...apm/testcase/spring3/implinterface/TestCaseInterface.java
+34
-0
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/service/TestServiceBean.java
...walking/apm/testcase/spring3/service/TestServiceBean.java
+9
-0
test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml
.../scenarios/spring-3.1.x-scenario/config/expectedData.yaml
+312
-233
test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
...alking/apm/testcase/implinterface/TestCaseController.java
+35
-0
test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
...walking/apm/testcase/implinterface/TestCaseInterface.java
+34
-0
test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
...ing/apm/testcase/resttemplate/RestTemplateController.java
+9
-0
test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml
.../scenarios/spring-4.1.x-scenario/config/expectedData.yaml
+309
-229
test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
...alking/apm/testcase/implinterface/TestCaseController.java
+35
-0
test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
...walking/apm/testcase/implinterface/TestCaseInterface.java
+31
-0
test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
...ing/apm/testcase/resttemplate/RestTemplateController.java
+9
-0
test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
...walking/apm/testcase/implinterface/TestCaseInterface.java
+3
-2
未找到文件。
CHANGES.md
浏览文件 @
10ddf0c3
...
...
@@ -17,7 +17,8 @@ Release Notes.
*
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.
*
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.
#### OAP-Backend
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v3/ControllerConstructorInterceptor.java
浏览文件 @
10ddf0c3
...
...
@@ -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.InstanceConstructorInterceptor
;
import
org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache
;
import
org.springframework.core.annotation.AnnotationUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
/**
...
...
@@ -32,7 +33,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
String
basePath
=
""
;
RequestMapping
basePathRequestMapping
=
objInst
.
getClass
().
getAnnotation
(
RequestMapping
.
class
);
RequestMapping
basePathRequestMapping
=
AnnotationUtils
.
findAnnotation
(
objInst
.
getClass
(),
RequestMapping
.
class
);
if
(
basePathRequestMapping
!=
null
)
{
if
(
basePathRequestMapping
.
value
().
length
>
0
)
{
basePath
=
basePathRequestMapping
.
value
()[
0
];
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerConstructorInterceptor.java
浏览文件 @
10ddf0c3
...
...
@@ -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.PathMappingCache
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
import
org.springframework.core.annotation.AnnotationUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
/**
...
...
@@ -42,7 +43,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
String
basePath
=
""
;
RequestMapping
basePathRequestMapping
=
objInst
.
getClass
().
getAnnotation
(
RequestMapping
.
class
);
RequestMapping
basePathRequestMapping
=
AnnotationUtils
.
findAnnotation
(
objInst
.
getClass
(),
RequestMapping
.
class
);
if
(
basePathRequestMapping
!=
null
)
{
if
(
basePathRequestMapping
.
value
().
length
>
0
)
{
basePath
=
basePathRequestMapping
.
value
()[
0
];
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerForLowVersionConstructorInterceptor.java
浏览文件 @
10ddf0c3
...
...
@@ -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.plugin.spring.mvc.commons.EnhanceRequireObjectCache
;
import
org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache
;
import
org.springframework.core.annotation.AnnotationUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
public
class
ControllerForLowVersionConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
String
basePath
=
""
;
RequestMapping
basePathRequestMapping
=
objInst
.
getClass
().
getAnnotation
(
RequestMapping
.
class
);
RequestMapping
basePathRequestMapping
=
AnnotationUtils
.
findAnnotation
(
objInst
.
getClass
(),
RequestMapping
.
class
);
if
(
basePathRequestMapping
!=
null
)
{
if
(
basePathRequestMapping
.
value
().
length
>
0
)
{
basePath
=
basePathRequestMapping
.
value
()[
0
];
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/ControllerConstructorInterceptor.java
浏览文件 @
10ddf0c3
...
...
@@ -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.PathMappingCache
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
import
org.springframework.core.annotation.AnnotationUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
/**
...
...
@@ -42,7 +43,7 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
String
basePath
=
""
;
RequestMapping
basePathRequestMapping
=
objInst
.
getClass
().
getAnnotation
(
RequestMapping
.
class
);
RequestMapping
basePathRequestMapping
=
AnnotationUtils
.
findAnnotation
(
objInst
.
getClass
(),
RequestMapping
.
class
);
if
(
basePathRequestMapping
!=
null
)
{
if
(
basePathRequestMapping
.
value
().
length
>
0
)
{
basePath
=
basePathRequestMapping
.
value
()[
0
];
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RequestMappingMethodInterceptor.java
浏览文件 @
10ddf0c3
...
...
@@ -35,11 +35,7 @@ public class RequestMappingMethodInterceptor extends AbstractMethodInterceptor {
String
requestURL
=
null
;
RequestMapping
methodRequestMapping
=
AnnotationUtils
.
getAnnotation
(
m
,
RequestMapping
.
class
);
if
(
methodRequestMapping
!=
null
)
{
if
(
methodRequestMapping
.
value
().
length
>
0
)
{
requestURL
=
methodRequestMapping
.
value
()[
0
];
}
else
if
(
methodRequestMapping
.
path
().
length
>
0
)
{
requestURL
=
methodRequestMapping
.
path
()[
0
];
}
requestURL
=
methodRequestMapping
.
value
().
length
>
0
?
methodRequestMapping
.
value
()[
0
]
:
""
;
}
return
requestURL
;
});
...
...
test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml
浏览文件 @
10ddf0c3
...
...
@@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems
:
-
serviceName
:
spring-3.0.x-scenario
segmentSize
:
ge
2
-
serviceName
:
spring-3.0.x-scenario
segmentSize
:
ge
4
segments
:
-
segmentId
:
not
null
spans
:
...
...
@@ -30,24 +30,102 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.0.x-scenario/healthCheck'
}
-
{
key
:
http.method
,
value
:
HEAD
}
skipAnalysis
:
'
false'
-
segmentId
:
not
null
spans
:
-
operationName
:
/impl/requestmapping
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/impl/requestmapping'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
/case/spring3
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
5
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-3.0.x-scenario
,
traceId
:
not null
}
-
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.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'
}
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'
}
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'
}
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
...
...
@@ -59,7 +137,7 @@ segmentItems:
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
}
skipAnalysis
:
'
false'
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/CaseController.java
浏览文件 @
10ddf0c3
...
...
@@ -36,6 +36,7 @@ public class CaseController {
@ResponseBody
public
String
updateUser
()
{
testServiceBean
.
doSomeBusiness
(
"test"
);
testServiceBean
.
doInvokeImplCase
();
return
SUCCESS
;
}
...
...
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseController.java
0 → 100644
浏览文件 @
10ddf0c3
/*
* 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"
;
}
}
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseInterface.java
0 → 100644
浏览文件 @
10ddf0c3
/*
* 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
();
}
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/service/TestServiceBean.java
浏览文件 @
10ddf0c3
...
...
@@ -20,11 +20,14 @@ package test.apache.skywalking.apm.testcase.spring3.service;
import
org.springframework.beans.factory.annotation.Autowired
;
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.component.TestComponentBean
;
@Service
public
class
TestServiceBean
{
public
static
final
String
URL
=
"http://localhost:8080/spring-3.0.x-scenario"
;
@Autowired
private
TestComponentBean
componentBean
;
...
...
@@ -35,4 +38,10 @@ public class TestServiceBean {
componentBean
.
componentMethod
(
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
);
}
}
test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml
浏览文件 @
10ddf0c3
...
...
@@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems
:
-
serviceName
:
spring-3.1.x-scenario
segmentSize
:
ge
7
-
serviceName
:
spring-3.1.x-scenario
segmentSize
:
ge
9
segments
:
-
segmentId
:
not
null
spans
:
...
...
@@ -30,24 +30,24 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/healthCheck'
}
-
{
key
:
http.method
,
value
:
HEAD
}
skipAnalysis
:
'
false'
-
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'
}
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'
}
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'
}
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Unknown
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
93
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/case/spring3
operationId
:
0
parentSpanId
:
-1
...
...
@@ -59,14 +59,15 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/case/spring3/'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{POST}/create/'
...
...
@@ -80,14 +81,15 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/create/'
}
-
{
key
:
http.method
,
value
:
POST
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{GET}/get/{id}'
...
...
@@ -101,14 +103,15 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/get/1'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
3
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
3
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{DELETE}/delete/{id}'
...
...
@@ -122,14 +125,59 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/delete/1'
}
-
{
key
:
http.method
,
value
:
DELETE
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
5
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
5
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{PUT}/update/{id}'
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/update/1'
}
-
{
key
:
http.method
,
value
:
PUT
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
4
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/impl/requestmapping
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/requestmapping'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
6
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/spring-3.1.x-scenario/case/spring3/
...
...
@@ -143,10 +191,10 @@ segmentItems:
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/case/spring3/'
}
skipAnalysis
:
'
false'
-
operationName
:
/spring-3.1.x-scenario/create/
operationId
:
0
parentSpanId
:
0
...
...
@@ -158,10 +206,10 @@ segmentItems:
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/create/'
}
-
{
key
:
http.method
,
value
:
POST
}
skipAnalysis
:
'
false'
-
operationName
:
/spring-3.1.x-scenario/get/1
operationId
:
0
parentSpanId
:
0
...
...
@@ -173,10 +221,10 @@ segmentItems:
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/get/1'
}
-
{
key
:
http.method
,
value
:
GET
}
skipAnalysis
:
'
false'
-
operationName
:
/spring-3.1.x-scenario/update/1
operationId
:
0
parentSpanId
:
0
...
...
@@ -188,10 +236,10 @@ segmentItems:
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/update/1'
}
-
{
key
:
http.method
,
value
:
PUT
}
skipAnalysis
:
'
false'
-
operationName
:
/spring-3.1.x-scenario/delete/1
operationId
:
0
parentSpanId
:
0
...
...
@@ -203,10 +251,40 @@ segmentItems:
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
}
skipAnalysis
:
'
false'
-
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
...
...
@@ -218,6 +296,7 @@ segmentItems:
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
}
...
...
@@ -225,10 +304,9 @@ segmentItems:
value
:
|-
q1=[v1]
chinese=[中文]
skipAnalysis
:
'
false'
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{PUT}/update/{id}
'
-
operationName
:
'
{GET}/impl/restmapping
'
operationId
:
0
parentSpanId
:
-1
spanId
:
0
...
...
@@ -239,11 +317,12 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/update/1
'
}
-
{
key
:
http.method
,
value
:
PU
T
}
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-3.1.x-scenario/impl/restmapping
'
}
-
{
key
:
http.method
,
value
:
GE
T
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
4
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
7
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-3.1.x-scenario
,
traceId
:
not null
}
test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
0 → 100644
浏览文件 @
10ddf0c3
/*
* 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"
;
}
}
test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
0 → 100644
浏览文件 @
10ddf0c3
/*
* 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
();
}
test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
浏览文件 @
10ddf0c3
...
...
@@ -19,6 +19,7 @@
package
test.apache.skywalking.apm.testcase.resttemplate
;
import
java.io.IOException
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
import
okhttp3.Response
;
...
...
@@ -61,6 +62,14 @@ public class RestTemplateController {
//Delete user
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
;
}
...
...
test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml
浏览文件 @
10ddf0c3
...
...
@@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems
:
-
serviceName
:
spring-4.1.x-scenario
segmentSize
:
ge
7
-
serviceName
:
spring-4.1.x-scenario
segmentSize
:
ge
9
segments
:
-
segmentId
:
not
null
spans
:
...
...
@@ -30,24 +30,24 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/healthCheck'
}
-
{
key
:
http.method
,
value
:
HEAD
}
skipAnalysis
:
'
false'
-
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'
}
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'
}
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'
}
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Unknown
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
93
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/case/spring3
operationId
:
0
parentSpanId
:
-1
...
...
@@ -59,14 +59,15 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/case/spring3/'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{POST}/create/'
...
...
@@ -80,14 +81,15 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/create/'
}
-
{
key
:
http.method
,
value
:
POST
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{GET}/get/{id}'
...
...
@@ -101,14 +103,37 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/get/1'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
3
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
3
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{PUT}/update/{id}'
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/update/1'
}
-
{
key
:
http.method
,
value
:
PUT
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
4
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{DELETE}/delete/{id}'
...
...
@@ -122,14 +147,37 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/delete/1'
}
-
{
key
:
http.method
,
value
:
DELETE
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
5
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
5
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/impl/requestmapping
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/requestmapping'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
6
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/spring-4.1.x-scenario/case/spring3/
...
...
@@ -143,10 +191,10 @@ segmentItems:
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/case/spring3/'
}
skipAnalysis
:
'
false'
-
operationName
:
/spring-4.1.x-scenario/create/
operationId
:
0
parentSpanId
:
0
...
...
@@ -158,10 +206,10 @@ segmentItems:
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/create/'
}
-
{
key
:
http.method
,
value
:
POST
}
skipAnalysis
:
'
false'
-
operationName
:
/spring-4.1.x-scenario/get/1
operationId
:
0
parentSpanId
:
0
...
...
@@ -173,10 +221,10 @@ segmentItems:
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/get/1'
}
-
{
key
:
http.method
,
value
:
GET
}
skipAnalysis
:
'
false'
-
operationName
:
/spring-4.1.x-scenario/update/1
operationId
:
0
parentSpanId
:
0
...
...
@@ -188,10 +236,10 @@ segmentItems:
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/update/1'
}
-
{
key
:
http.method
,
value
:
PUT
}
skipAnalysis
:
'
false'
-
operationName
:
/spring-4.1.x-scenario/delete/1
operationId
:
0
parentSpanId
:
0
...
...
@@ -203,10 +251,40 @@ segmentItems:
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
}
skipAnalysis
:
'
false'
-
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
...
...
@@ -218,13 +296,13 @@ segmentItems:
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
}
skipAnalysis
:
'
false'
-
segmentId
:
not
null
spans
:
-
operationName
:
'
{PUT}/update/{id}
'
-
operationName
:
'
{GET}/impl/restmapping
'
operationId
:
0
parentSpanId
:
-1
spanId
:
0
...
...
@@ -235,11 +313,13 @@ segmentItems:
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/update/1
'
}
-
{
key
:
http.method
,
value
:
PU
T
}
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-4.1.x-scenario/impl/restmapping
'
}
-
{
key
:
http.method
,
value
:
GE
T
}
refs
:
-
{
parentEndpoint
:
/case/resttemplate
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
4
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not
null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
skipAnalysis
:
'
false'
parentSpanId
:
7
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
spring-4.1.x-scenario
,
traceId
:
not null
}
test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
0 → 100644
浏览文件 @
10ddf0c3
/*
* 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"
;
}
}
test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
0 → 100644
浏览文件 @
10ddf0c3
/*
* 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
();
}
test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
浏览文件 @
10ddf0c3
...
...
@@ -19,6 +19,7 @@
package
test.apache.skywalking.apm.testcase.resttemplate
;
import
java.io.IOException
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
import
okhttp3.Response
;
...
...
@@ -61,6 +62,14 @@ public class RestTemplateController {
//Delete user
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
;
}
...
...
test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
浏览文件 @
10ddf0c3
...
...
@@ -21,10 +21,11 @@ package test.apache.skywalking.apm.testcase.implinterface;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@RequestMapping
(
"/impl"
)
public
interface
TestCaseInterface
{
@RequestMapping
(
"/impl
/requestmapping"
)
@RequestMapping
(
path
=
"
/requestmapping"
)
String
implRequestMappingAnnotationTestCase
();
@GetMapping
(
"/
impl/
restmapping"
)
@GetMapping
(
"/restmapping"
)
String
implRestAnnotationTestCase
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录