Merge branch 'feature/3.0' into feature/collector
* feature/3.0: Add mock-module test cases. fix compile issues Add Tomcat span, and singleTrace mock. Give a sample code of the first Mock trace. Add skywalking-sniffer-mock module. For testing sdk-plugin and collector(not merged yet) modules. Big refactor. Rename the api-module root package name . remove blank line. Refactor tags. Take Adrian Cole ’s advice, remove http prefix of tag. Maybe still need some improvements. Refactor code. add delegate method
This commit is contained in:
commit
be18fe2251
|
|
@ -1,8 +1,8 @@
|
|||
package com.a.eye.skywalking.health.report;
|
||||
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.logging.api;
|
||||
package com.a.eye.skywalking.api.logging.api;
|
||||
|
||||
/**
|
||||
* The Log interface.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.logging.api;
|
||||
package com.a.eye.skywalking.api.logging.api;
|
||||
|
||||
/**
|
||||
* LogManager is the {@link LogResolver} implementation manager.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.logging.api;
|
||||
package com.a.eye.skywalking.api.logging.api;
|
||||
|
||||
/**
|
||||
* {@link LogResolver} just do only one thing: return the {@link ILog} implementation.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.logging.api;
|
||||
package com.a.eye.skywalking.api.logging.api;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.logging.impl.log4j2;
|
||||
package com.a.eye.skywalking.api.logging.impl.log4j2;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.logging.impl.log4j2;
|
||||
package com.a.eye.skywalking.api.logging.impl.log4j2;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogResolver;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogResolver;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
/**
|
||||
|
|
@ -13,69 +13,88 @@ public final class Tags {
|
|||
}
|
||||
|
||||
/**
|
||||
* HTTP_URL records the url of the incoming request.
|
||||
* URL records the url of the incoming request.
|
||||
*/
|
||||
public static final StringTag HTTP_URL = new StringTag("http.url");
|
||||
public static final StringTag URL = new StringTag("url");
|
||||
|
||||
/**
|
||||
* HTTP_STATUS records the http status code of the response.
|
||||
* STATUS_CODE records the http status code of the response.
|
||||
*/
|
||||
public static final IntTag HTTP_STATUS = new IntTag("http.status_code");
|
||||
public static final IntTag STATUS_CODE = new IntTag("status_code");
|
||||
|
||||
/**
|
||||
* SPAN_KIND represents the kind of span.
|
||||
* e.g. db=database, rpc=Remote Procedure Call, nosql=something like redis/memcache
|
||||
* SPAN_KIND hints at the relationship between spans, e.g. client/server.
|
||||
*/
|
||||
public static final class SPAN_KIND{
|
||||
private static StringTag SPAN_KIND_TAG = new StringTag("span.kind");
|
||||
public static final StringTag SPAN_KIND = new StringTag("span.kind");
|
||||
|
||||
private static final String DB_KIND = "db";
|
||||
private static final String RPC_KIND = "rpc";
|
||||
private static final String NOSQL_KIND = "nosql";
|
||||
private static final String HTTP_KIND = "http";
|
||||
/**
|
||||
* A constant for setting the span kind to indicate that it represents a server span.
|
||||
*/
|
||||
public static final String SPAN_KIND_SERVER = "server";
|
||||
|
||||
public static void asDBAccess(Span span){
|
||||
SPAN_KIND_TAG.set(span, DB_KIND);
|
||||
/**
|
||||
* A constant for setting the span kind to indicate that it represents a client span.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public static final class SPAN_LAYER {
|
||||
private static StringTag SPAN_LAYER_TAG = new StringTag("span.layer");
|
||||
|
||||
private static final String RDB_LAYER = "rdb";
|
||||
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 asRDB(Span span) {
|
||||
SPAN_LAYER_TAG.set(span, RDB_LAYER);
|
||||
}
|
||||
|
||||
public static void asRPC(Span span){
|
||||
SPAN_KIND_TAG.set(span, RPC_KIND);
|
||||
public static void asRPCFramework(Span span) {
|
||||
SPAN_LAYER_TAG.set(span, RPC_FRAMEWORK_LAYER);
|
||||
}
|
||||
|
||||
public static void asNoSQL(Span span){
|
||||
SPAN_KIND_TAG.set(span, NOSQL_KIND);
|
||||
public static void asNoSQL(Span span) {
|
||||
SPAN_LAYER_TAG.set(span, NOSQL_LAYER);
|
||||
}
|
||||
|
||||
public static void asHttp(Span span){
|
||||
SPAN_KIND_TAG.set(span, HTTP_KIND);
|
||||
public static void asHttp(Span span) {
|
||||
SPAN_LAYER_TAG.set(span, HTTP_LAYER);
|
||||
}
|
||||
|
||||
public static String get(Span span){
|
||||
return SPAN_KIND_TAG.get(span);
|
||||
public static String get(Span span) {
|
||||
return SPAN_LAYER_TAG.get(span);
|
||||
}
|
||||
|
||||
public static boolean isDBAccess(Span span){
|
||||
return DB_KIND.equals(get(span));
|
||||
public static boolean isRDB(Span span) {
|
||||
return RDB_LAYER.equals(get(span));
|
||||
}
|
||||
|
||||
public static boolean isRPC(Span span){
|
||||
return RPC_KIND.equals(get(span));
|
||||
public static boolean isRPCFramework(Span span) {
|
||||
return RPC_FRAMEWORK_LAYER.equals(get(span));
|
||||
}
|
||||
|
||||
public static boolean isNoSQL(Span span){
|
||||
return NOSQL_KIND.equals(get(span));
|
||||
public static boolean isNoSQL(Span span) {
|
||||
return NOSQL_LAYER.equals(get(span));
|
||||
}
|
||||
|
||||
public static boolean isHttp(Span span){
|
||||
return HTTP_KIND.equals(get(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.
|
||||
|
|
@ -83,17 +102,17 @@ public final class Tags {
|
|||
public static final BooleanTag ERROR = new BooleanTag("error");
|
||||
|
||||
/**
|
||||
* PEER_HOST_IPV4 records IPv4 host address of the peer.
|
||||
* PEER_HOST records host address of the peer, maybe IPV4, IPV6 or hostname.
|
||||
*/
|
||||
public static final IntTag PEER_HOST_IPV4 = new IntTag("peer.ipv4");
|
||||
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_SQL records the sql statement of the database access.
|
||||
* DB_STATEMENT records the sql statement of the database access.
|
||||
*/
|
||||
public static final StringTag DB_SQL = new StringTag("db.statement");
|
||||
public static final StringTag DB_STATEMENT = new StringTag("db.statement");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.a.eye.skywalking.trace;
|
||||
|
||||
import com.a.eye.skywalking.trace.tag.Tags;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.junit.Assert;
|
||||
|
|
@ -38,52 +37,22 @@ public class SpanTestCase {
|
|||
@Test
|
||||
public void testSetTag() {
|
||||
Span span1 = new Span(0, "serviceA");
|
||||
Tags.SPAN_KIND.asHttp(span1);
|
||||
Tags.SPAN_LAYER.asHttp(span1);
|
||||
Tags.COMPONENT.set(span1, "Spring");
|
||||
Tags.PEER_HOST_IPV4.set(span1, ipToInt("127.0.0.1"));
|
||||
Tags.PEER_HOST.set(span1, "127.0.0.1");
|
||||
Tags.ERROR.set(span1, true);
|
||||
Tags.HTTP_STATUS.set(span1, 302);
|
||||
Tags.HTTP_URL.set(span1, "http://127.0.0.1/serviceA");
|
||||
Tags.STATUS_CODE.set(span1, 302);
|
||||
Tags.URL.set(span1, "http://127.0.0.1/serviceA");
|
||||
Tags.DB_URL.set(span1, "jdbc:127.0.0.1:user");
|
||||
Tags.DB_SQL.set(span1, "select * from users");
|
||||
Tags.DB_STATEMENT.set(span1, "select * from users");
|
||||
|
||||
Map<String, Object> tags = span1.getTags();
|
||||
Assert.assertEquals(8, tags.size());
|
||||
Assert.assertTrue(Tags.SPAN_KIND.isHttp(span1));
|
||||
Assert.assertEquals("127.0.0.1", intToIp(Tags.PEER_HOST_IPV4.get(span1)));
|
||||
Assert.assertTrue(Tags.SPAN_LAYER.isHttp(span1));
|
||||
Assert.assertEquals("127.0.0.1", Tags.PEER_HOST.get(span1));
|
||||
Assert.assertTrue(Tags.ERROR.get(span1));
|
||||
}
|
||||
|
||||
private int ipToInt(String ipAddress) {
|
||||
int result = 0;
|
||||
String[] ipAddressInArray = ipAddress.split("\\.");
|
||||
|
||||
for (int i = 3; i >= 0; i--) {
|
||||
|
||||
int ip = Integer.parseInt(ipAddressInArray[3 - i]);
|
||||
|
||||
//left shifting 24,16,8,0 and bitwise OR
|
||||
//1. 192 << 24
|
||||
//1. 168 << 16
|
||||
//1. 1 << 8
|
||||
//1. 2 << 0
|
||||
result |= ip << (i * 8);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static String intToIp(int longIp) {
|
||||
StringBuffer sb = new StringBuffer("");
|
||||
sb.append(String.valueOf((longIp >>> 24)));
|
||||
sb.append(".");
|
||||
sb.append(String.valueOf((longIp & 0x00FFFFFF) >>> 16));
|
||||
sb.append(".");
|
||||
sb.append(String.valueOf((longIp & 0x0000FFFF) >>> 8));
|
||||
sb.append(".");
|
||||
sb.append(String.valueOf((longIp & 0x000000FF)));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLogException(){
|
||||
Span span1 = new Span(0, "serviceA");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.util;
|
||||
package com.a.eye.skywalking.api.util;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.util;
|
||||
package com.a.eye.skywalking.api.util;
|
||||
|
||||
public final class StringUtil {
|
||||
public static boolean isEmpty(String str) {
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
<module>skywalking-api</module>
|
||||
<module>skywalking-sdk-plugin</module>
|
||||
<module>skywalking-toolkit-activation</module>
|
||||
<module>skywalking-sniffer-mock</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ package com.a.eye.skywalking.agent;
|
|||
|
||||
import com.a.eye.skywalking.agent.junction.SkyWalkingEnhanceMatcher;
|
||||
import com.a.eye.skywalking.conf.Config;
|
||||
import com.a.eye.skywalking.conf.SnifferConfigInitializer;
|
||||
import com.a.eye.skywalking.api.conf.SnifferConfigInitializer;
|
||||
import com.a.eye.skywalking.logging.EasyLogResolver;
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.plugin.AbstractClassEnhancePluginDefine;
|
||||
import com.a.eye.skywalking.plugin.PluginBootstrap;
|
||||
import com.a.eye.skywalking.plugin.PluginDefineCategory;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.plugin.AbstractClassEnhancePluginDefine;
|
||||
import com.a.eye.skywalking.api.plugin.PluginBootstrap;
|
||||
import com.a.eye.skywalking.api.plugin.PluginDefineCategory;
|
||||
import com.a.eye.skywalking.plugin.PluginException;
|
||||
import net.bytebuddy.agent.builder.AgentBuilder;
|
||||
import net.bytebuddy.description.NamedElement;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.agent.junction;
|
||||
|
||||
import com.a.eye.skywalking.plugin.PluginDefineCategory;
|
||||
import com.a.eye.skywalking.api.plugin.PluginDefineCategory;
|
||||
import net.bytebuddy.description.NamedElement;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -51,26 +51,6 @@
|
|||
<artifactId>disruptor</artifactId>
|
||||
<version>3.3.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- test dependencies section -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-api-mockito</artifactId>
|
||||
<version>1.6.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-module-junit4</artifactId>
|
||||
<version>1.6.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.conf;
|
||||
package com.a.eye.skywalking.api.conf;
|
||||
|
||||
public class Config {
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.conf;
|
||||
package com.a.eye.skywalking.api.conf;
|
||||
|
||||
import com.a.eye.skywalking.util.TraceIdGenerator;
|
||||
import com.a.eye.skywalking.api.util.TraceIdGenerator;
|
||||
|
||||
public class Constants {
|
||||
/**
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.a.eye.skywalking.conf;
|
||||
package com.a.eye.skywalking.api.conf;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.util.ConfigInitializer;
|
||||
import com.a.eye.skywalking.util.StringUtil;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.util.ConfigInitializer;
|
||||
import com.a.eye.skywalking.api.util.StringUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
package com.a.eye.skywalking.api.context;
|
||||
|
||||
import com.a.eye.skywalking.trace.TraceSegmentRef;
|
||||
import com.a.eye.skywalking.util.StringUtil;
|
||||
import com.a.eye.skywalking.api.util.StringUtil;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
package com.a.eye.skywalking.api.context;
|
||||
|
||||
import com.a.eye.skywalking.queue.TraceSegmentProcessQueue;
|
||||
import com.a.eye.skywalking.api.queue.TraceSegmentProcessQueue;
|
||||
import com.a.eye.skywalking.trace.Span;
|
||||
import com.a.eye.skywalking.trace.TraceSegment;
|
||||
|
||||
|
|
@ -39,6 +39,20 @@ public enum ContextManager implements TracerContextListener {
|
|||
return segment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link TracerContext#inject(ContextCarrier)}
|
||||
*/
|
||||
public void inject(ContextCarrier carrier) {
|
||||
get().inject(carrier);
|
||||
}
|
||||
|
||||
/**
|
||||
*@see {@link TracerContext#extract(ContextCarrier)}
|
||||
*/
|
||||
public void extract(ContextCarrier carrier) {
|
||||
get().extract(carrier);
|
||||
}
|
||||
|
||||
public Span createSpan(String operationName) {
|
||||
return get().createSpan(operationName);
|
||||
}
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
package com.a.eye.skywalking.api.context;
|
||||
|
||||
import com.a.eye.skywalking.trace.Span;
|
||||
import com.a.eye.skywalking.trace.TraceSegment;
|
||||
import com.a.eye.skywalking.util.TraceIdGenerator;
|
||||
import java.lang.reflect.Executable;
|
||||
import com.a.eye.skywalking.api.util.TraceIdGenerator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -173,7 +171,7 @@ public final class TracerContext {
|
|||
/**
|
||||
* Clear the given {@link TracerContextListener}
|
||||
*/
|
||||
static synchronized void remove(TracerContextListener listener){
|
||||
public static synchronized void remove(TracerContextListener listener){
|
||||
listeners.remove(listener);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
package com.a.eye.skywalking.api.context;
|
||||
|
||||
import com.a.eye.skywalking.trace.TraceSegment;
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.logging;
|
||||
package com.a.eye.skywalking.api.logging;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogResolver;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogResolver;
|
||||
|
||||
/**
|
||||
* Created by wusheng on 2016/11/26.
|
||||
|
|
@ -1,18 +1,19 @@
|
|||
package com.a.eye.skywalking.logging;
|
||||
package com.a.eye.skywalking.api.logging;
|
||||
|
||||
|
||||
import com.a.eye.skywalking.util.LoggingUtil;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
|
||||
import com.a.eye.skywalking.api.util.LoggingUtil;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.a.eye.skywalking.logging.LogLevel.*;
|
||||
import static com.a.eye.skywalking.api.logging.LogLevel.*;
|
||||
|
||||
/**
|
||||
* Created by xin on 16-6-23.
|
||||
*/
|
||||
public class EasyLogger implements com.a.eye.skywalking.logging.api.ILog {
|
||||
public class EasyLogger implements ILog {
|
||||
|
||||
private Class toBeLoggerClass;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.logging;
|
||||
package com.a.eye.skywalking.api.logging;
|
||||
|
||||
public interface IWriter {
|
||||
void write(String message);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.logging;
|
||||
package com.a.eye.skywalking.api.logging;
|
||||
|
||||
/**
|
||||
* Created by xin on 2016/12/7.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.logging;
|
||||
package com.a.eye.skywalking.api.logging;
|
||||
|
||||
public class STDOutWriter implements IWriter {
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.a.eye.skywalking.logging;
|
||||
package com.a.eye.skywalking.api.logging;
|
||||
|
||||
|
||||
import com.a.eye.skywalking.conf.Config;
|
||||
import com.a.eye.skywalking.util.LoggingUtil;
|
||||
|
||||
import com.a.eye.skywalking.api.conf.Config;
|
||||
import com.a.eye.skywalking.api.util.LoggingUtil;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.logging;
|
||||
package com.a.eye.skywalking.api.logging;
|
||||
|
||||
import com.a.eye.skywalking.conf.Config;
|
||||
import com.a.eye.skywalking.api.conf.Config;
|
||||
|
||||
public class WriterFactory {
|
||||
private WriterFactory(){
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.util.StringUtil;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.ClassEnhancePluginDefine;
|
||||
import com.a.eye.skywalking.api.util.StringUtil;
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
import net.bytebuddy.pool.TypePool.Resolution;
|
||||
|
||||
|
|
@ -10,7 +11,7 @@ import net.bytebuddy.pool.TypePool.Resolution;
|
|||
* Basic abstract class of all sky-walking auto-instrumentation plugins.
|
||||
* <p>
|
||||
* It provides the outline of enhancing the target class.
|
||||
* If you want to know more about enhancing, you should go to see {@link com.a.eye.skywalking.plugin.interceptor.enhance.ClassEnhancePluginDefine}
|
||||
* If you want to know more about enhancing, you should go to see {@link ClassEnhancePluginDefine}
|
||||
*/
|
||||
public abstract class AbstractClassEnhancePluginDefine {
|
||||
private static ILog logger = LogManager.getLogger(AbstractClassEnhancePluginDefine.class);
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import net.bytebuddy.pool.TypePool;
|
||||
|
||||
import java.net.URL;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import com.a.eye.skywalking.util.StringUtil;
|
||||
import com.a.eye.skywalking.api.util.StringUtil;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
public class PluginException extends RuntimeException {
|
||||
private static final long serialVersionUID = -6020188711867490724L;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import net.bytebuddy.ByteBuddy;
|
||||
import net.bytebuddy.dynamic.ClassFileLocator;
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.bytebuddy;
|
||||
package com.a.eye.skywalking.api.plugin.bytebuddy;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.bytebuddy;
|
||||
package com.a.eye.skywalking.api.plugin.bytebuddy;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.plugin.PluginException;
|
||||
import com.a.eye.skywalking.api.plugin.PluginException;
|
||||
|
||||
public class EnhanceException extends PluginException {
|
||||
private static final long serialVersionUID = -2234782755784217255L;
|
||||
|
|
@ -1,15 +1,17 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor;
|
||||
|
||||
import com.a.eye.skywalking.api.plugin.AbstractClassEnhancePluginDefine;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.ClassEnhancePluginDefine;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* Enhanced instance field type.
|
||||
*
|
||||
* Any plugins({@link com.a.eye.skywalking.plugin.AbstractClassEnhancePluginDefine}'s subclass) override
|
||||
* {@link com.a.eye.skywalking.plugin.interceptor.enhance.ClassEnhancePluginDefine#getConstructorsInterceptPoints}
|
||||
* Any plugins({@link AbstractClassEnhancePluginDefine}'s subclass) override
|
||||
* {@link ClassEnhancePluginDefine#getConstructorsInterceptPoints}
|
||||
* or
|
||||
* {@link com.a.eye.skywalking.plugin.interceptor.enhance.ClassEnhancePluginDefine#getInstanceMethodsInterceptPoints}
|
||||
* {@link ClassEnhancePluginDefine#getInstanceMethodsInterceptPoints}
|
||||
* will add a field with this type.
|
||||
*
|
||||
* @author wusheng
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor;
|
||||
|
||||
public class InterceptorException extends RuntimeException {
|
||||
private static final long serialVersionUID = 7846035239994885019L;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.assist;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.assist;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.InterceptorException;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InterceptorException;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
|
||||
/**
|
||||
* {@link NoCocurrencyAceessObject} is an abstract class,
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.loader.InterceptorInstanceLoader;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.loader.InterceptorInstanceLoader;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import net.bytebuddy.implementation.bind.annotation.AllArguments;
|
||||
import net.bytebuddy.implementation.bind.annotation.FieldProxy;
|
||||
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
|
||||
|
|
@ -1,11 +1,15 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.plugin.AbstractClassEnhancePluginDefine;
|
||||
import com.a.eye.skywalking.plugin.PluginException;
|
||||
import com.a.eye.skywalking.plugin.interceptor.*;
|
||||
import com.a.eye.skywalking.util.StringUtil;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.plugin.AbstractClassEnhancePluginDefine;
|
||||
import com.a.eye.skywalking.api.plugin.PluginException;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhanceException;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.StaticMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.util.StringUtil;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
import net.bytebuddy.implementation.MethodDelegation;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.StaticMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.StaticMethodsInterceptPoint;
|
||||
|
||||
/**
|
||||
* Plugins, which only need enhance class static methods.
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.loader.InterceptorInstanceLoader;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.loader.InterceptorInstanceLoader;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import net.bytebuddy.implementation.bind.annotation.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
|
||||
/**
|
||||
* Plugins, which only need enhance class static methods.
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.plugin.interceptor.loader.InterceptorInstanceLoader;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.loader.InterceptorInstanceLoader;
|
||||
import net.bytebuddy.implementation.bind.annotation.AllArguments;
|
||||
import net.bytebuddy.implementation.bind.annotation.Origin;
|
||||
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
/**
|
||||
* Constructor context.
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import net.bytebuddy.implementation.bind.annotation.AllArguments;
|
||||
import net.bytebuddy.implementation.bind.annotation.FieldProxy;
|
||||
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
public interface FieldGetter {
|
||||
Object getValue();
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
public interface FieldSetter {
|
||||
void setValue(Object value);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
|
||||
/**
|
||||
* The instance constructor's interceptor interface.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
/**
|
||||
* Instance method invoke context.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
|
||||
/**
|
||||
* A interceptor, which intercept method's invocation.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
|
||||
/**
|
||||
* This is a method return value manipulator.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
/**
|
||||
* Method invoke context.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
/**
|
||||
* Static method invoke context.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.enhance;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.loader;
|
||||
package com.a.eye.skywalking.api.plugin.interceptor.loader;
|
||||
|
||||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.api.logging.api.ILog;
|
||||
import com.a.eye.skywalking.api.logging.api.LogManager;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.queue;
|
||||
package com.a.eye.skywalking.api.queue;
|
||||
|
||||
import com.a.eye.skywalking.trace.TraceSegment;
|
||||
import com.lmax.disruptor.EventFactory;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.a.eye.skywalking.queue;
|
||||
package com.a.eye.skywalking.api.queue;
|
||||
|
||||
import com.a.eye.skywalking.conf.Config;
|
||||
import com.a.eye.skywalking.context.TracerContext;
|
||||
import com.a.eye.skywalking.context.TracerContextListener;
|
||||
import com.a.eye.skywalking.api.conf.Config;
|
||||
import com.a.eye.skywalking.api.context.TracerContext;
|
||||
import com.a.eye.skywalking.api.context.TracerContextListener;
|
||||
import com.a.eye.skywalking.health.report.HealthCollector;
|
||||
import com.a.eye.skywalking.health.report.HeathReading;
|
||||
import com.a.eye.skywalking.trace.TraceSegment;
|
||||
|
|
@ -36,7 +36,7 @@ public enum TraceSegmentProcessQueue implements TracerContextListener {
|
|||
RingBuffer<TraceSegmentHolder> buffer;
|
||||
|
||||
TraceSegmentProcessQueue() {
|
||||
disruptor = new Disruptor<>(TraceSegmentHolder.Factory.INSTANCE, Config.Disruptor.BUFFER_SIZE, DaemonThreadFactory.INSTANCE);
|
||||
disruptor = new Disruptor<TraceSegmentHolder>(TraceSegmentHolder.Factory.INSTANCE, Config.Disruptor.BUFFER_SIZE, DaemonThreadFactory.INSTANCE);
|
||||
buffer = disruptor.getRingBuffer();
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.util;
|
||||
package com.a.eye.skywalking.api.util;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.util;
|
||||
package com.a.eye.skywalking.api.util;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.net.InetAddress;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.util;
|
||||
package com.a.eye.skywalking.api.util;
|
||||
|
||||
/**
|
||||
* Created data xin on 2016/12/4.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.util;
|
||||
package com.a.eye.skywalking.api.util;
|
||||
|
||||
import com.a.eye.skywalking.conf.Constants;
|
||||
import com.a.eye.skywalking.api.conf.Constants;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class TraceIdGenerator {
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
package com.a.eye.skywalking.plugin.interceptor.enhance;
|
||||
|
||||
public interface FieldGetter {
|
||||
Object getValue();
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
package com.a.eye.skywalking.api.context;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
package com.a.eye.skywalking.api.context;
|
||||
|
||||
import com.a.eye.skywalking.trace.Span;
|
||||
import com.a.eye.skywalking.trace.TraceSegment;
|
||||
import com.a.eye.skywalking.trace.tag.Tags;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -24,4 +25,9 @@ public class ContextManagerTestCase {
|
|||
|
||||
Assert.assertEquals(span, segment.getSpans().get(0));
|
||||
}
|
||||
|
||||
@After
|
||||
public void reset(){
|
||||
TracerContext.ListenerManager.remove(TestTracerContextListener.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
package com.a.eye.skywalking.api.context;
|
||||
|
||||
import com.a.eye.skywalking.trace.TraceSegment;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.context;
|
||||
package com.a.eye.skywalking.api.context;
|
||||
|
||||
import com.a.eye.skywalking.trace.Span;
|
||||
import com.a.eye.skywalking.trace.TraceSegment;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
public class BeInterceptedClass {
|
||||
public BeInterceptedClass(){
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.a.eye.skywalking.plugin.PluginResourcesResolver;
|
||||
|
||||
public class PluginResourceResoverTest {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ConstructorInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
public class TestAroundInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.StaticMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ClassEnhancePluginDefine;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.StaticMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.ClassEnhancePluginDefine;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.a.eye.skywalking.plugin;
|
||||
package com.a.eye.skywalking.api.plugin;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.StaticMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.StaticMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.MethodInvokeContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.StaticMethodInvokeContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.StaticMethodsAroundInterceptor;
|
||||
|
||||
public class TestStaticAroundInterceptor implements StaticMethodsAroundInterceptor {
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.dubbo;
|
||||
package com.a.eye.skywalking.api.plugin.dubbo;
|
||||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.a.eye.skywalking.plugin.dubbo;
|
||||
package com.a.eye.skywalking.api.plugin.dubbo;
|
||||
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
package com.a.eye.skywalking.plugin.dubbo;
|
||||
package com.a.eye.skywalking.api.plugin.dubbo;
|
||||
|
||||
import com.a.eye.skywalking.api.plugin.dubbox.bugfix.below283.BugFixAcitve;
|
||||
import com.a.eye.skywalking.api.plugin.dubbox.bugfix.below283.SWBaseBean;
|
||||
import com.a.eye.skywalking.invoke.monitor.RPCClientInvokeMonitor;
|
||||
import com.a.eye.skywalking.invoke.monitor.RPCServerInvokeMonitor;
|
||||
import com.a.eye.skywalking.model.ContextData;
|
||||
import com.a.eye.skywalking.model.Identification;
|
||||
import com.a.eye.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve;
|
||||
import com.a.eye.skywalking.plugin.dubbox.bugfix.below283.SWBaseBean;
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.Result;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.dubbox.bugfix.below283;
|
||||
package com.a.eye.skywalking.api.plugin.dubbox.bugfix.below283;
|
||||
|
||||
public final class BugFixAcitve {
|
||||
public static boolean isActive = false;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.dubbox.bugfix.below283;
|
||||
package com.a.eye.skywalking.api.plugin.dubbox.bugfix.below283;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.httpClient.v4;
|
||||
package com.a.eye.skywalking.api.plugin.httpClient.v4;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ConstructorInvokeContext;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.HttpRequest;
|
||||
|
|
@ -8,8 +8,8 @@ import org.apache.http.HttpRequest;
|
|||
import com.a.eye.skywalking.invoke.monitor.RPCClientInvokeMonitor;
|
||||
import com.a.eye.skywalking.model.Identification;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
/**
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.httpClient.v4;
|
||||
package com.a.eye.skywalking.api.plugin.httpClient.v4;
|
||||
|
||||
import com.a.eye.skywalking.api.IBuriedPointType;
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.httpClient.v4.define;
|
||||
package com.a.eye.skywalking.api.plugin.httpClient.v4.define;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.httpClient.v4.define;
|
||||
package com.a.eye.skywalking.api.plugin.httpClient.v4.define;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.httpClient.v4.define;
|
||||
package com.a.eye.skywalking.api.plugin.httpClient.v4.define;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import com.a.eye.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.httpClient.v4.define;
|
||||
package com.a.eye.skywalking.api.plugin.httpClient.v4.define;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.httpClient.v4.define;
|
||||
package com.a.eye.skywalking.api.plugin.httpClient.v4.define;
|
||||
|
||||
import com.a.eye.skywalking.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import com.a.eye.skywalking.api.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.a.eye.skywalking.plugin.jdbc;
|
||||
package com.a.eye.skywalking.api.plugin.jdbc;
|
||||
|
||||
import com.a.eye.skywalking.api.plugin.jdbc.define.JDBCBuriedPointType;
|
||||
import com.a.eye.skywalking.invoke.monitor.RPCClientInvokeMonitor;
|
||||
import com.a.eye.skywalking.model.Identification;
|
||||
import com.a.eye.skywalking.plugin.jdbc.define.JDBCBuriedPointType;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.a.eye.skywalking.plugin.jdbc;
|
||||
package com.a.eye.skywalking.api.plugin.jdbc;
|
||||
|
||||
import com.a.eye.skywalking.api.plugin.jdbc.define.JDBCBuriedPointType;
|
||||
import com.a.eye.skywalking.model.Identification;
|
||||
import com.a.eye.skywalking.invoke.monitor.RPCClientInvokeMonitor;
|
||||
import com.a.eye.skywalking.plugin.jdbc.define.JDBCBuriedPointType;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.a.eye.skywalking.plugin.jdbc;
|
||||
package com.a.eye.skywalking.api.plugin.jdbc;
|
||||
|
||||
import com.a.eye.skywalking.context.ContextManager;
|
||||
import com.a.eye.skywalking.api.context.ContextManager;
|
||||
import com.a.eye.skywalking.trace.Span;
|
||||
import com.a.eye.skywalking.trace.tag.Tags;
|
||||
import java.sql.SQLException;
|
||||
|
|
@ -17,9 +17,9 @@ public class PreparedStatementTracing {
|
|||
throws SQLException {
|
||||
Span span = ContextManager.INSTANCE.createSpan("JDBC/PreparedStatement/" + method);
|
||||
try {
|
||||
Tags.SPAN_KIND.asDBAccess(span);
|
||||
Tags.SPAN_LAYER.asRDB(span);
|
||||
Tags.DB_URL.set(span, connectInfo);
|
||||
Tags.DB_SQL.set(span, sql);
|
||||
Tags.DB_STATEMENT.set(span, sql);
|
||||
return exec.exe(realStatement, sql);
|
||||
} catch (SQLException e) {
|
||||
span.log(e);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.jdbc;
|
||||
package com.a.eye.skywalking.api.plugin.jdbc;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.jdbc;
|
||||
package com.a.eye.skywalking.api.plugin.jdbc;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.Map;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.jdbc;
|
||||
package com.a.eye.skywalking.api.plugin.jdbc;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.a.eye.skywalking.plugin.jdbc;
|
||||
package com.a.eye.skywalking.api.plugin.jdbc;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.a.eye.skywalking.plugin.jdbc;
|
||||
package com.a.eye.skywalking.api.plugin.jdbc;
|
||||
|
||||
import com.a.eye.skywalking.api.plugin.jdbc.define.JDBCBuriedPointType;
|
||||
import com.a.eye.skywalking.model.Identification;
|
||||
import com.a.eye.skywalking.invoke.monitor.RPCClientInvokeMonitor;
|
||||
import com.a.eye.skywalking.plugin.jdbc.define.JDBCBuriedPointType;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue