Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gdyjdao
SkyWalking
提交
3e2e294d
S
SkyWalking
项目概览
gdyjdao
/
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,发现更多精彩内容 >>
提交
3e2e294d
编写于
9月 19, 2017
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some compile issue. (not finished.)
上级
e0d50533
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
34 addition
and
21 deletion
+34
-21
apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
...pm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
+9
-8
apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/skywalking/apm/plugin/motan/MotanConsumerInterceptor.java
...skywalking/apm/plugin/motan/MotanConsumerInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/skywalking/apm/plugin/motan/MotanProviderInterceptor.java
...skywalking/apm/plugin/motan/MotanProviderInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/skywalking/apm/plugin/okhttp/v3/RealCallInterceptor.java
.../skywalking/apm/plugin/okhttp/v3/RealCallInterceptor.java
+8
-5
apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/src/main/java/org/skywalking/apm/plugin/resin/v3/ResinV3Interceptor.java
...rg/skywalking/apm/plugin/resin/v3/ResinV3Interceptor.java
+8
-3
apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/src/main/java/org/skywalking/apm/plugin/resin/v4/ResinV4Interceptor.java
...rg/skywalking/apm/plugin/resin/v4/ResinV4Interceptor.java
+7
-3
未找到文件。
apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
浏览文件 @
3e2e294d
...
...
@@ -6,13 +6,13 @@ import java.lang.reflect.Field;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Modifier
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
org.skywalking.apm.agent.core.con
f.Config
;
import
org.skywalking.apm.agent.core.con
text.CarrierItem
;
import
org.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.skywalking.apm.agent.core.context.ContextManager
;
import
org.skywalking.apm.agent.core.context.tag.Tags
;
...
...
@@ -37,7 +37,6 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc
* port, kind, component, url from {@link feign.Request}.
* Through the reflection of the way, set the http header of context data into {@link feign.Request#headers}.
*
*
* @param method
* @param result change this result, if you want to truncate the method.
* @throws Throwable
...
...
@@ -55,9 +54,6 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc
Tags
.
URL
.
set
(
span
,
url
.
getPath
());
SpanLayer
.
asHttp
(
span
);
List
<
String
>
contextCollection
=
new
ArrayList
<
String
>();
contextCollection
.
add
(
contextCarrier
.
serialize
());
Field
headersField
=
Request
.
class
.
getDeclaredField
(
"headers"
);
Field
modifiersField
=
Field
.
class
.
getDeclaredField
(
"modifiers"
);
modifiersField
.
setAccessible
(
true
);
...
...
@@ -65,7 +61,13 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc
headersField
.
setAccessible
(
true
);
Map
<
String
,
Collection
<
String
>>
headers
=
new
LinkedHashMap
<
String
,
Collection
<
String
>>();
headers
.
put
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
,
contextCollection
);
CarrierItem
items
=
contextCarrier
.
items
();
while
(
items
.
hasNext
())
{
CarrierItem
next
=
items
.
next
();
List
<
String
>
contextCollection
=
new
LinkedList
<
String
>();
contextCollection
.
add
(
next
.
getHeadValue
());
headers
.
put
(
next
.
getHeadKey
(),
contextCollection
);
}
headers
.
putAll
(
request
.
headers
());
headersField
.
set
(
request
,
Collections
.
unmodifiableMap
(
headers
));
...
...
@@ -76,7 +78,6 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc
* the server.
* Finish the {@link AbstractSpan}.
*
*
* @param method
* @param ret the method's original return value.
* @return
...
...
apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/skywalking/apm/plugin/motan/MotanConsumerInterceptor.java
浏览文件 @
3e2e294d
...
...
@@ -43,7 +43,7 @@ public class MotanConsumerInterceptor implements InstanceConstructorInterceptor,
Tags
.
URL
.
set
(
span
,
url
.
getIdentity
());
SpanLayer
.
asRPCFramework
(
span
);
CarrierItem
items
=
contextCarrier
.
items
();
while
(
items
.
hasNext
())
{
while
(
items
.
hasNext
())
{
CarrierItem
next
=
items
.
next
();
request
.
setAttachment
(
next
.
getHeadKey
(),
next
.
getHeadValue
());
}
...
...
apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/skywalking/apm/plugin/motan/MotanProviderInterceptor.java
浏览文件 @
3e2e294d
...
...
@@ -29,7 +29,7 @@ public class MotanProviderInterceptor implements InstanceMethodsAroundIntercepto
Request
request
=
(
Request
)
allArguments
[
0
];
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
CarrierItem
items
=
contextCarrier
.
items
();
while
(
items
.
hasNext
())
{
while
(
items
.
hasNext
())
{
CarrierItem
next
=
items
.
next
();
next
.
setHeadValue
(
request
.
getAttachments
().
get
(
next
.
getHeadKey
()));
}
...
...
apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/skywalking/apm/plugin/okhttp/v3/RealCallInterceptor.java
浏览文件 @
3e2e294d
...
...
@@ -8,7 +8,7 @@ import okhttp3.HttpUrl;
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
org.skywalking.apm.agent.core.con
f.Config
;
import
org.skywalking.apm.agent.core.con
text.CarrierItem
;
import
org.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.skywalking.apm.agent.core.context.ContextManager
;
import
org.skywalking.apm.agent.core.context.tag.Tags
;
...
...
@@ -44,7 +44,6 @@ public class RealCallInterceptor implements InstanceMethodsAroundInterceptor, In
* port, kind, component, url from {@link okhttp3.Request}.
* Through the reflection of the way, set the http header of context data into {@link okhttp3.Request#headers}.
*
*
* @param method
* @param result change this result, if you want to truncate the method.
* @throws Throwable
...
...
@@ -67,8 +66,13 @@ public class RealCallInterceptor implements InstanceMethodsAroundInterceptor, In
modifiersField
.
setInt
(
headersField
,
headersField
.
getModifiers
()
&
~
Modifier
.
FINAL
);
headersField
.
setAccessible
(
true
);
Headers
headers
=
request
.
headers
().
newBuilder
().
add
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
,
contextCarrier
.
serialize
()).
build
();
headersField
.
set
(
request
,
headers
);
Headers
.
Builder
headerBuilder
=
request
.
headers
().
newBuilder
();
CarrierItem
items
=
contextCarrier
.
items
();
while
(
items
.
hasNext
())
{
CarrierItem
next
=
items
.
next
();
headerBuilder
.
add
(
next
.
getHeadKey
(),
next
.
getHeadValue
());
}
headersField
.
set
(
request
,
headerBuilder
.
build
());
}
/**
...
...
@@ -76,7 +80,6 @@ public class RealCallInterceptor implements InstanceMethodsAroundInterceptor, In
* the server.
* Finish the {@link AbstractSpan}.
*
*
* @param method
* @param ret the method's original return value.
* @return
...
...
apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/src/main/java/org/skywalking/apm/plugin/resin/v3/ResinV3Interceptor.java
浏览文件 @
3e2e294d
...
...
@@ -3,7 +3,7 @@ package org.skywalking.apm.plugin.resin.v3;
import
com.caucho.server.connection.CauchoRequest
;
import
com.caucho.server.http.HttpResponse
;
import
java.lang.reflect.Method
;
import
org.skywalking.apm.agent.core.con
f.Config
;
import
org.skywalking.apm.agent.core.con
text.CarrierItem
;
import
org.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.skywalking.apm.agent.core.context.ContextManager
;
import
org.skywalking.apm.agent.core.context.tag.Tags
;
...
...
@@ -25,8 +25,13 @@ public class ResinV3Interceptor implements InstanceMethodsAroundInterceptor {
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
CauchoRequest
request
=
(
CauchoRequest
)
allArguments
[
0
];
String
tracingHeaderValue
=
request
.
getHeader
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
);
ContextCarrier
contextCarrier
=
new
ContextCarrier
().
deserialize
(
tracingHeaderValue
);
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
CarrierItem
items
=
contextCarrier
.
items
();
while
(
items
.
hasNext
())
{
CarrierItem
next
=
items
.
next
();
next
.
setHeadValue
(
request
.
getHeader
(
next
.
getHeadKey
()));
}
AbstractSpan
span
=
ContextManager
.
createEntrySpan
(
request
.
getPageURI
(),
contextCarrier
);
span
.
setComponent
(
ComponentsDefine
.
RESIN
);
Tags
.
URL
.
set
(
span
,
appendRequestURL
(
request
));
...
...
apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/src/main/java/org/skywalking/apm/plugin/resin/v4/ResinV4Interceptor.java
浏览文件 @
3e2e294d
...
...
@@ -3,7 +3,7 @@ package org.skywalking.apm.plugin.resin.v4;
import
com.caucho.server.http.CauchoRequest
;
import
java.lang.reflect.Method
;
import
javax.servlet.http.HttpServletResponse
;
import
org.skywalking.apm.agent.core.con
f.Config
;
import
org.skywalking.apm.agent.core.con
text.CarrierItem
;
import
org.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.skywalking.apm.agent.core.context.ContextManager
;
import
org.skywalking.apm.agent.core.context.tag.Tags
;
...
...
@@ -22,8 +22,12 @@ public class ResinV4Interceptor implements InstanceMethodsAroundInterceptor {
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
CauchoRequest
request
=
(
CauchoRequest
)
allArguments
[
0
];
String
tracingHeaderValue
=
request
.
getHeader
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
);
ContextCarrier
contextCarrier
=
new
ContextCarrier
().
deserialize
(
tracingHeaderValue
);
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
CarrierItem
items
=
contextCarrier
.
items
();
while
(
items
.
hasNext
())
{
CarrierItem
next
=
items
.
next
();
next
.
setHeadValue
(
request
.
getHeader
(
next
.
getHeadKey
()));
}
AbstractSpan
span
=
ContextManager
.
createEntrySpan
(
request
.
getPageURI
(),
contextCarrier
);
span
.
setComponent
(
ComponentsDefine
.
RESIN
);
Tags
.
URL
.
set
(
span
,
appendRequestURL
(
request
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录