Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
9a901417
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,发现更多精彩内容 >>
提交
9a901417
编写于
2月 19, 2017
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor tags.
上级
fc19ce85
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
22 deletion
+26
-22
skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/tag/Tags.java
...ce/src/main/java/com/a/eye/skywalking/trace/tag/Tags.java
+25
-21
skywalking-sniffer/skywalking-sdk-plugin/jdbc-plugin/src/main/java/com/a/eye/skywalking/plugin/jdbc/PreparedStatementTracing.java
.../eye/skywalking/plugin/jdbc/PreparedStatementTracing.java
+1
-1
未找到文件。
skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/tag/Tags.java
浏览文件 @
9a901417
...
...
@@ -13,17 +13,17 @@ public final class Tags {
}
/**
*
URL records the url of the incoming request.
* URL records the url of the incoming request.
*/
public
static
final
StringTag
URL
=
new
StringTag
(
"url"
);
/**
*
STATUS_CODE records the http status code of the response.
* STATUS_CODE records the http status code of the response.
*/
public
static
final
IntTag
STATUS_CODE
=
new
IntTag
(
"status_code"
);
/**
*
SPAN_KIND hints at the relationship between spans, e.g. client/server.
* SPAN_KIND hints at the relationship between spans, e.g. client/server.
*/
public
static
final
StringTag
SPAN_KIND
=
new
StringTag
(
"span.kind"
);
...
...
@@ -38,59 +38,63 @@ public final class Tags {
public
static
final
String
SPAN_KIND_CLIENT
=
"client"
;
/**
* SPAN_LAYER represents the kind of span.
* e.g. db=database; rpc=Remote Procedure Call Framework, like motan, thift; nosql=something like redis/memcache
* SPAN_LAYER represents the kind of span.
*
* e.g.
* db=database;
* rpc=Remote Procedure Call Framework, like motan, thift;
* nosql=something like redis/memcache
*/
public
static
final
class
SPAN_LAYER
{
private
static
StringTag
SPAN_LAYER_TAG
=
new
StringTag
(
"span.layer"
);
private
static
final
String
RDB_LAYER
=
"rd
a
"
;
private
static
final
String
RDB_LAYER
=
"rd
b
"
;
private
static
final
String
RPC_FRAMEWORK_LAYER
=
"rpc"
;
private
static
final
String
NOSQL_LAYER
=
"nosql"
;
private
static
final
String
HTTP_LAYER
=
"http"
;
public
static
void
as
DBAccess
(
Span
span
)
{
public
static
void
as
RDB
(
Span
span
)
{
SPAN_LAYER_TAG
.
set
(
span
,
RDB_LAYER
);
}
public
static
void
asRPCFramework
(
Span
span
){
public
static
void
asRPCFramework
(
Span
span
)
{
SPAN_LAYER_TAG
.
set
(
span
,
RPC_FRAMEWORK_LAYER
);
}
public
static
void
asNoSQL
(
Span
span
){
public
static
void
asNoSQL
(
Span
span
)
{
SPAN_LAYER_TAG
.
set
(
span
,
NOSQL_LAYER
);
}
public
static
void
asHttp
(
Span
span
){
public
static
void
asHttp
(
Span
span
)
{
SPAN_LAYER_TAG
.
set
(
span
,
HTTP_LAYER
);
}
public
static
String
get
(
Span
span
){
public
static
String
get
(
Span
span
)
{
return
SPAN_LAYER_TAG
.
get
(
span
);
}
public
static
boolean
is
DBAccess
(
Span
span
)
{
public
static
boolean
is
RDB
(
Span
span
)
{
return
RDB_LAYER
.
equals
(
get
(
span
));
}
public
static
boolean
isRPCFramework
(
Span
span
){
public
static
boolean
isRPCFramework
(
Span
span
)
{
return
RPC_FRAMEWORK_LAYER
.
equals
(
get
(
span
));
}
public
static
boolean
isNoSQL
(
Span
span
){
public
static
boolean
isNoSQL
(
Span
span
)
{
return
NOSQL_LAYER
.
equals
(
get
(
span
));
}
public
static
boolean
isHttp
(
Span
span
){
public
static
boolean
isHttp
(
Span
span
)
{
return
HTTP_LAYER
.
equals
(
get
(
span
));
}
}
/**
*
COMPONENT is a low-cardinality identifier of the module, library, or package that is instrumented.
*
Like dubbo/dubbox/motan
* COMPONENT is a low-cardinality identifier of the module, library, or package that is instrumented.
* Like dubbo/dubbox/motan
*/
public
static
final
StringTag
COMPONENT
=
new
StringTag
(
"component"
);
public
static
final
StringTag
COMPONENT
=
new
StringTag
(
"component"
);
/**
* ERROR indicates whether a Span ended in an error state.
...
...
@@ -98,17 +102,17 @@ public final class Tags {
public
static
final
BooleanTag
ERROR
=
new
BooleanTag
(
"error"
);
/**
*
PEER_HOST records host address of the peer, maybe IPV4, IPV6 or hostname.
* PEER_HOST records host address of the peer, maybe IPV4, IPV6 or hostname.
*/
public
static
final
StringTag
PEER_HOST
=
new
StringTag
(
"peer.host"
);
/**
*
DB_URL records the url of the database access.
* DB_URL records the url of the database access.
*/
public
static
final
StringTag
DB_URL
=
new
StringTag
(
"db.url"
);
/**
*
DB_STATEMENT records the sql statement of the database access.
* DB_STATEMENT records the sql statement of the database access.
*/
public
static
final
StringTag
DB_STATEMENT
=
new
StringTag
(
"db.statement"
);
}
skywalking-sniffer/skywalking-sdk-plugin/jdbc-plugin/src/main/java/com/a/eye/skywalking/plugin/jdbc/PreparedStatementTracing.java
浏览文件 @
9a901417
...
...
@@ -17,7 +17,7 @@ public class PreparedStatementTracing {
throws
SQLException
{
Span
span
=
ContextManager
.
INSTANCE
.
createSpan
(
"JDBC/PreparedStatement/"
+
method
);
try
{
Tags
.
SPAN_LAYER
.
as
DBAccess
(
span
);
Tags
.
SPAN_LAYER
.
as
RDB
(
span
);
Tags
.
DB_URL
.
set
(
span
,
connectInfo
);
Tags
.
DB_STATEMENT
.
set
(
span
,
sql
);
return
exec
.
exe
(
realStatement
,
sql
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录