Add severl types of span.

This commit is contained in:
wusheng 2017-02-19 07:39:58 +08:00
parent 51a60cd67f
commit a31ff52b3e
1 changed files with 15 additions and 3 deletions

View File

@ -24,7 +24,7 @@ public final class Tags {
/**
* SPAN_KIND represents the kind of span.
* e.g. db=database,
* e.g. db=database, rpc=Remote Procedure Call, nosql=something like redis/memcache
*/
public static final class SPAN_KIND{
private static StringTag SPAN_KIND_TAG = new StringTag("span.kind");
@ -32,6 +32,18 @@ public final class Tags {
public static void asDBAccess(Span span){
SPAN_KIND_TAG.set(span, "db");
}
public static void asRPC(Span span){
SPAN_KIND_TAG.set(span, "rpc");
}
public static void asNoSQL(Span span){
SPAN_KIND_TAG.set(span, "nosql");
}
public static void asHttp(Span span){
SPAN_KIND_TAG.set(span, "http");
}
}
/**
@ -56,7 +68,7 @@ public final class Tags {
public static final StringTag DB_URL = new StringTag("db.url");
/**
* DB_SQL records the sql of the database access.
* DB_SQL records the sql statement of the database access.
*/
public static final StringTag DB_SQL = new StringTag("db.sql");
public static final StringTag DB_SQL = new StringTag("db.statement");
}