Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿信在这里
SkyWalking
提交
eea5d027
S
SkyWalking
项目概览
阿信在这里
/
SkyWalking
与 Fork 源项目一致
Fork自
山不在高_有仙则灵 / 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,发现更多精彩内容 >>
未验证
提交
eea5d027
编写于
12月 11, 2019
作者:
K
kezhenxu94
提交者:
GitHub
12月 11, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Armeria Java agent plugin (#4024)
上级
31a6407f
变更
44
隐藏空白更改
内联
并排
Showing
44 changed file
with
1961 addition
and
4 deletion
+1961
-4
.github/workflows/plugins-test.yaml
.github/workflows/plugins-test.yaml
+7
-2
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
...walking/apm/network/trace/component/ComponentsDefine.java
+2
-0
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/pom.xml
+42
-0
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ClientInterceptor.java
...lking/apm/plugin/armeria/Armeria084ClientInterceptor.java
+108
-0
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ServerInterceptor.java
...lking/apm/plugin/armeria/Armeria084ServerInterceptor.java
+89
-0
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria084ClientInstrumentation.java
...lugin/armeria/define/Armeria084ClientInstrumentation.java
+89
-0
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria084ServerInstrumentation.java
...lugin/armeria/define/Armeria084ServerInstrumentation.java
+84
-0
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/resources/skywalking-plugin.def
...ia-0.84.x-plugin/src/main/resources/skywalking-plugin.def
+18
-0
apm-sniffer/apm-sdk-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/pom.xml
+1
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/pom.xml
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/pom.xml
+45
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria085ClientInterceptor.java
...lking/apm/plugin/armeria/Armeria085ClientInterceptor.java
+70
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria085ServerInterceptor.java
...lking/apm/plugin/armeria/Armeria085ServerInterceptor.java
+89
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria086ClientInterceptor.java
...lking/apm/plugin/armeria/Armeria086ClientInterceptor.java
+70
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/ArmeriaClientInterceptor.java
...ywalking/apm/plugin/armeria/ArmeriaClientInterceptor.java
+87
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria085ClientInstrumentation.java
...lugin/armeria/define/Armeria085ClientInstrumentation.java
+88
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria085ServerInstrumentation.java
...lugin/armeria/define/Armeria085ServerInstrumentation.java
+83
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria086ClientInstrumentation.java
...lugin/armeria/define/Armeria086ClientInstrumentation.java
+89
-0
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/resources/skywalking-plugin.def
...ia-0.85.x-plugin/src/main/resources/skywalking-plugin.def
+19
-0
apm-sniffer/optional-plugins/pom.xml
apm-sniffer/optional-plugins/pom.xml
+1
-0
docs/en/setup/service-agent/java-agent/Supported-list.md
docs/en/setup/service-agent/java-agent/Supported-list.md
+1
-0
oap-server/server-bootstrap/src/main/resources/component-libraries.yml
...rver-bootstrap/src/main/resources/component-libraries.yml
+3
-0
oap-server/server-core/src/test/resources/component-libraries.yml
...er/server-core/src/test/resources/component-libraries.yml
+3
-0
test/plugin/scenarios/armeria-0.96minus-scenario/bin/startup.sh
...lugin/scenarios/armeria-0.96minus-scenario/bin/startup.sh
+21
-0
test/plugin/scenarios/armeria-0.96minus-scenario/config/expectedData.yaml
...arios/armeria-0.96minus-scenario/config/expectedData.yaml
+85
-0
test/plugin/scenarios/armeria-0.96minus-scenario/configuration.yml
...in/scenarios/armeria-0.96minus-scenario/configuration.yml
+23
-0
test/plugin/scenarios/armeria-0.96minus-scenario/pom.xml
test/plugin/scenarios/armeria-0.96minus-scenario/pom.xml
+97
-0
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/assembly/assembly.xml
...armeria-0.96minus-scenario/src/main/assembly/assembly.xml
+41
-0
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/Application.java
...g/apache/skywalking/apm/testcase/armeria/Application.java
+31
-0
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/ClientApplication.java
...he/skywalking/apm/testcase/armeria/ClientApplication.java
+44
-0
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/ServerApplication.java
...he/skywalking/apm/testcase/armeria/ServerApplication.java
+47
-0
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/resources/application.yaml
...ia-0.96minus-scenario/src/main/resources/application.yaml
+19
-0
test/plugin/scenarios/armeria-0.96minus-scenario/support-version.list
...scenarios/armeria-0.96minus-scenario/support-version.list
+36
-0
test/plugin/scenarios/armeria-0.96plus-scenario/bin/startup.sh
...plugin/scenarios/armeria-0.96plus-scenario/bin/startup.sh
+21
-0
test/plugin/scenarios/armeria-0.96plus-scenario/config/expectedData.yaml
...narios/armeria-0.96plus-scenario/config/expectedData.yaml
+85
-0
test/plugin/scenarios/armeria-0.96plus-scenario/configuration.yml
...gin/scenarios/armeria-0.96plus-scenario/configuration.yml
+23
-0
test/plugin/scenarios/armeria-0.96plus-scenario/pom.xml
test/plugin/scenarios/armeria-0.96plus-scenario/pom.xml
+98
-0
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/assembly/assembly.xml
.../armeria-0.96plus-scenario/src/main/assembly/assembly.xml
+41
-0
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/Application.java
...g/apache/skywalking/apm/testcase/armeria/Application.java
+31
-0
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/ClientApplication.java
...he/skywalking/apm/testcase/armeria/ClientApplication.java
+44
-0
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/ServerApplication.java
...he/skywalking/apm/testcase/armeria/ServerApplication.java
+47
-0
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/resources/application.yaml
...ria-0.96plus-scenario/src/main/resources/application.yaml
+19
-0
test/plugin/scenarios/armeria-0.96plus-scenario/support-version.list
.../scenarios/armeria-0.96plus-scenario/support-version.list
+18
-0
test/plugin/scenarios/dubbo-2.5.x-scenario/bin/startup.sh
test/plugin/scenarios/dubbo-2.5.x-scenario/bin/startup.sh
+1
-1
test/plugin/scenarios/dubbo-2.7.x-scenario/bin/startup.sh
test/plugin/scenarios/dubbo-2.7.x-scenario/bin/startup.sh
+1
-1
未找到文件。
.github/workflows/plugins-test.yaml
浏览文件 @
eea5d027
...
...
@@ -121,7 +121,7 @@ jobs:
-
name
:
Run gson-scenario (7)
run
:
bash test/plugin/run.sh gson-scenario
Feign_Canal
:
Feign_Canal
_Armeria
:
runs-on
:
ubuntu-18.04
timeout-minutes
:
90
strategy
:
...
...
@@ -149,8 +149,13 @@ jobs:
run
:
bash test/plugin/run.sh customize-scenario
-
name
:
Run canal 1.0.24-1.1.2 (5)
run
:
bash test/plugin/run.sh canal-scenario
-
name
:
Run
Feign_Canal_
Pulsar 2.2.0-2.4.1 (7)
-
name
:
Run Pulsar 2.2.0-2.4.1 (7)
run
:
bash test/plugin/run.sh pulsar-scenario
-
name
:
Run Armeria 0.63.0-0.95.0 (20)
run
:
bash test/plugin/run.sh armeria-0.96minus-scenario
-
name
:
Run Armeria 0.96.0-0.97.0 (2)
run
:
bash test/plugin/run.sh armeria-0.96plus-scenario
Hystrix_SofaRPC_Spring30x
:
runs-on
:
ubuntu-18.04
...
...
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
浏览文件 @
eea5d027
...
...
@@ -147,4 +147,6 @@ public class ComponentsDefine {
public
static
final
OfficialComponent
REST_HIGH_LEVEL_CLIENT
=
new
OfficialComponent
(
77
,
"rest-high-level-client"
);
public
static
final
OfficialComponent
SPRING_TX
=
new
OfficialComponent
(
78
,
"spring-tx"
);
public
static
final
OfficialComponent
ARMERIA
=
new
OfficialComponent
(
79
,
"Armeria"
);
}
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/pom.xml
0 → 100644
浏览文件 @
eea5d027
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
apm-sdk-plugin
</artifactId>
<groupId>
org.apache.skywalking
</groupId>
<version>
6.6.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apm-armeria-0.8.x-plugin
</artifactId>
<name>
armeria-0.8.x-plugin
</name>
<packaging>
jar
</packaging>
<description>
SkyWalking Agent Plugin for Armeria 0.63.0 ~ 0.84.0
</description>
<dependencies>
<dependency>
<groupId>
com.linecorp.armeria
</groupId>
<artifactId>
armeria
</artifactId>
<version>
[0.63.0, 0.84.0]
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ClientInterceptor.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria
;
import
com.linecorp.armeria.client.UserClient
;
import
com.linecorp.armeria.common.HttpHeaders
;
import
com.linecorp.armeria.common.HttpMethod
;
import
com.linecorp.armeria.common.HttpRequest
;
import
io.netty.util.AsciiString
;
import
org.apache.skywalking.apm.agent.core.context.CarrierItem
;
import
org.apache.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Method
;
import
java.net.URI
;
/**
* @author kezhenxu94
*/
@SuppressWarnings
(
"rawtypes"
)
public
class
Armeria084ClientInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
MethodInterceptResult
result
)
throws
Throwable
{
final
UserClient
userClient
=
(
UserClient
)
objInst
;
final
URI
uri
=
userClient
.
uri
();
final
HttpMethod
httpMethod
=
(
HttpMethod
)
allArguments
[
1
];
final
String
path
=
(
String
)
allArguments
[
2
];
final
Object
req
=
allArguments
[
5
];
if
(!(
req
instanceof
HttpRequest
))
{
return
;
}
final
HttpRequest
httpReq
=
(
HttpRequest
)
req
;
final
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
final
String
remotePeer
=
uri
.
getHost
()
+
":"
+
uri
.
getPort
();
final
AbstractSpan
exitSpan
=
ContextManager
.
createExitSpan
(
path
,
contextCarrier
,
remotePeer
);
exitSpan
.
setComponent
(
ComponentsDefine
.
ARMERIA
);
exitSpan
.
setLayer
(
SpanLayer
.
HTTP
);
Tags
.
HTTP
.
METHOD
.
set
(
exitSpan
,
httpMethod
.
name
());
HttpHeaders
headers
=
httpReq
.
headers
();
for
(
CarrierItem
item
=
contextCarrier
.
items
();
item
.
hasNext
();
)
{
item
=
item
.
next
();
headers
.
add
(
AsciiString
.
of
(
item
.
getHeadKey
()),
item
.
getHeadValue
());
}
}
@Override
public
Object
afterMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Object
ret
)
{
Object
req
=
allArguments
[
5
];
if
(
req
instanceof
HttpRequest
&&
ContextManager
.
isActive
())
{
ContextManager
.
stopSpan
();
}
return
ret
;
}
@Override
public
void
handleMethodException
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Throwable
t
)
{
if
(
ContextManager
.
isActive
())
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
}
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ServerInterceptor.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria
;
import
com.linecorp.armeria.common.DefaultHttpRequest
;
import
com.linecorp.armeria.common.HttpHeaders
;
import
io.netty.util.AsciiString
;
import
org.apache.skywalking.apm.agent.core.context.CarrierItem
;
import
org.apache.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Method
;
/**
* @author kezhenxu94
*/
public
class
Armeria084ServerInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
MethodInterceptResult
result
)
throws
Throwable
{
DefaultHttpRequest
httpRequest
=
(
DefaultHttpRequest
)
allArguments
[
1
];
HttpHeaders
headers
=
httpRequest
.
headers
();
ContextCarrier
carrier
=
new
ContextCarrier
();
for
(
CarrierItem
item
=
carrier
.
items
();
item
.
hasNext
();
)
{
item
=
item
.
next
();
item
.
setHeadValue
(
headers
.
get
(
AsciiString
.
of
(
item
.
getHeadKey
())));
}
AbstractSpan
entrySpan
=
ContextManager
.
createEntrySpan
(
httpRequest
.
path
(),
carrier
);
entrySpan
.
setComponent
(
ComponentsDefine
.
ARMERIA
);
entrySpan
.
setLayer
(
SpanLayer
.
HTTP
);
entrySpan
.
setPeer
(
httpRequest
.
authority
());
Tags
.
URL
.
set
(
entrySpan
,
httpRequest
.
path
());
Tags
.
HTTP
.
METHOD
.
set
(
entrySpan
,
httpRequest
.
method
().
name
());
}
@Override
public
Object
afterMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Object
ret
)
{
if
(
ContextManager
.
isActive
())
{
ContextManager
.
stopSpan
();
}
return
ret
;
}
@Override
public
void
handleMethodException
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Throwable
t
)
{
if
(
ContextManager
.
isActive
())
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
}
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria084ClientInstrumentation.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* @author kezhenxu94
*/
public
class
Armeria084ClientInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"com.linecorp.armeria.client.UserClient"
;
private
static
final
String
INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.armeria.Armeria084ClientInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"execute"
)
.
and
(
takesArguments
(
7
))
.
and
(
takesArgument
(
0
,
named
(
"io.netty.channel.EventLoop"
)))
.
and
(
takesArgument
(
1
,
named
(
"com.linecorp.armeria.common.HttpMethod"
)))
.
and
(
takesArgument
(
2
,
named
(
"java.lang.String"
)))
.
and
(
takesArgument
(
3
,
named
(
"java.lang.String"
)))
.
and
(
takesArgument
(
4
,
named
(
"java.lang.String"
)));
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPTOR_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
/**
* Witness classes that are added since 0.63.0
*
* @return witness classes
*/
@Override
protected
String
[]
witnessClasses
()
{
return
new
String
[]{
"com.linecorp.armeria.client.endpoint.dns.DnsEndpointGroup"
,
"com.linecorp.armeria.common.ImmutableHttpHeaders"
};
}
}
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria084ServerInstrumentation.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* @author kezhenxu94
*/
public
class
Armeria084ServerInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"com.linecorp.armeria.server.HttpServerHandler"
;
private
static
final
String
INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.armeria.Armeria084ServerInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"handleRequest"
)
.
and
(
takesArgument
(
0
,
named
(
"io.netty.channel.ChannelHandlerContext"
)))
.
and
(
takesArgument
(
1
,
named
(
"com.linecorp.armeria.server.DecodedHttpRequest"
)));
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPTOR_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
/**
* Witness classes that are added since 0.63.0 and removed since 0.85.0
*
* @return witness classes
*/
@Override
protected
String
[]
witnessClasses
()
{
return
new
String
[]{
"com.linecorp.armeria.client.endpoint.dns.DnsEndpointGroup"
,
"com.linecorp.armeria.common.ImmutableHttpHeaders"
};
}
}
apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/resources/skywalking-plugin.def
0 → 100644
浏览文件 @
eea5d027
# 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.
armeria-063-084=org.apache.skywalking.apm.plugin.armeria.define.Armeria084ServerInstrumentation
armeria-063-084=org.apache.skywalking.apm.plugin.armeria.define.Armeria084ClientInstrumentation
\ No newline at end of file
apm-sniffer/apm-sdk-plugin/pom.xml
浏览文件 @
eea5d027
...
...
@@ -80,6 +80,7 @@
<module>
ehcache-2.x-plugin
</module>
<module>
pulsar-plugin
</module>
<module>
netty-socketio-plugin
</module>
<module>
armeria-0.84.x-plugin
</module>
</modules>
<packaging>
pom
</packaging>
...
...
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/pom.xml
0 → 100644
浏览文件 @
eea5d027
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
optional-plugins
</artifactId>
<version>
6.6.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apm-armeria-0.85.x-plugin
</artifactId>
<name>
armeria-0.85.x-plugin
</name>
<packaging>
jar
</packaging>
<description>
SkyWalking Agent Plugin for Armeria 0.85.0 ~ 0.97.0
</description>
<properties>
<compiler.version>
1.8
</compiler.version>
</properties>
<dependencies>
<dependency>
<groupId>
com.linecorp.armeria
</groupId>
<artifactId>
armeria
</artifactId>
<version>
0.85.0
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria085ClientInterceptor.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria
;
import
com.linecorp.armeria.client.UserClient
;
import
com.linecorp.armeria.common.HttpMethod
;
import
com.linecorp.armeria.common.HttpRequest
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
java.lang.reflect.Method
;
import
java.net.URI
;
/**
* @author kezhenxu94
*/
@SuppressWarnings
(
"rawtypes"
)
public
class
Armeria085ClientInterceptor
extends
ArmeriaClientInterceptor
{
@Override
public
void
beforeMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
MethodInterceptResult
result
)
throws
Throwable
{
final
UserClient
userClient
=
(
UserClient
)
objInst
;
final
URI
uri
=
userClient
.
uri
();
final
HttpMethod
httpMethod
=
(
HttpMethod
)
allArguments
[
1
];
final
String
path
=
(
String
)
allArguments
[
2
];
final
Object
req
=
allArguments
[
5
];
if
(!(
req
instanceof
HttpRequest
))
{
return
;
}
beforeMethod
(
uri
,
httpMethod
,
path
);
}
@Override
public
Object
afterMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Object
ret
)
{
Object
req
=
allArguments
[
5
];
afterMethod
(
req
);
return
ret
;
}
}
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria085ServerInterceptor.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria
;
import
com.linecorp.armeria.common.DefaultHttpRequest
;
import
com.linecorp.armeria.common.HttpHeaders
;
import
io.netty.util.AsciiString
;
import
org.apache.skywalking.apm.agent.core.context.CarrierItem
;
import
org.apache.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Method
;
/**
* @author kezhenxu94
*/
public
class
Armeria085ServerInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
MethodInterceptResult
result
)
throws
Throwable
{
DefaultHttpRequest
httpRequest
=
(
DefaultHttpRequest
)
allArguments
[
1
];
HttpHeaders
headers
=
httpRequest
.
headers
();
ContextCarrier
carrier
=
new
ContextCarrier
();
for
(
CarrierItem
item
=
carrier
.
items
();
item
.
hasNext
();
)
{
item
=
item
.
next
();
item
.
setHeadValue
(
headers
.
get
(
AsciiString
.
of
(
item
.
getHeadKey
())));
}
AbstractSpan
entrySpan
=
ContextManager
.
createEntrySpan
(
httpRequest
.
path
(),
carrier
);
entrySpan
.
setComponent
(
ComponentsDefine
.
ARMERIA
);
entrySpan
.
setLayer
(
SpanLayer
.
HTTP
);
entrySpan
.
setPeer
(
httpRequest
.
authority
());
Tags
.
URL
.
set
(
entrySpan
,
httpRequest
.
path
());
Tags
.
HTTP
.
METHOD
.
set
(
entrySpan
,
httpRequest
.
method
().
name
());
}
@Override
public
Object
afterMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Object
ret
)
{
if
(
ContextManager
.
isActive
())
{
ContextManager
.
stopSpan
();
}
return
ret
;
}
@Override
public
void
handleMethodException
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Throwable
t
)
{
if
(
ContextManager
.
isActive
())
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
}
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria086ClientInterceptor.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria
;
import
java.lang.reflect.Method
;
import
java.net.URI
;
import
com.linecorp.armeria.client.UserClient
;
import
com.linecorp.armeria.common.HttpMethod
;
import
com.linecorp.armeria.common.HttpRequest
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
/**
* @author kezhenxu94
*/
@SuppressWarnings
(
"rawtypes"
)
public
class
Armeria086ClientInterceptor
extends
ArmeriaClientInterceptor
{
@Override
public
void
beforeMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
MethodInterceptResult
result
)
throws
Throwable
{
final
UserClient
userClient
=
(
UserClient
)
objInst
;
final
URI
uri
=
userClient
.
uri
();
final
HttpMethod
httpMethod
=
(
HttpMethod
)
allArguments
[
2
];
final
String
path
=
(
String
)
allArguments
[
3
];
final
Object
req
=
allArguments
[
6
];
if
(!(
req
instanceof
HttpRequest
))
{
return
;
}
beforeMethod
(
uri
,
httpMethod
,
path
);
}
@Override
public
Object
afterMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Object
ret
)
{
Object
req
=
allArguments
[
6
];
afterMethod
(
req
);
return
ret
;
}
}
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/ArmeriaClientInterceptor.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria
;
import
java.lang.reflect.Method
;
import
java.net.URI
;
import
com.linecorp.armeria.client.Clients
;
import
com.linecorp.armeria.common.HttpHeadersBuilder
;
import
com.linecorp.armeria.common.HttpMethod
;
import
com.linecorp.armeria.common.HttpRequest
;
import
com.linecorp.armeria.common.util.SafeCloseable
;
import
io.netty.util.AsciiString
;
import
org.apache.skywalking.apm.agent.core.context.CarrierItem
;
import
org.apache.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
/**
* @author kezhenxu94
*/
public
abstract
class
ArmeriaClientInterceptor
implements
InstanceMethodsAroundInterceptor
{
private
static
final
String
KEY_SAFE_CLOSEABLE
=
"SAFE_CLOSEABLE"
;
protected
void
beforeMethod
(
final
URI
uri
,
final
HttpMethod
httpMethod
,
final
String
path
)
{
final
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
final
String
remotePeer
=
uri
.
getHost
()
+
":"
+
uri
.
getPort
();
final
AbstractSpan
exitSpan
=
ContextManager
.
createExitSpan
(
path
,
contextCarrier
,
remotePeer
);
exitSpan
.
setComponent
(
ComponentsDefine
.
ARMERIA
);
exitSpan
.
setLayer
(
SpanLayer
.
HTTP
);
Tags
.
HTTP
.
METHOD
.
set
(
exitSpan
,
httpMethod
.
name
());
ContextManager
.
getRuntimeContext
().
put
(
KEY_SAFE_CLOSEABLE
,
Clients
.
withHttpHeaders
(
headers
->
{
HttpHeadersBuilder
builder
=
headers
.
toBuilder
();
for
(
CarrierItem
item
=
contextCarrier
.
items
();
item
.
hasNext
();
)
{
item
=
item
.
next
();
builder
.
add
(
AsciiString
.
of
(
item
.
getHeadKey
()),
item
.
getHeadValue
());
}
return
builder
.
build
();
}));
}
protected
void
afterMethod
(
final
Object
req
)
{
if
(
req
instanceof
HttpRequest
&&
ContextManager
.
isActive
())
{
ContextManager
.
stopSpan
();
}
SafeCloseable
safeCloseable
=
ContextManager
.
getRuntimeContext
().
get
(
KEY_SAFE_CLOSEABLE
,
SafeCloseable
.
class
);
if
(
safeCloseable
!=
null
)
{
safeCloseable
.
close
();
}
}
@Override
public
void
handleMethodException
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Throwable
t
)
{
if
(
ContextManager
.
isActive
())
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
}
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria085ClientInstrumentation.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* @author kezhenxu94
*/
public
class
Armeria085ClientInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"com.linecorp.armeria.client.UserClient"
;
private
static
final
String
INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.armeria.Armeria085ClientInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"execute"
)
.
and
(
takesArguments
(
7
))
.
and
(
takesArgument
(
0
,
named
(
"io.netty.channel.EventLoop"
)))
.
and
(
takesArgument
(
1
,
named
(
"com.linecorp.armeria.common.HttpMethod"
)))
.
and
(
takesArgument
(
2
,
named
(
"java.lang.String"
)))
.
and
(
takesArgument
(
3
,
named
(
"java.lang.String"
)))
.
and
(
takesArgument
(
4
,
named
(
"java.lang.String"
)));
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPTOR_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
/**
* Witness classes that are added since 0.63.0
*
* @return witness classes
*/
@Override
protected
String
[]
witnessClasses
()
{
return
new
String
[]{
"com.linecorp.armeria.common.AbstractHttpHeadersBuilder"
};
}
}
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria085ServerInstrumentation.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* @author kezhenxu94
*/
public
class
Armeria085ServerInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"com.linecorp.armeria.server.HttpServerHandler"
;
private
static
final
String
INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.armeria.Armeria085ServerInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"handleRequest"
)
.
and
(
takesArgument
(
0
,
named
(
"io.netty.channel.ChannelHandlerContext"
)))
.
and
(
takesArgument
(
1
,
named
(
"com.linecorp.armeria.server.DecodedHttpRequest"
)));
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPTOR_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
/**
* Witness classes that are added since 0.63.0 and removed since 0.85.0
*
* @return witness classes
*/
@Override
protected
String
[]
witnessClasses
()
{
return
new
String
[]{
"com.linecorp.armeria.common.AbstractHttpHeadersBuilder"
};
}
}
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/define/Armeria086ClientInstrumentation.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.plugin.armeria.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* @author kezhenxu94
*/
public
class
Armeria086ClientInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"com.linecorp.armeria.client.UserClient"
;
private
static
final
String
INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.armeria.Armeria086ClientInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"execute"
)
.
and
(
takesArguments
(
8
))
.
and
(
takesArgument
(
0
,
named
(
"io.netty.channel.EventLoop"
)))
.
and
(
takesArgument
(
1
,
named
(
"com.linecorp.armeria.client.Endpoint"
)))
.
and
(
takesArgument
(
2
,
named
(
"com.linecorp.armeria.common.HttpMethod"
)))
.
and
(
takesArgument
(
3
,
named
(
"java.lang.String"
)))
.
and
(
takesArgument
(
4
,
named
(
"java.lang.String"
)))
.
and
(
takesArgument
(
5
,
named
(
"java.lang.String"
)));
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPTOR_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
/**
* Witness classes that are added since 0.63.0
*
* @return witness classes
*/
@Override
protected
String
[]
witnessClasses
()
{
return
new
String
[]{
"com.linecorp.armeria.common.AbstractHttpHeadersBuilder"
};
}
}
apm-sniffer/optional-plugins/armeria-0.85.x-plugin/src/main/resources/skywalking-plugin.def
0 → 100644
浏览文件 @
eea5d027
# 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.
armeria-085=org.apache.skywalking.apm.plugin.armeria.define.Armeria085ServerInstrumentation
armeria-085=org.apache.skywalking.apm.plugin.armeria.define.Armeria085ClientInstrumentation
armeria-086=org.apache.skywalking.apm.plugin.armeria.define.Armeria086ClientInstrumentation
\ No newline at end of file
apm-sniffer/optional-plugins/pom.xml
浏览文件 @
eea5d027
...
...
@@ -48,6 +48,7 @@
<module>
zookeeper-3.4.x-plugin
</module>
<module>
customize-enhance-plugin
</module>
<module>
play-2.x-plugin
</module>
<module>
armeria-0.85.x-plugin
</module>
</modules>
<dependencies>
...
...
docs/en/setup/service-agent/java-agent/Supported-list.md
浏览文件 @
eea5d027
...
...
@@ -40,6 +40,7 @@
*
[
gRPC
](
https://github.com/grpc/grpc-java
)
1.x
*
[
Apache ServiceComb Java Chassis
](
https://github.com/apache/servicecomb-java-chassis
)
0.1 -> 0.5,1.0.x
*
[
SOFARPC
](
https://github.com/alipay/sofa-rpc
)
5.4.0
*
[
Armeria
](
https://github.com/line/armeria
)
0.63.0 -> 0.97.0
*
MQ
*
[
RocketMQ
](
https://github.com/apache/rocketmq
)
4.x
*
[
Kafka
](
http://kafka.apache.org
)
0.11.0.0 -> 1.0
...
...
oap-server/server-bootstrap/src/main/resources/component-libraries.yml
浏览文件 @
eea5d027
...
...
@@ -263,6 +263,9 @@ rest-high-level-client:
spring-tx
:
id
:
78
languages
:
Java
Armeria
:
id
:
79
languages
:
Java
# .NET/.NET Core components
# [3000, 4000) for C#/.NET only
...
...
oap-server/server-core/src/test/resources/component-libraries.yml
浏览文件 @
eea5d027
...
...
@@ -236,6 +236,9 @@ rest-high-level-client:
spring-tx
:
id
:
78
languages
:
Java
Armeria
:
id
:
79
languages
:
Java
# .NET/.NET Core components
# [3000, 4000) for C#/.NET only
...
...
test/plugin/scenarios/armeria-0.96minus-scenario/bin/startup.sh
0 → 100644
浏览文件 @
eea5d027
#!/bin/bash
#
# 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.
home
=
"
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
"
java
-jar
${
agent_opts
}
${
home
}
/../libs/armeria-0.96minus-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/armeria-0.96minus-scenario/config/expectedData.yaml
0 → 100644
浏览文件 @
eea5d027
# 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.
registryItems
:
applications
:
-
{
'
armeria-0.96minus-scenario'
:
2
}
instances
:
-
{
'
armeria-0.96minus-scenario'
:
1
}
operationNames
:
-
'
armeria-0.96minus-scenario'
:
[
/greet/skywalking
]
heartbeat
:
[]
segmentItems
:
-
applicationCode
:
armeria-0.96minus-scenario
segmentSize
:
ge
2
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
/greet/skywalking
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
79
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
127.0.0.1:8085
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
/greet/skywalking
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
/greet/skywalking
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
127.0.0.1:8085'
,
entryEndpoint
:
/greet/skywalking
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/greet/skywalking
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
79
componentName
:
'
'
isError
:
false
spanType
:
Exit
peer
:
127.0.0.1:8085
peerId
:
0
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
/greet/skywalking
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
1
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/greet/skywalking'
}
-
{
key
:
http.method
,
value
:
GET
}
\ No newline at end of file
test/plugin/scenarios/armeria-0.96minus-scenario/configuration.yml
0 → 100644
浏览文件 @
eea5d027
# 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.
type
:
jvm
entryService
:
http://localhost:8080/greet/skywalking
healthCheck
:
http://localhost:8080/healthCheck
runningMode
:
with_optional
withPlugins
:
apm-armeria*.jar
startScript
:
./bin/startup.sh
framework
:
Armeria
test/plugin/scenarios/armeria-0.96minus-scenario/pom.xml
0 → 100644
浏览文件 @
eea5d027
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
armeria-0.8.x-scenario
</artifactId>
<version>
5.0.0
</version>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<spring.boot.version>
2.1.6.RELEASE
</spring.boot.version>
<test.framework>
armeria
</test.framework>
<test.framework.version>
0.90.0
</test.framework.version>
</properties>
<name>
skywalking-armeria-scenario
</name>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<version>
${spring.boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.linecorp.armeria
</groupId>
<artifactId>
armeria
</artifactId>
<version>
${test.framework.version}
</version>
</dependency>
</dependencies>
<build>
<finalName>
armeria-0.96minus-scenario
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
${spring.boot.version}
</version>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.1
</version>
<configuration>
<source>
${compiler.version}
</source>
<target>
${compiler.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<executions>
<execution>
<id>
assemble
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly.xml
</descriptor>
</descriptors>
<outputDirectory>
./target/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/assembly/assembly.xml
0 → 100644
浏览文件 @
eea5d027
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"
>
<formats>
<format>
zip
</format>
</formats>
<fileSets>
<fileSet>
<directory>
./bin
</directory>
<fileMode>
0775
</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>
./target/armeria-0.96minus-scenario.jar
</source>
<outputDirectory>
./libs
</outputDirectory>
<fileMode>
0775
</fileMode>
</file>
</files>
</assembly>
\ No newline at end of file
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/Application.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.testcase.armeria
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
/**
* @author kezhenxu94
*/
@SpringBootApplication
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
Application
.
class
,
args
);
}
}
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/ClientApplication.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.testcase.armeria
;
import
java.nio.charset.StandardCharsets
;
import
com.linecorp.armeria.client.HttpClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author kezhenxu94
*/
@RestController
public
class
ClientApplication
{
private
HttpClient
httpClient
=
HttpClient
.
of
(
"http://127.0.0.1:8085/"
);
@GetMapping
(
"/healthCheck"
)
public
String
healthCheck
()
{
return
httpClient
.
get
(
"/healthCheck"
).
aggregate
().
join
().
content
().
toString
(
StandardCharsets
.
UTF_8
);
}
@GetMapping
(
"/greet/{username}"
)
public
String
greet
(
@PathVariable
String
username
)
{
return
httpClient
.
get
(
"/greet/"
+
username
).
aggregate
().
join
().
content
().
toString
(
StandardCharsets
.
UTF_8
);
}
}
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/ServerApplication.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.testcase.armeria
;
import
javax.annotation.PostConstruct
;
import
java.util.concurrent.CompletableFuture
;
import
com.linecorp.armeria.common.HttpResponse
;
import
com.linecorp.armeria.server.Server
;
import
com.linecorp.armeria.server.ServerBuilder
;
import
org.springframework.stereotype.Component
;
/**
* @author kezhenxu94
*/
@Component
public
class
ServerApplication
{
private
static
final
String
SUCCESS
=
"Success"
;
@PostConstruct
public
void
init
()
{
ServerBuilder
sb
=
new
ServerBuilder
()
.
http
(
8085
)
.
service
(
"/healthCheck"
,
(
ctx
,
res
)
->
HttpResponse
.
of
(
SUCCESS
))
.
service
(
"/greet/{name}"
,
(
ctx
,
res
)
->
HttpResponse
.
of
(
"Hello %s~"
,
ctx
.
pathParam
(
"name"
)));
Server
server
=
sb
.
build
();
CompletableFuture
<
Void
>
future
=
server
.
start
();
future
.
join
();
}
}
test/plugin/scenarios/armeria-0.96minus-scenario/src/main/resources/application.yaml
0 → 100644
浏览文件 @
eea5d027
# 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.
server
:
port
:
8080
test/plugin/scenarios/armeria-0.96minus-scenario/support-version.list
0 → 100644
浏览文件 @
eea5d027
# 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.
0.95.0
0.94.0
0.93.0
0.91.0
0.90.3
0.90.2
0.90.1
0.90.0
0.89.1
0.89.0
0.88.0
0.87.0
0.86.0
0.85.0
0.84.0
0.80.0
0.79.0
0.70.0
0.69.0
0.63.0
test/plugin/scenarios/armeria-0.96plus-scenario/bin/startup.sh
0 → 100644
浏览文件 @
eea5d027
#!/bin/bash
#
# 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.
home
=
"
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
"
java
-jar
${
agent_opts
}
${
home
}
/../libs/armeria-0.96plus-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/armeria-0.96plus-scenario/config/expectedData.yaml
0 → 100644
浏览文件 @
eea5d027
# 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.
registryItems
:
applications
:
-
{
'
armeria-0.96plus-scenario'
:
2
}
instances
:
-
{
'
armeria-0.96plus-scenario'
:
1
}
operationNames
:
-
'
armeria-0.96plus-scenario'
:
[
/greet/skywalking
]
heartbeat
:
[]
segmentItems
:
-
applicationCode
:
armeria-0.96plus-scenario
segmentSize
:
ge
2
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
/greet/skywalking
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
79
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
127.0.0.1:8085
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
/greet/skywalking
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
/greet/skywalking
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
127.0.0.1:8085'
,
entryEndpoint
:
/greet/skywalking
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/greet/skywalking
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
79
componentName
:
'
'
isError
:
false
spanType
:
Exit
peer
:
127.0.0.1:8085
peerId
:
0
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
/greet/skywalking
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
1
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/greet/skywalking'
}
-
{
key
:
http.method
,
value
:
GET
}
\ No newline at end of file
test/plugin/scenarios/armeria-0.96plus-scenario/configuration.yml
0 → 100644
浏览文件 @
eea5d027
# 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.
type
:
jvm
entryService
:
http://localhost:8080/greet/skywalking
healthCheck
:
http://localhost:8080/healthCheck
runningMode
:
with_optional
withPlugins
:
apm-armeria*.jar
startScript
:
./bin/startup.sh
framework
:
Armeria
test/plugin/scenarios/armeria-0.96plus-scenario/pom.xml
0 → 100644
浏览文件 @
eea5d027
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
armeria-0.96.x-scenario
</artifactId>
<version>
5.0.0
</version>
<description>
Armeria test scenarios 0.96.0+
</description>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<spring.boot.version>
2.1.6.RELEASE
</spring.boot.version>
<test.framework>
armeria
</test.framework>
<test.framework.version>
0.96.0
</test.framework.version>
</properties>
<name>
skywalking-armeria-scenario
</name>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<version>
${spring.boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.linecorp.armeria
</groupId>
<artifactId>
armeria
</artifactId>
<version>
${test.framework.version}
</version>
</dependency>
</dependencies>
<build>
<finalName>
armeria-0.96plus-scenario
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
${spring.boot.version}
</version>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.1
</version>
<configuration>
<source>
${compiler.version}
</source>
<target>
${compiler.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<executions>
<execution>
<id>
assemble
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly.xml
</descriptor>
</descriptors>
<outputDirectory>
./target/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/assembly/assembly.xml
0 → 100644
浏览文件 @
eea5d027
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"
>
<formats>
<format>
zip
</format>
</formats>
<fileSets>
<fileSet>
<directory>
./bin
</directory>
<fileMode>
0775
</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>
./target/armeria-0.96plus-scenario.jar
</source>
<outputDirectory>
./libs
</outputDirectory>
<fileMode>
0775
</fileMode>
</file>
</files>
</assembly>
\ No newline at end of file
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/Application.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.testcase.armeria
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
/**
* @author kezhenxu94
*/
@SpringBootApplication
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
Application
.
class
,
args
);
}
}
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/ClientApplication.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.testcase.armeria
;
import
java.nio.charset.StandardCharsets
;
import
com.linecorp.armeria.client.WebClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author kezhenxu94
*/
@RestController
public
class
ClientApplication
{
private
WebClient
httpClient
=
WebClient
.
of
(
"http://127.0.0.1:8085/"
);
@GetMapping
(
"/healthCheck"
)
public
String
healthCheck
()
{
return
httpClient
.
get
(
"/healthCheck"
).
aggregate
().
join
().
content
().
toString
(
StandardCharsets
.
UTF_8
);
}
@GetMapping
(
"/greet/{username}"
)
public
String
greet
(
@PathVariable
String
username
)
{
return
httpClient
.
get
(
"/greet/"
+
username
).
aggregate
().
join
().
content
().
toString
(
StandardCharsets
.
UTF_8
);
}
}
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/armeria/ServerApplication.java
0 → 100644
浏览文件 @
eea5d027
/*
* 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
org.apache.skywalking.apm.testcase.armeria
;
import
javax.annotation.PostConstruct
;
import
java.util.concurrent.CompletableFuture
;
import
com.linecorp.armeria.common.HttpResponse
;
import
com.linecorp.armeria.server.Server
;
import
com.linecorp.armeria.server.ServerBuilder
;
import
org.springframework.stereotype.Component
;
/**
* @author kezhenxu94
*/
@Component
public
class
ServerApplication
{
private
static
final
String
SUCCESS
=
"Success"
;
@PostConstruct
public
void
init
()
{
ServerBuilder
sb
=
new
ServerBuilder
()
.
http
(
8085
)
.
service
(
"/healthCheck"
,
(
ctx
,
res
)
->
HttpResponse
.
of
(
SUCCESS
))
.
service
(
"/greet/{name}"
,
(
ctx
,
res
)
->
HttpResponse
.
of
(
"Hello %s~"
,
ctx
.
pathParam
(
"name"
)));
Server
server
=
sb
.
build
();
CompletableFuture
<
Void
>
future
=
server
.
start
();
future
.
join
();
}
}
test/plugin/scenarios/armeria-0.96plus-scenario/src/main/resources/application.yaml
0 → 100644
浏览文件 @
eea5d027
# 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.
server
:
port
:
8080
test/plugin/scenarios/armeria-0.96plus-scenario/support-version.list
0 → 100644
浏览文件 @
eea5d027
# 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.
0.97.0
0.96.0
test/plugin/scenarios/dubbo-2.5.x-scenario/bin/startup.sh
浏览文件 @
eea5d027
...
...
@@ -18,4 +18,4 @@
home
=
"
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
"
java
-jar
${
agent_opts
}
"-Dskywalking.agent.service_name=dubbo-2.5.x-scenario"
${
home
}
/../libs/dubbo-2.5.x-scenario.jar &
\ No newline at end of file
java
-jar
${
agent_opts
}
${
home
}
/../libs/dubbo-2.5.x-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/dubbo-2.7.x-scenario/bin/startup.sh
浏览文件 @
eea5d027
...
...
@@ -18,4 +18,4 @@
home
=
"
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
"
java
-jar
${
agent_opts
}
"-Dskywalking.agent.service_name=dubbo-2.7.x-scenario"
${
home
}
/../libs/dubbo-2.7.x-scenario.jar &
\ No newline at end of file
java
-jar
${
agent_opts
}
${
home
}
/../libs/dubbo-2.7.x-scenario.jar &
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录