Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
8611124b
S
SkyWalking
项目概览
润土的好友猹
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
9
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,发现更多精彩内容 >>
提交
8611124b
编写于
8月 10, 2019
作者:
于
于玉桔
提交者:
wu-sheng
8月 10, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Unified http status code usage (#3239)
* Unified http status code usage * fmt
上级
73cf05c5
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
7 addition
and
6 deletion
+7
-6
apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
...pm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/HttpAsyncResponseConsumerWrapper.java
...ncclient/v4/wrapper/HttpAsyncResponseConsumerWrapper.java
+2
-2
apm-sniffer/apm-sdk-plugin/spring-plugins/webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/StatusInterceptor.java
...lking/apm/plugin/spring/webflux/v5/StatusInterceptor.java
+3
-2
apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v2/HttpClientOperationsStatusInterceptor.java
...oud/gateway/v2/HttpClientOperationsStatusInterceptor.java
+1
-1
未找到文件。
apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
浏览文件 @
8611124b
...
...
@@ -114,7 +114,7 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc
AbstractSpan
span
=
ContextManager
.
activeSpan
();
if
(
statusCode
>=
400
)
{
span
.
errorOccurred
();
Tags
.
STATUS_CODE
.
set
(
span
,
statusCode
+
""
);
Tags
.
STATUS_CODE
.
set
(
span
,
Integer
.
toString
(
statusCode
)
);
}
}
...
...
apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/HttpAsyncResponseConsumerWrapper.java
浏览文件 @
8611124b
...
...
@@ -49,8 +49,8 @@ public class HttpAsyncResponseConsumerWrapper<T> implements HttpAsyncResponseCon
public
void
responseReceived
(
HttpResponse
response
)
throws
IOException
,
HttpException
{
if
(
ContextManager
.
isActive
())
{
int
statusCode
=
response
.
getStatusLine
().
getStatusCode
();
if
(
statusCode
>
400
)
{
AbstractSpan
span
=
ContextManager
.
activeSpan
();
if
(
statusCode
>
=
400
)
{
AbstractSpan
span
=
ContextManager
.
activeSpan
()
.
errorOccurred
()
;
Tags
.
STATUS_CODE
.
set
(
span
,
String
.
valueOf
(
statusCode
));
}
ContextManager
.
stopSpan
();
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/StatusInterceptor.java
浏览文件 @
8611124b
...
...
@@ -18,19 +18,20 @@
package
org.apache.skywalking.apm.plugin.spring.webflux.v5
;
import
io.netty.handler.codec.http.HttpResponseStatus
;
import
java.lang.reflect.Method
;
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.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
java.lang.reflect.Method
;
public
class
StatusInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
HttpResponseStatus
status
=
(
HttpResponseStatus
)
allArguments
[
0
];
if
(
status
.
code
()
>
400
)
{
if
(
status
.
code
()
>
=
400
)
{
ContextManager
.
activeSpan
().
errorOccurred
();
Tags
.
STATUS_CODE
.
set
(
ContextManager
.
activeSpan
(),
String
.
valueOf
(
status
.
code
()));
}
...
...
apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v2/HttpClientOperationsStatusInterceptor.java
浏览文件 @
8611124b
...
...
@@ -42,7 +42,7 @@ public class HttpClientOperationsStatusInterceptor implements InstanceMethodsAro
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
HttpResponseStatus
response
=
(
HttpResponseStatus
)
ret
;
if
(
response
.
code
()
>
400
)
{
if
(
response
.
code
()
>
=
400
)
{
ContextManager
.
activeSpan
().
errorOccurred
();
Tags
.
STATUS_CODE
.
set
(
ContextManager
.
activeSpan
(),
String
.
valueOf
(
response
.
code
()));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录