Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
fd5cb5e0
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
fd5cb5e0
编写于
6月 14, 2017
作者:
wu-sheng
提交者:
GitHub
6月 14, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into feature/208-collectorside
上级
4dfe4e55
73f9153d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
30 deletion
+60
-30
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE
+3
-0
README.md
README.md
+0
-2
apm-commons/apm-trace/src/main/java/org/skywalking/apm/trace/Span.java
...pm-trace/src/main/java/org/skywalking/apm/trace/Span.java
+1
-28
apm-commons/apm-trace/src/main/java/org/skywalking/apm/trace/util/ThrowableTransformer.java
...a/org/skywalking/apm/trace/util/ThrowableTransformer.java
+56
-0
未找到文件。
.github/ISSUE_TEMPLATE
浏览文件 @
fd5cb5e0
...
...
@@ -9,5 +9,8 @@ Please answer these questions before submitting your issue.
### What version of your JRE?
### What company or project?
### What did you do?
If possible, provide a way for reproducing the error. e.g. demo application, component version.
README.md
浏览文件 @
fd5cb5e0
...
...
@@ -55,5 +55,3 @@ _In chronological order_
*
[
WIKI
](
https://github.com/wu-sheng/sky-walking/wiki
)
_Chat with us on gitter, in English. As a Chinese Developer, you can join QQ Group: 392443393, by **tagging** Sky-Walking._
_sky-walking 1.x and 2.x provide features about tracing only, did not include any analysis abilities._
apm-commons/apm-trace/src/main/java/org/skywalking/apm/trace/Span.java
浏览文件 @
fd5cb5e0
...
...
@@ -3,9 +3,8 @@ package org.skywalking.apm.trace;
import
com.google.gson.annotations.Expose
;
import
com.google.gson.annotations.SerializedName
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.*
;
import
org.skywalking.apm.trace.util.ThrowableTransformer
;
/**
* Span is a concept from OpenTracing Spec, also from Google Dapper Paper.
...
...
@@ -290,32 +289,6 @@ public class Span {
return
log
(
exceptionFields
);
}
private
enum
ThrowableTransformer
{
INSTANCE
;
private
String
convert2String
(
Throwable
e
,
int
maxLength
)
{
ByteArrayOutputStream
buf
=
null
;
StringBuilder
expMessage
=
new
StringBuilder
();
try
{
buf
=
new
ByteArrayOutputStream
();
Throwable
causeException
=
e
;
while
(
expMessage
.
length
()
<
maxLength
&&
causeException
!=
null
)
{
causeException
.
printStackTrace
(
new
java
.
io
.
PrintWriter
(
buf
,
true
));
expMessage
.
append
(
buf
.
toString
());
causeException
=
causeException
.
getCause
();
}
}
finally
{
try
{
buf
.
close
();
}
catch
(
IOException
ioe
)
{
}
}
return
(
maxLength
>
expMessage
.
length
()
?
expMessage
:
expMessage
.
substring
(
0
,
maxLength
)).
toString
();
}
}
/**
* This method is from opentracing-java. {@see https://github.com/opentracing/opentracing-java/blob/release-0.20.9/opentracing-api/src/main/java/io/opentracing/Span.java#L120}
* <p>
...
...
apm-commons/apm-trace/src/main/java/org/skywalking/apm/trace/util/ThrowableTransformer.java
0 → 100644
浏览文件 @
fd5cb5e0
package
org.skywalking.apm.trace.util
;
/**
* {@link ThrowableTransformer} is responsible for transferring stack trace of throwable.
*/
public
enum
ThrowableTransformer
{
INSTANCE
;
private
static
final
String
LINE_SEPARATOR
=
System
.
getProperty
(
"line.separator"
);
public
String
convert2String
(
Throwable
throwable
,
final
int
maxLength
)
{
final
StringBuilder
stackMessage
=
new
StringBuilder
();
Throwable
causeException
=
throwable
;
while
(
causeException
!=
null
)
{
stackMessage
.
append
(
printExceptionInfo
(
causeException
));
boolean
overMaxLength
=
printStackElement
(
throwable
.
getStackTrace
(),
new
AppendListener
()
{
public
void
append
(
String
value
)
{
stackMessage
.
append
(
value
);
}
public
boolean
overMaxLength
()
{
return
stackMessage
.
length
()
>
maxLength
;
}
});
if
(
overMaxLength
)
{
break
;
}
causeException
=
throwable
.
getCause
();
}
return
stackMessage
.
toString
();
}
private
String
printExceptionInfo
(
Throwable
causeException
)
{
return
causeException
.
toString
()
+
LINE_SEPARATOR
;
}
private
boolean
printStackElement
(
StackTraceElement
[]
stackTrace
,
AppendListener
printListener
)
{
for
(
StackTraceElement
traceElement
:
stackTrace
)
{
printListener
.
append
(
"at "
+
traceElement
+
LINE_SEPARATOR
);
if
(
printListener
.
overMaxLength
())
{
return
true
;
}
}
return
false
;
}
private
interface
AppendListener
{
void
append
(
String
value
);
boolean
overMaxLength
();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录