未验证 提交 a0868047 编写于 作者: X Xin,Zhang 提交者: GitHub

Merge branch 'master' into fix/match-failed

...@@ -30,7 +30,7 @@ Sky Walking | [中文](README_ZH.md) ...@@ -30,7 +30,7 @@ Sky Walking | [中文](README_ZH.md)
This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to wu.sheng@foxmail.com. This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to wu.sheng@foxmail.com.
# Screenshots # Screenshots
- Topological graph of application clusters based on dubbox and [motan](https://github.com/weibocom/motan). - Discovery topological graph of application clusters automatically.
<img src="https://skywalkingtest.github.io/page-resources/3.2.1/topological_graph_test_project.png"/> <img src="https://skywalkingtest.github.io/page-resources/3.2.1/topological_graph_test_project.png"/>
- Trace query. - Trace query.
......
...@@ -19,7 +19,7 @@ Sky Walking | [English](README.md) ...@@ -19,7 +19,7 @@ Sky Walking | [English](README.md)
* 使用 [**@Trace**](docs/cn/Application-toolkit-trace-CN.md) 标注追踪业务方法 * 使用 [**@Trace**](docs/cn/Application-toolkit-trace-CN.md) 标注追踪业务方法
* 将 traceId 集成到 log4j, log4j2 或 logback这些日志组件中 * 将 traceId 集成到 log4j, log4j2 或 logback这些日志组件中
* 纯Java后端Collector实现,提供RESTful和gRPC接口。兼容接受其他语言探针发送数据 * 纯Java后端Collector实现,提供RESTful和gRPC接口。兼容接受其他语言探针发送数据
* [如何将探针的Metric和Trace数据上传到Collector?]() * [如何将探针的Metric和Trace数据上传到Collector?](/docs/cn/How-to-communicate-with-the-collector-CN.md)
* UI工程请查看 [skywalking-ui](https://github.com/OpenSkywalking/skywalking-ui) * UI工程请查看 [skywalking-ui](https://github.com/OpenSkywalking/skywalking-ui)
* 中文QQ群:392443393 * 中文QQ群:392443393
...@@ -33,7 +33,7 @@ Sky Walking | [English](README.md) ...@@ -33,7 +33,7 @@ Sky Walking | [English](README.md)
This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to wu.sheng@foxmail.com. This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to wu.sheng@foxmail.com.
# Screenshots # Screenshots
- 追踪基于 dubbox 和 [motan](https://github.com/weibocom/motan)的分布式系统,生成的拓扑截图 - 分布式系统拓扑图自动发现
<img src="https://skywalkingtest.github.io/page-resources/3.2.1/topological_graph_test_project.png?forceUpdate=0"/> <img src="https://skywalkingtest.github.io/page-resources/3.2.1/topological_graph_test_project.png?forceUpdate=0"/>
- 调用链查询 - 调用链查询
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-application-toolkit</artifactId> <artifactId>apm-application-toolkit</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-application-toolkit</artifactId> <artifactId>apm-application-toolkit</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-application-toolkit</artifactId> <artifactId>apm-application-toolkit</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-application-toolkit</artifactId> <artifactId>apm-application-toolkit</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apm-application-toolkit</artifactId> <artifactId>apm-application-toolkit</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm</artifactId> <artifactId>apm</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>apm-application-toolkit</artifactId> <artifactId>apm-application-toolkit</artifactId>
......
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
<parent> <parent>
<artifactId>apm-collector-agent-grpc</artifactId> <artifactId>apm-collector-agent-grpc</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>collector-agent-grpc-define</artifactId> <artifactId>collector-agent-grpc-define</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-agent-grpc</artifactId> <artifactId>apm-collector-agent-grpc</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -41,4 +41,4 @@ ...@@ -41,4 +41,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
<parent> <parent>
<artifactId>apm-collector-agent-jetty</artifactId> <artifactId>apm-collector-agent-jetty</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>collector-agent-jetty-define</artifactId> <artifactId>collector-agent-jetty-define</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-agent-jetty</artifactId> <artifactId>apm-collector-agent-jetty</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -41,4 +41,4 @@ ...@@ -41,4 +41,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-agent-stream</artifactId> <artifactId>apm-collector-agent-stream</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -37,4 +37,4 @@ ...@@ -37,4 +37,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-agent-stream</artifactId> <artifactId>apm-collector-agent-stream</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -52,4 +52,4 @@ ...@@ -52,4 +52,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -42,7 +42,7 @@ public class SegmentStandardizationWorker extends AbstractLocalAsyncWorker<Segme ...@@ -42,7 +42,7 @@ public class SegmentStandardizationWorker extends AbstractLocalAsyncWorker<Segme
} }
@Override public int id() { @Override public int id() {
return SegmentStandardizationWorker.class.hashCode(); return 108;
} }
@Override protected void onWork(SegmentStandardization segmentStandardization) throws WorkerException { @Override protected void onWork(SegmentStandardization segmentStandardization) throws WorkerException {
......
...@@ -37,7 +37,7 @@ public class CpuMetricPersistenceWorker extends PersistenceWorker<CpuMetric, Cpu ...@@ -37,7 +37,7 @@ public class CpuMetricPersistenceWorker extends PersistenceWorker<CpuMetric, Cpu
} }
@Override public int id() { @Override public int id() {
return 0; return 115;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -37,7 +37,7 @@ public class GCMetricPersistenceWorker extends PersistenceWorker<GCMetric, GCMet ...@@ -37,7 +37,7 @@ public class GCMetricPersistenceWorker extends PersistenceWorker<GCMetric, GCMet
} }
@Override public int id() { @Override public int id() {
return 0; return 112;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -37,7 +37,7 @@ public class InstHeartBeatPersistenceWorker extends PersistenceWorker<Instance, ...@@ -37,7 +37,7 @@ public class InstHeartBeatPersistenceWorker extends PersistenceWorker<Instance,
} }
@Override public int id() { @Override public int id() {
return InstHeartBeatPersistenceWorker.class.hashCode(); return 113;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -37,7 +37,7 @@ public class MemoryMetricPersistenceWorker extends PersistenceWorker<MemoryMetri ...@@ -37,7 +37,7 @@ public class MemoryMetricPersistenceWorker extends PersistenceWorker<MemoryMetri
} }
@Override public int id() { @Override public int id() {
return 0; return 119;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -33,7 +33,7 @@ import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker; ...@@ -33,7 +33,7 @@ import org.skywalking.apm.collector.stream.worker.impl.PersistenceWorker;
public class MemoryPoolMetricPersistenceWorker extends PersistenceWorker<MemoryPoolMetric, MemoryPoolMetric> { public class MemoryPoolMetricPersistenceWorker extends PersistenceWorker<MemoryPoolMetric, MemoryPoolMetric> {
@Override public int id() { @Override public int id() {
return 0; return 122;
} }
public MemoryPoolMetricPersistenceWorker(ModuleManager moduleManager) { public MemoryPoolMetricPersistenceWorker(ModuleManager moduleManager) {
......
...@@ -40,7 +40,7 @@ public class ApplicationRegisterRemoteWorker extends AbstractRemoteWorker<Applic ...@@ -40,7 +40,7 @@ public class ApplicationRegisterRemoteWorker extends AbstractRemoteWorker<Applic
} }
@Override public int id() { @Override public int id() {
return ApplicationRegisterRemoteWorker.class.hashCode(); return 10006;
} }
@Override protected void onWork(Application message) throws WorkerException { @Override protected void onWork(Application message) throws WorkerException {
......
...@@ -50,7 +50,7 @@ public class ApplicationRegisterSerialWorker extends AbstractLocalAsyncWorker<Ap ...@@ -50,7 +50,7 @@ public class ApplicationRegisterSerialWorker extends AbstractLocalAsyncWorker<Ap
} }
@Override public int id() { @Override public int id() {
return ApplicationRegisterSerialWorker.class.hashCode(); return 101;
} }
@Override protected void onWork(Application application) throws WorkerException { @Override protected void onWork(Application application) throws WorkerException {
......
...@@ -36,7 +36,7 @@ public class InstanceRegisterRemoteWorker extends AbstractRemoteWorker<Instance, ...@@ -36,7 +36,7 @@ public class InstanceRegisterRemoteWorker extends AbstractRemoteWorker<Instance,
private final Logger logger = LoggerFactory.getLogger(InstanceRegisterRemoteWorker.class); private final Logger logger = LoggerFactory.getLogger(InstanceRegisterRemoteWorker.class);
@Override public int id() { @Override public int id() {
return InstanceRegisterRemoteWorker.class.hashCode(); return 10001;
} }
InstanceRegisterRemoteWorker(ModuleManager moduleManager) { InstanceRegisterRemoteWorker(ModuleManager moduleManager) {
......
...@@ -48,7 +48,7 @@ public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker<Insta ...@@ -48,7 +48,7 @@ public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker<Insta
} }
@Override public int id() { @Override public int id() {
return InstanceRegisterSerialWorker.class.hashCode(); return 102;
} }
@Override protected void onWork(Instance instance) throws WorkerException { @Override protected void onWork(Instance instance) throws WorkerException {
......
...@@ -40,7 +40,7 @@ public class ServiceNameRegisterRemoteWorker extends AbstractRemoteWorker<Servic ...@@ -40,7 +40,7 @@ public class ServiceNameRegisterRemoteWorker extends AbstractRemoteWorker<Servic
} }
@Override public int id() { @Override public int id() {
return ServiceNameRegisterRemoteWorker.class.hashCode(); return 10000;
} }
@Override protected void onWork(ServiceName serviceName) throws WorkerException { @Override protected void onWork(ServiceName serviceName) throws WorkerException {
......
...@@ -50,7 +50,7 @@ public class ServiceNameRegisterSerialWorker extends AbstractLocalAsyncWorker<Se ...@@ -50,7 +50,7 @@ public class ServiceNameRegisterSerialWorker extends AbstractLocalAsyncWorker<Se
} }
@Override public int id() { @Override public int id() {
return ServiceNameRegisterSerialWorker.class.hashCode(); return 100;
} }
@Override protected void onWork(ServiceName serviceName) throws WorkerException { @Override protected void onWork(ServiceName serviceName) throws WorkerException {
......
...@@ -37,7 +37,7 @@ public class GlobalTracePersistenceWorker extends PersistenceWorker<GlobalTrace, ...@@ -37,7 +37,7 @@ public class GlobalTracePersistenceWorker extends PersistenceWorker<GlobalTrace,
} }
@Override public int id() { @Override public int id() {
return 0; return 120;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -37,7 +37,7 @@ public class InstPerformancePersistenceWorker extends PersistenceWorker<InstPerf ...@@ -37,7 +37,7 @@ public class InstPerformancePersistenceWorker extends PersistenceWorker<InstPerf
} }
@Override public int id() { @Override public int id() {
return InstPerformancePersistenceWorker.class.hashCode(); return 118;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -34,7 +34,7 @@ public class NodeComponentAggregationWorker extends AggregationWorker<NodeCompon ...@@ -34,7 +34,7 @@ public class NodeComponentAggregationWorker extends AggregationWorker<NodeCompon
} }
@Override public int id() { @Override public int id() {
return NodeComponentAggregationWorker.class.hashCode(); return 104;
} }
public static class Factory extends AbstractLocalAsyncWorkerProvider<NodeComponent, NodeComponent, NodeComponentAggregationWorker> { public static class Factory extends AbstractLocalAsyncWorkerProvider<NodeComponent, NodeComponent, NodeComponentAggregationWorker> {
......
...@@ -37,7 +37,7 @@ public class NodeComponentPersistenceWorker extends PersistenceWorker<NodeCompon ...@@ -37,7 +37,7 @@ public class NodeComponentPersistenceWorker extends PersistenceWorker<NodeCompon
} }
@Override public int id() { @Override public int id() {
return NodeComponentPersistenceWorker.class.hashCode(); return 111;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -36,7 +36,7 @@ public class NodeComponentRemoteWorker extends AbstractRemoteWorker<NodeComponen ...@@ -36,7 +36,7 @@ public class NodeComponentRemoteWorker extends AbstractRemoteWorker<NodeComponen
} }
@Override public int id() { @Override public int id() {
return NodeComponentRemoteWorker.class.hashCode(); return 10004;
} }
@Override protected void onWork(NodeComponent nodeComponent) throws WorkerException { @Override protected void onWork(NodeComponent nodeComponent) throws WorkerException {
......
...@@ -34,7 +34,7 @@ public class NodeMappingAggregationWorker extends AggregationWorker<NodeMapping, ...@@ -34,7 +34,7 @@ public class NodeMappingAggregationWorker extends AggregationWorker<NodeMapping,
} }
@Override public int id() { @Override public int id() {
return NodeMappingAggregationWorker.class.hashCode(); return 105;
} }
public static class Factory extends AbstractLocalAsyncWorkerProvider<NodeMapping, NodeMapping, NodeMappingAggregationWorker> { public static class Factory extends AbstractLocalAsyncWorkerProvider<NodeMapping, NodeMapping, NodeMappingAggregationWorker> {
......
...@@ -37,7 +37,7 @@ public class NodeMappingPersistenceWorker extends PersistenceWorker<NodeMapping, ...@@ -37,7 +37,7 @@ public class NodeMappingPersistenceWorker extends PersistenceWorker<NodeMapping,
} }
@Override public int id() { @Override public int id() {
return NodeMappingPersistenceWorker.class.hashCode(); return 114;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -36,7 +36,7 @@ public class NodeMappingRemoteWorker extends AbstractRemoteWorker<NodeMapping, N ...@@ -36,7 +36,7 @@ public class NodeMappingRemoteWorker extends AbstractRemoteWorker<NodeMapping, N
} }
@Override public int id() { @Override public int id() {
return NodeMappingRemoteWorker.class.hashCode(); return 10007;
} }
@Override protected void onWork(NodeMapping nodeMapping) throws WorkerException { @Override protected void onWork(NodeMapping nodeMapping) throws WorkerException {
......
...@@ -34,7 +34,7 @@ public class NodeReferenceAggregationWorker extends AggregationWorker<NodeRefere ...@@ -34,7 +34,7 @@ public class NodeReferenceAggregationWorker extends AggregationWorker<NodeRefere
} }
@Override public int id() { @Override public int id() {
return NodeReferenceAggregationWorker.class.hashCode(); return 106;
} }
public static class Factory extends AbstractLocalAsyncWorkerProvider<NodeReference, NodeReference, NodeReferenceAggregationWorker> { public static class Factory extends AbstractLocalAsyncWorkerProvider<NodeReference, NodeReference, NodeReferenceAggregationWorker> {
......
...@@ -37,7 +37,7 @@ public class NodeReferencePersistenceWorker extends PersistenceWorker<NodeRefere ...@@ -37,7 +37,7 @@ public class NodeReferencePersistenceWorker extends PersistenceWorker<NodeRefere
} }
@Override public int id() { @Override public int id() {
return 0; return 116;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -36,7 +36,7 @@ public class NodeReferenceRemoteWorker extends AbstractRemoteWorker<NodeReferenc ...@@ -36,7 +36,7 @@ public class NodeReferenceRemoteWorker extends AbstractRemoteWorker<NodeReferenc
} }
@Override public int id() { @Override public int id() {
return NodeReferenceRemoteWorker.class.hashCode(); return 10002;
} }
@Override protected void onWork(NodeReference nodeReference) throws WorkerException { @Override protected void onWork(NodeReference nodeReference) throws WorkerException {
......
...@@ -37,7 +37,7 @@ public class SegmentCostPersistenceWorker extends PersistenceWorker<SegmentCost, ...@@ -37,7 +37,7 @@ public class SegmentCostPersistenceWorker extends PersistenceWorker<SegmentCost,
} }
@Override public int id() { @Override public int id() {
return SegmentCostPersistenceWorker.class.hashCode(); return 110;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -37,7 +37,7 @@ public class SegmentPersistenceWorker extends PersistenceWorker<Segment, Segment ...@@ -37,7 +37,7 @@ public class SegmentPersistenceWorker extends PersistenceWorker<Segment, Segment
} }
@Override public int id() { @Override public int id() {
return 0; return 117;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -34,7 +34,7 @@ public class ServiceEntryAggregationWorker extends AggregationWorker<ServiceEntr ...@@ -34,7 +34,7 @@ public class ServiceEntryAggregationWorker extends AggregationWorker<ServiceEntr
} }
@Override public int id() { @Override public int id() {
return ServiceEntryAggregationWorker.class.hashCode(); return 103;
} }
public static class Factory extends AbstractLocalAsyncWorkerProvider<ServiceEntry, ServiceEntry, ServiceEntryAggregationWorker> { public static class Factory extends AbstractLocalAsyncWorkerProvider<ServiceEntry, ServiceEntry, ServiceEntryAggregationWorker> {
......
...@@ -37,7 +37,7 @@ public class ServiceEntryPersistenceWorker extends PersistenceWorker<ServiceEntr ...@@ -37,7 +37,7 @@ public class ServiceEntryPersistenceWorker extends PersistenceWorker<ServiceEntr
} }
@Override public int id() { @Override public int id() {
return 0; return 121;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -36,7 +36,7 @@ public class ServiceEntryRemoteWorker extends AbstractRemoteWorker<ServiceEntry, ...@@ -36,7 +36,7 @@ public class ServiceEntryRemoteWorker extends AbstractRemoteWorker<ServiceEntry,
} }
@Override public int id() { @Override public int id() {
return ServiceEntryRemoteWorker.class.hashCode(); return 10003;
} }
@Override protected void onWork(ServiceEntry serviceEntry) throws WorkerException { @Override protected void onWork(ServiceEntry serviceEntry) throws WorkerException {
......
...@@ -34,7 +34,7 @@ public class ServiceReferenceAggregationWorker extends AggregationWorker<Service ...@@ -34,7 +34,7 @@ public class ServiceReferenceAggregationWorker extends AggregationWorker<Service
} }
@Override public int id() { @Override public int id() {
return ServiceReferenceAggregationWorker.class.hashCode(); return 107;
} }
public static class Factory extends AbstractLocalAsyncWorkerProvider<ServiceReference, ServiceReference, ServiceReferenceAggregationWorker> { public static class Factory extends AbstractLocalAsyncWorkerProvider<ServiceReference, ServiceReference, ServiceReferenceAggregationWorker> {
......
...@@ -37,7 +37,7 @@ public class ServiceReferencePersistenceWorker extends PersistenceWorker<Service ...@@ -37,7 +37,7 @@ public class ServiceReferencePersistenceWorker extends PersistenceWorker<Service
} }
@Override public int id() { @Override public int id() {
return 0; return 109;
} }
@Override protected boolean needMergeDBData() { @Override protected boolean needMergeDBData() {
......
...@@ -36,7 +36,7 @@ public class ServiceReferenceRemoteWorker extends AbstractRemoteWorker<ServiceRe ...@@ -36,7 +36,7 @@ public class ServiceReferenceRemoteWorker extends AbstractRemoteWorker<ServiceRe
} }
@Override public int id() { @Override public int id() {
return ServiceReferenceRemoteWorker.class.hashCode(); return 10005;
} }
@Override protected void onWork(ServiceReference serviceReference) throws WorkerException { @Override protected void onWork(ServiceReference serviceReference) throws WorkerException {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -41,4 +41,4 @@ ...@@ -41,4 +41,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
<parent> <parent>
<artifactId>apm-collector-baseline</artifactId> <artifactId>apm-collector-baseline</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>collector-baseline-computing-define</artifactId> <artifactId>collector-baseline-computing-define</artifactId>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-baseline</artifactId> <artifactId>apm-collector-baseline</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -41,4 +41,4 @@ ...@@ -41,4 +41,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
<parent> <parent>
<artifactId>apm-collector-baseline</artifactId> <artifactId>apm-collector-baseline</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>collector-baseline-scheduler-define</artifactId> <artifactId>collector-baseline-scheduler-define</artifactId>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -42,4 +42,4 @@ ...@@ -42,4 +42,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
<parent> <parent>
<artifactId>apm-collector-cache</artifactId> <artifactId>apm-collector-cache</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>collector-cache-define</artifactId> <artifactId>collector-cache-define</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-cache</artifactId> <artifactId>apm-collector-cache</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -42,4 +42,4 @@ ...@@ -42,4 +42,4 @@
<version>19.0</version> <version>19.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-cluster</artifactId> <artifactId>apm-collector-cluster</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-cluster</artifactId> <artifactId>apm-collector-cluster</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-cluster</artifactId> <artifactId>apm-collector-cluster</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-cluster</artifactId> <artifactId>apm-collector-cluster</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -30,4 +30,4 @@ ...@@ -30,4 +30,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector-component</artifactId> <artifactId>apm-collector-component</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector-component</artifactId> <artifactId>apm-collector-component</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -103,10 +103,12 @@ public class BootstrapFlow { ...@@ -103,10 +103,12 @@ public class BootstrapFlow {
if (isAllRequiredModuleStarted) { if (isAllRequiredModuleStarted) {
startupSequence.add(provider); startupSequence.add(provider);
allProviders.remove(i); allProviders.remove(i);
i--;
} }
} else { } else {
startupSequence.add(provider); startupSequence.add(provider);
allProviders.remove(i); allProviders.remove(i);
i--;
} }
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-grpc-manager</artifactId> <artifactId>apm-collector-grpc-manager</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-grpc-manager</artifactId> <artifactId>apm-collector-grpc-manager</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-jetty-manager</artifactId> <artifactId>apm-collector-jetty-manager</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-jetty-manager</artifactId> <artifactId>apm-collector-jetty-manager</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-naming</artifactId> <artifactId>apm-collector-naming</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-naming</artifactId> <artifactId>apm-collector-naming</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-queue</artifactId> <artifactId>apm-collector-queue</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-queue</artifactId> <artifactId>apm-collector-queue</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-queue</artifactId> <artifactId>apm-collector-queue</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -42,4 +42,4 @@ ...@@ -42,4 +42,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector-remote</artifactId> <artifactId>apm-collector-remote</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-remote</artifactId> <artifactId>apm-collector-remote</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-remote</artifactId> <artifactId>apm-collector-remote</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -39,4 +39,4 @@ ...@@ -39,4 +39,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-storage</artifactId> <artifactId>apm-collector-storage</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-storage</artifactId> <artifactId>apm-collector-storage</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
package org.skywalking.apm.collector.storage.es; package org.skywalking.apm.collector.storage.es;
import java.util.Calendar; import java.util.Calendar;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.skywalking.apm.collector.core.module.ModuleManager; import org.skywalking.apm.collector.core.module.ModuleManager;
import org.skywalking.apm.collector.storage.StorageModule; import org.skywalking.apm.collector.storage.StorageModule;
import org.skywalking.apm.collector.storage.dao.ICpuMetricPersistenceDAO; import org.skywalking.apm.collector.storage.dao.ICpuMetricPersistenceDAO;
...@@ -55,7 +53,8 @@ public class DataTTLKeeperTimer { ...@@ -55,7 +53,8 @@ public class DataTTLKeeperTimer {
} }
public void start() { public void start() {
Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(this::delete, 1, 8, TimeUnit.HOURS); //TODO: Don't release auto delete feature, yet
//Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(this::delete, 1, 8, TimeUnit.HOURS);
} }
private void delete() { private void delete() {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-storage</artifactId> <artifactId>apm-collector-storage</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -34,4 +34,4 @@ ...@@ -34,4 +34,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -57,4 +57,4 @@ ...@@ -57,4 +57,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-ui</artifactId> <artifactId>apm-collector-ui</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-collector-ui</artifactId> <artifactId>apm-collector-ui</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -62,4 +62,4 @@ ...@@ -62,4 +62,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apm-collector</artifactId> <artifactId>apm-collector</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -23,4 +23,4 @@ ...@@ -23,4 +23,4 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm</artifactId> <artifactId>apm</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-commons</artifactId> <artifactId>apm-commons</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-commons</artifactId> <artifactId>apm-commons</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm</artifactId> <artifactId>apm</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm</artifactId> <artifactId>apm</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.7.0</grpc.version> <grpc.version>1.8.0</grpc.version>
<netty.version>4.1.17.Final</netty.version>
<compiler.version>1.6</compiler.version> <compiler.version>1.6</compiler.version>
</properties> </properties>
...@@ -40,6 +41,20 @@ ...@@ -40,6 +41,20 @@
<groupId>io.grpc</groupId> <groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId> <artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version> <version>${grpc.version}</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.grpc</groupId> <groupId>io.grpc</groupId>
...@@ -51,6 +66,21 @@ ...@@ -51,6 +66,21 @@
<artifactId>grpc-stub</artifactId> <artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version> <version>${grpc.version}</version>
</dependency> </dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
...@@ -58,7 +88,7 @@ ...@@ -58,7 +88,7 @@
<extension> <extension>
<groupId>kr.motd.maven</groupId> <groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId> <artifactId>os-maven-plugin</artifactId>
<version>1.4.1.Final</version> <version>1.5.0.Final</version>
</extension> </extension>
</extensions> </extensions>
<plugins> <plugins>
......
...@@ -71,6 +71,11 @@ public class ComponentsDefine { ...@@ -71,6 +71,11 @@ public class ComponentsDefine {
public static final OfficialComponent GRPC = new OfficialComponent(23, "GRPC"); public static final OfficialComponent GRPC = new OfficialComponent(23, "GRPC");
public static final OfficialComponent ELASTIC_JOB = new OfficialComponent(24, "ElasticJob");
public static final OfficialComponent ROCKET_MQ = new OfficialComponent(25, "RocketMQ");
private static ComponentsDefine instance = new ComponentsDefine(); private static ComponentsDefine instance = new ComponentsDefine();
private String[] components; private String[] components;
...@@ -80,7 +85,7 @@ public class ComponentsDefine { ...@@ -80,7 +85,7 @@ public class ComponentsDefine {
} }
public ComponentsDefine() { public ComponentsDefine() {
components = new String[24]; components = new String[26];
addComponent(TOMCAT); addComponent(TOMCAT);
addComponent(HTTPCLIENT); addComponent(HTTPCLIENT);
addComponent(DUBBO); addComponent(DUBBO);
...@@ -104,6 +109,8 @@ public class ComponentsDefine { ...@@ -104,6 +109,8 @@ public class ComponentsDefine {
addComponent(SHARDING_JDBC); addComponent(SHARDING_JDBC);
addComponent(POSTGRESQL); addComponent(POSTGRESQL);
addComponent(GRPC); addComponent(GRPC);
addComponent(ELASTIC_JOB);
addComponent(ROCKET_MQ);
} }
private void addComponent(OfficialComponent component) { private void addComponent(OfficialComponent component) {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sniffer</artifactId> <artifactId>apm-sniffer</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-agent-core</artifactId> <artifactId>apm-agent-core</artifactId>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jetty.version>9.4.2.v20170220</jetty.version> <jetty.version>9.4.2.v20170220</jetty.version>
<grpc.version>1.7.0</grpc.version> <grpc.version>1.8.0</grpc.version>
<bytebuddy.version>1.7.6</bytebuddy.version> <bytebuddy.version>1.7.6</bytebuddy.version>
<shade.package>org.skywalking.apm.dependencies</shade.package> <shade.package>org.skywalking.apm.dependencies</shade.package>
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
<shade.io.grpc.target>${shade.package}.${shade.io.grpc.source}</shade.io.grpc.target> <shade.io.grpc.target>${shade.package}.${shade.io.grpc.source}</shade.io.grpc.target>
<shade.io.netty.source>io.netty</shade.io.netty.source> <shade.io.netty.source>io.netty</shade.io.netty.source>
<shade.io.netty.target>${shade.package}.${shade.io.netty.source}</shade.io.netty.target> <shade.io.netty.target>${shade.package}.${shade.io.netty.source}</shade.io.netty.target>
<shade.io.opencensus.source>io.opencensus</shade.io.opencensus.source>
<shade.io.opencensus.target>${shade.package}.${shade.io.opencensus.source}</shade.io.opencensus.target>
</properties> </properties>
<dependencies> <dependencies>
...@@ -176,6 +178,10 @@ ...@@ -176,6 +178,10 @@
<pattern>${shade.io.netty.source}</pattern> <pattern>${shade.io.netty.source}</pattern>
<shadedPattern>${shade.io.netty.target}</shadedPattern> <shadedPattern>${shade.io.netty.target}</shadedPattern>
</relocation> </relocation>
<relocation>
<pattern>${shade.io.opencensus.source}</pattern>
<shadedPattern>${shade.io.opencensus.target}</shadedPattern>
</relocation>
</relocations> </relocations>
<filters> <filters>
<filter> <filter>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sniffer</artifactId> <artifactId>apm-sniffer</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-agent</artifactId> <artifactId>apm-agent</artifactId>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -148,6 +148,7 @@ ...@@ -148,6 +148,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId>
<version>3.2.6-2017</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apm-elastic-job-2.x-plugin</artifactId>
<packaging>jar</packaging>
<name>elastic-job-2.x-plugin</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.dangdang</groupId>
<artifactId>elastic-job-common-core</artifactId>
<version>[2.0.0,3.0.0)</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<!-- 源码插件 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<!-- 发布时自动将源码同时发布的配置 -->
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.esjob;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.executor.ShardingContexts;
import com.google.common.base.Strings;
import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.network.trace.component.ComponentsDefine;
/**
* {@link JobExecutorInterceptor} enhances {@link com.dangdang.ddframe.job.executor.AbstractElasticJobExecutor#process(ShardingContext)}
* ,creating a local span that records job execution.
*
* @author gaohongtao
*/
public class JobExecutorInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
ShardingContexts shardingContexts = (ShardingContexts)allArguments[0];
Integer item = (Integer)allArguments[1];
ShardingContext shardingContext = new ShardingContext(shardingContexts, item);
String operateName = shardingContext.getJobName();
if (!Strings.isNullOrEmpty(shardingContext.getShardingParameter())) {
operateName += "-" + shardingContext.getShardingParameter();
}
AbstractSpan span = ContextManager.createLocalSpan(operateName);
span.setComponent(ComponentsDefine.ELASTIC_JOB);
span.tag("sharding_context", shardingContext.toString());
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
ContextManager.stopSpan();
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
ContextManager.activeSpan().errorOccurred().log(t);
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.esjob.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
import static org.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType;
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
/**
* {@link JobExecutorInstrumentation} presents that skywalking intercepts {@link com.dangdang.ddframe.job.executor.AbstractElasticJobExecutor}.
*
* @author gaohongtao
*/
public class JobExecutorInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
private static final String ENHANCE_CLASS = "com.dangdang.ddframe.job.executor.AbstractElasticJobExecutor";
private static final String JOB_EXECUTOR_INTERCEPTOR_CLASS = "org.skywalking.apm.plugin.esjob.JobExecutorInterceptor";
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[0];
}
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[]{
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return takesArgumentWithType(2, "com.dangdang.ddframe.job.event.type.JobExecutionEvent");
}
@Override public String getMethodsInterceptor() {
return JOB_EXECUTOR_INTERCEPTOR_CLASS;
}
@Override public boolean isOverrideArgs() {
return false;
}
}
};
}
@Override protected ClassMatch enhanceClass() {
return byName(ENHANCE_CLASS);
}
}
elastic-job-2.x=org.skywalking.apm.plugin.esjob.define.JobExecutorInstrumentation
\ No newline at end of file
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.esjob;
import com.dangdang.ddframe.job.executor.ShardingContexts;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.modules.junit4.PowerMockRunnerDelegate;
import org.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.test.helper.SegmentHelper;
import org.skywalking.apm.agent.test.tools.AgentServiceRule;
import org.skywalking.apm.agent.test.tools.SegmentStorage;
import org.skywalking.apm.agent.test.tools.SegmentStoragePoint;
import org.skywalking.apm.agent.test.tools.TracingSegmentRunner;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(TracingSegmentRunner.class)
public class JobExecutorInterceptorTest {
@SegmentStoragePoint
private SegmentStorage segmentStorage;
@Rule
public AgentServiceRule serviceRule = new AgentServiceRule();
private JobExecutorInterceptor jobExecutorInterceptor;
@Before
public void setUp() throws SQLException {
jobExecutorInterceptor = new JobExecutorInterceptor();
}
@Test
public void assertSuccess() throws Throwable {
jobExecutorInterceptor.beforeMethod(null, null, new Object[]{mockShardingContext("fooJob", 1), 1}, null, null);
jobExecutorInterceptor.afterMethod(null, null, null, null, null);
TraceSegment segment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(segment);
assertNotNull(spans);
assertThat(spans.size(), is(1));
assertThat(spans.get(0).transform().getOperationName(), is("fooJob-test"));
assertThat(spans.get(0).transform().getComponentId(), is(24));
assertThat(spans.get(0).transform().getTags(0).getKey(), is("sharding_context"));
assertThat(spans.get(0).transform().getTags(0).getValue(), is("ShardingContext(jobName=fooJob, taskId=fooJob1, shardingTotalCount=2, jobParameter=, shardingItem=1, shardingParameter=test)"));
}
@Test
public void assertSuccessWithoutSharding() throws Throwable {
jobExecutorInterceptor.beforeMethod(null, null, new Object[]{mockShardingContext("fooJob", 0), 0}, null, null);
jobExecutorInterceptor.afterMethod(null, null, null, null, null);
TraceSegment segment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(segment);
assertNotNull(spans);
assertThat(spans.size(), is(1));
assertThat(spans.get(0).transform().getOperationName(), is("fooJob"));
assertThat(spans.get(0).transform().getTags(0).getValue(), is("ShardingContext(jobName=fooJob, taskId=fooJob0, shardingTotalCount=1, jobParameter=, shardingItem=0, shardingParameter=null)"));
}
@Test
public void assertError() throws Throwable {
jobExecutorInterceptor.beforeMethod(null, null, new Object[]{mockShardingContext("fooJob", 0), 0}, null, null);
jobExecutorInterceptor.handleMethodException(null, null, null, null, new Exception("fooError"));
jobExecutorInterceptor.afterMethod(null, null, null, null, null);
TraceSegment segment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(segment);
assertNotNull(spans);
assertThat(spans.size(), is(1));
assertThat(spans.get(0).transform().getIsError(), is(true));
assertThat(spans.get(0).transform().getLogs(0).getDataList().size(), is(4));
}
private ShardingContexts mockShardingContext(String jobName, int shardingItem) {
Map<Integer, String> shardingMap = new HashMap<Integer, String>(1);
if (shardingItem >= 1) {
shardingMap.put(shardingItem, "test");
}
return new ShardingContexts(jobName + shardingItem, jobName, shardingItem + 1, "", shardingMap);
}
}
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-grpc-1.x-plugin</artifactId> <artifactId>apm-grpc-1.x-plugin</artifactId>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-httpClient-4.x-plugin</artifactId> <artifactId>apm-httpClient-4.x-plugin</artifactId>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* Project repository: https://github.com/OpenSkywalking/skywalking * Project repository: https://github.com/OpenSkywalking/skywalking
*/ */
package org.skywalking.apm.plugin.jdbc.mysql.define; package org.skywalking.apm.plugin.jdbc.define;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo; import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-jedis-2.x-plugin</artifactId> <artifactId>apm-jedis-2.x-plugin</artifactId>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>jetty-plugins</artifactId> <artifactId>jetty-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>jetty-plugins</artifactId> <artifactId>jetty-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>jetty-plugins</artifactId> <artifactId>jetty-plugins</artifactId>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
...@@ -68,4 +69,4 @@ ...@@ -68,4 +69,4 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-mongodb-3.x-plugin</artifactId> <artifactId>apm-mongodb-3.x-plugin</artifactId>
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -22,7 +22,7 @@ import java.lang.reflect.Method; ...@@ -22,7 +22,7 @@ import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.plugin.jdbc.mysql.define.StatementEnhanceInfos; import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo; import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
/** /**
......
...@@ -22,7 +22,7 @@ import java.lang.reflect.Method; ...@@ -22,7 +22,7 @@ import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.plugin.jdbc.mysql.define.StatementEnhanceInfos; import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo; import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
/** /**
......
...@@ -22,7 +22,7 @@ import java.lang.reflect.Method; ...@@ -22,7 +22,7 @@ import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.plugin.jdbc.mysql.define.StatementEnhanceInfos; import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo; import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
/** /**
......
...@@ -26,7 +26,7 @@ import org.skywalking.apm.agent.core.context.trace.SpanLayer; ...@@ -26,7 +26,7 @@ import org.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.plugin.jdbc.mysql.define.StatementEnhanceInfos; import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo; import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
/** /**
......
...@@ -37,7 +37,7 @@ import org.skywalking.apm.agent.test.tools.SegmentStoragePoint; ...@@ -37,7 +37,7 @@ import org.skywalking.apm.agent.test.tools.SegmentStoragePoint;
import org.skywalking.apm.agent.test.tools.SpanAssert; import org.skywalking.apm.agent.test.tools.SpanAssert;
import org.skywalking.apm.agent.test.tools.TracingSegmentRunner; import org.skywalking.apm.agent.test.tools.TracingSegmentRunner;
import org.skywalking.apm.network.trace.component.ComponentsDefine; import org.skywalking.apm.network.trace.component.ComponentsDefine;
import org.skywalking.apm.plugin.jdbc.mysql.define.StatementEnhanceInfos; import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo; import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.is;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>nutz-plugins</artifactId> <artifactId>nutz-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>nutz-plugins</artifactId> <artifactId>nutz-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>nutz-plugins</artifactId> <artifactId>nutz-plugins</artifactId>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sniffer</artifactId> <artifactId>apm-sniffer</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
<module>h2-1.x-plugin</module> <module>h2-1.x-plugin</module>
<module>postgresql-8.x-plugin</module> <module>postgresql-8.x-plugin</module>
<module>oracle-10.x-plugin</module> <module>oracle-10.x-plugin</module>
<module>rocketMQ-4.x-plugin</module>
<module>elastic-job-2.x-plugin</module>
<module>mongodb-2.x-plugin</module> <module>mongodb-2.x-plugin</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>
...@@ -143,6 +145,7 @@ ...@@ -143,6 +145,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.jdbc.postgresql;
import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
/**
* {@link CreateStatementInterceptor} intercepts the {@link org.postgresql.jdbc.PgConnection#prepareCall} method in
* {@link org.postgresql.jdbc.PgConnection}, {@link org.postgresql.jdbc.PgConnection} or {@link org.postgresql.jdbc3.Jdbc3Connection} class.
*
* @author zhangxin
*/
public class CreateCallableStatementInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
if (ret instanceof EnhancedInstance) {
((EnhancedInstance)ret).setSkyWalkingDynamicField(new StatementEnhanceInfos((ConnectionInfo)objInst.getSkyWalkingDynamicField(), (String)allArguments[0], "CallableStatement"));
}
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.jdbc.postgresql;
import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
/**
* {@link CreatePreparedStatementInterceptor} intercepts the {@link org.postgresql.jdbc.PgConnection#prepareStatement} method in
* {@link org.postgresql.jdbc.PgConnection}, {@link org.postgresql.jdbc.PgConnection} or {@link org.postgresql.jdbc3.Jdbc3Connection} class.
*
* @author zhangxin
*/
public class CreatePreparedStatementInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
if (ret instanceof EnhancedInstance) {
((EnhancedInstance)ret).setSkyWalkingDynamicField(new StatementEnhanceInfos((ConnectionInfo)objInst.getSkyWalkingDynamicField(), (String)allArguments[0], "PreparedStatement"));
}
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.jdbc.postgresql;
import java.lang.reflect.Method;
import org.postgresql.jdbc.PgConnection;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
/**
* {@link CreateStatementInterceptor} intercepts the {@link PgConnection#createStatement} method in
* {@link org.postgresql.jdbc.PgConnection}, {@link org.postgresql.jdbc.PgConnection} or {@link org.postgresql.jdbc3.Jdbc3Connection} class.
*
* @author zhangxin
*/
public class CreateStatementInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
if (ret instanceof EnhancedInstance) {
((EnhancedInstance)ret).setSkyWalkingDynamicField(new StatementEnhanceInfos((ConnectionInfo)objInst.getSkyWalkingDynamicField(), "", "CallableStatement"));
}
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.jdbc.postgresql;
import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos;
import org.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
/**
* {@link StatementExecuteMethodsInterceptor} create the exit span when the client call the interceptor methods.
*
* @author zhangxin
*/
public class StatementExecuteMethodsInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public final void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
ConnectionInfo connectInfo = cacheObject.getConnectionInfo();
AbstractSpan span = ContextManager.createExitSpan(buildOperationName(connectInfo, method.getName(), cacheObject.getStatementName()), connectInfo.getDatabasePeer());
Tags.DB_TYPE.set(span, "sql");
Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName());
Tags.DB_STATEMENT.set(span, cacheObject.getSql());
span.setComponent(connectInfo.getComponent());
SpanLayer.asDB(span);
}
@Override
public final Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes,
Object ret) throws Throwable {
StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
if (cacheObject.getConnectionInfo() != null) {
ContextManager.stopSpan();
}
return ret;
}
@Override public final void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField();
if (cacheObject.getConnectionInfo() != null) {
ContextManager.activeSpan().errorOccurred().log(t);
}
}
private String buildOperationName(ConnectionInfo connectionInfo, String methodName, String statementName) {
return connectionInfo.getDBType() + "/JDBI/" + statementName + "/" + methodName;
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.jdbc.postgresql.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
/**
* {@link AbstractJdbc2StatementInstrumentation} intercept the following methods that the class which extend {@link
* org.postgresql.jdbc2.AbstractJdbc2Statement} by {@link org.skywalking.apm.plugin.jdbc.postgresql.StatementExecuteMethodsInterceptor}. <br/>
* 1. the <code>execute</code> with non parameter
* 2. the <code>execute</code> with one parameter
* 3. the <code>executeBatch</code>
* 4. the <code>executeQuery</code> with non parameter
* 5. the <code>executeQuery</code> with one parameter
* 6. the <code>executeUpdate</code> with non parameter
* 7. the <code>executeUpdate</code> with one parameter
* 8. the <code>addBatch</code> with non parameter
* 9. the <code>addBatch</code> with one parameter
*
* @author zhangxin
*/
public class AbstractJdbc2StatementInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
private static final String ENHANCE_CLASS = "org.postgresql.jdbc2.AbstractJdbc2Statement";
private static final String INTERCEPTOR_CLASS = "org.skywalking.apm.plugin.jdbc.postgresql.StatementExecuteMethodsInterceptor";
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[0];
}
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named("execute").and(takesArguments(0))
.or(named("execute").and(takesArguments(1)))
.or(named("executeBatch"))
.or(named("executeQuery").and(takesArguments(0)))
.or(named("executeQuery").and(takesArguments(1)))
.or(named("executeUpdate").and(takesArguments(0)))
.or(named("executeUpdate").and(takesArguments(1)))
.or(named("addBatch").and(takesArguments(1)))
.or(named("addBatch").and(takesArguments(0)));
}
@Override public String getMethodsInterceptor() {
return INTERCEPTOR_CLASS;
}
@Override public boolean isOverrideArgs() {
return false;
}
}
};
}
@Override protected ClassMatch enhanceClass() {
return byName(ENHANCE_CLASS);
}
}
...@@ -31,15 +31,15 @@ import static org.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMat ...@@ -31,15 +31,15 @@ import static org.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMat
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName; import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
import static org.skywalking.apm.plugin.jdbc.define.Constants.CLOSE_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.CLOSE_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.COMMIT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.COMMIT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.RELEASE_SAVE_POINT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.RELEASE_SAVE_POINT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS; import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.postgresql.define.Constants.CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS;
import static org.skywalking.apm.plugin.jdbc.postgresql.define.Constants.CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS;
import static org.skywalking.apm.plugin.jdbc.postgresql.define.Constants.CREATE_STATEMENT_INTERCEPTOR_CLASS;
/** /**
* {@link ConnectionInstrumentation} intercept the following methods that the class which extend {@link * {@link ConnectionInstrumentation} intercept the following methods that the class which extend {@link
...@@ -74,7 +74,7 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin ...@@ -74,7 +74,7 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
return PREPARE_STATEMENT_INTERCEPT_CLASS; return CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS;
} }
@Override public boolean isOverrideArgs() { @Override public boolean isOverrideArgs() {
...@@ -100,7 +100,7 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin ...@@ -100,7 +100,7 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
return PREPARE_CALL_INTERCEPT_CLASS; return CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS;
} }
@Override public boolean isOverrideArgs() { @Override public boolean isOverrideArgs() {
...@@ -113,7 +113,7 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin ...@@ -113,7 +113,7 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
return CREATE_STATEMENT_INTERCEPT_CLASS; return CREATE_STATEMENT_INTERCEPTOR_CLASS;
} }
@Override public boolean isOverrideArgs() { @Override public boolean isOverrideArgs() {
......
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.jdbc.postgresql.define;
/**
* Interceptor class name constant variable
*
* @author zhangxin
*/
public class Constants {
public static final String CREATE_STATEMENT_INTERCEPTOR_CLASS = "org.skywalking.apm.plugin.jdbc.postgresql.CreateStatementInterceptor";
public static final String CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS = "org.skywalking.apm.plugin.jdbc.postgresql.CreatePreparedStatementInterceptor";
public static final String CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS = "org.skywalking.apm.plugin.jdbc.postgresql.CreateCallableStatementInterceptor";
}
...@@ -30,15 +30,15 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; ...@@ -30,15 +30,15 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName; import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
import static org.skywalking.apm.plugin.jdbc.define.Constants.CLOSE_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.CLOSE_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.COMMIT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.COMMIT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.RELEASE_SAVE_POINT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.RELEASE_SAVE_POINT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS; import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.postgresql.define.Constants.CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS;
import static org.skywalking.apm.plugin.jdbc.postgresql.define.Constants.CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS;
import static org.skywalking.apm.plugin.jdbc.postgresql.define.Constants.CREATE_STATEMENT_INTERCEPTOR_CLASS;
/** /**
* {@link Jdbc3ConnectionInstrumentation} intercept the following methods that the class which extend {@link * {@link Jdbc3ConnectionInstrumentation} intercept the following methods that the class which extend {@link
...@@ -69,7 +69,7 @@ public class Jdbc3ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP ...@@ -69,7 +69,7 @@ public class Jdbc3ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
return PREPARE_STATEMENT_INTERCEPT_CLASS; return CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS;
} }
@Override public boolean isOverrideArgs() { @Override public boolean isOverrideArgs() {
...@@ -82,7 +82,7 @@ public class Jdbc3ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP ...@@ -82,7 +82,7 @@ public class Jdbc3ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
return PREPARE_CALL_INTERCEPT_CLASS; return CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS;
} }
@Override public boolean isOverrideArgs() { @Override public boolean isOverrideArgs() {
...@@ -95,7 +95,7 @@ public class Jdbc3ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP ...@@ -95,7 +95,7 @@ public class Jdbc3ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
return CREATE_STATEMENT_INTERCEPT_CLASS; return CREATE_STATEMENT_INTERCEPTOR_CLASS;
} }
@Override public boolean isOverrideArgs() { @Override public boolean isOverrideArgs() {
...@@ -104,7 +104,8 @@ public class Jdbc3ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP ...@@ -104,7 +104,8 @@ public class Jdbc3ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP
}, },
new InstanceMethodsInterceptPoint() { new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() { @Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(COMMIT_METHOD_NAME).or(named(ROLLBACK_METHOD_NAME)).or(named(CLOSE_METHOD_NAME)).or(named(RELEASE_SAVE_POINT_METHOD_NAME)); return named(COMMIT_METHOD_NAME).or(named(ROLLBACK_METHOD_NAME)).or(named(CLOSE_METHOD_NAME))
.or(named(RELEASE_SAVE_POINT_METHOD_NAME));
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
......
...@@ -32,13 +32,13 @@ import static org.skywalking.apm.plugin.jdbc.define.Constants.CLOSE_METHOD_NAME; ...@@ -32,13 +32,13 @@ import static org.skywalking.apm.plugin.jdbc.define.Constants.CLOSE_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.COMMIT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.COMMIT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_INTERCEPT_CLASS; import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.RELEASE_SAVE_POINT_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.RELEASE_SAVE_POINT_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NAME; import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NAME;
import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS; import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS;
import static org.skywalking.apm.plugin.jdbc.postgresql.define.Constants.CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS;
import static org.skywalking.apm.plugin.jdbc.postgresql.define.Constants.CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS;
/** /**
* {@link Jdbc4ConnectionInstrumentation} intercept the following methods that the class which extend {@link * {@link Jdbc4ConnectionInstrumentation} intercept the following methods that the class which extend {@link
...@@ -69,7 +69,7 @@ public class Jdbc4ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP ...@@ -69,7 +69,7 @@ public class Jdbc4ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
return PREPARE_STATEMENT_INTERCEPT_CLASS; return CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS;
} }
@Override public boolean isOverrideArgs() { @Override public boolean isOverrideArgs() {
...@@ -82,7 +82,7 @@ public class Jdbc4ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP ...@@ -82,7 +82,7 @@ public class Jdbc4ConnectionInstrumentation extends ClassInstanceMethodsEnhanceP
} }
@Override public String getMethodsInterceptor() { @Override public String getMethodsInterceptor() {
return PREPARE_CALL_INTERCEPT_CLASS; return CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS;
} }
@Override public boolean isOverrideArgs() { @Override public boolean isOverrideArgs() {
......
...@@ -2,3 +2,4 @@ postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.DriverInstrument ...@@ -2,3 +2,4 @@ postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.DriverInstrument
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.Jdbc3ConnectionInstrumentation postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.Jdbc3ConnectionInstrumentation
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.Jdbc4ConnectionInstrumentation postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.Jdbc4ConnectionInstrumentation
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.ConnectionInstrumentation postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.ConnectionInstrumentation
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.AbstractJdbc2StatementInstrumentation
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-resin-3.x-plugin</artifactId> <artifactId>apm-resin-3.x-plugin</artifactId>
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-resin-4.x-plugin</artifactId> <artifactId>apm-resin-4.x-plugin</artifactId>
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017, OpenSkywalking Organization All rights reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
~ Project repository: https://github.com/OpenSkywalking/skywalking
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId>
<version>3.2.6-2017</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apm-rocketmq-4.x-plugin</artifactId>
<name>rocketMQ-4.x-plugin</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
<version>4.1.0-incubating</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<!-- 源码插件 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<!-- 发布时自动将源码同时发布的配置 -->
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.lang.reflect.Method;
import java.util.List;
import org.apache.rocketmq.common.message.MessageExt;
import org.skywalking.apm.agent.core.context.CarrierItem;
import org.skywalking.apm.agent.core.context.ContextCarrier;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.network.trace.component.ComponentsDefine;
/**
* {@link AbstractMessageConsumeInterceptor} create entry span when the <code>consumeMessage</code> in the {@link
* org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently} and {@link
* org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly} class.
*
* @author zhangxin
*/
public abstract class AbstractMessageConsumeInterceptor implements InstanceMethodsAroundInterceptor {
public static final String COMSUMER_OPERATION_NAME_PREFIX = "RocketMQ/";
@Override
public final void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
List<MessageExt> msgs = (List<MessageExt>)allArguments[0];
ContextCarrier contextCarrier = getContextCarrierFromMessage(msgs.get(0));
AbstractSpan span = ContextManager.createEntrySpan(COMSUMER_OPERATION_NAME_PREFIX + msgs.get(0).getTopic() + "/Consumer", contextCarrier);
span.setComponent(ComponentsDefine.ROCKET_MQ);
span.setLayer(SpanLayer.MQ);
for (int i = 1; i < msgs.size(); i++) {
ContextManager.extract(getContextCarrierFromMessage(msgs.get(i)));
}
}
@Override public final void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
ContextManager.activeSpan().errorOccurred().log(t);
}
private ContextCarrier getContextCarrierFromMessage(MessageExt message) {
ContextCarrier contextCarrier = new ContextCarrier();
CarrierItem next = contextCarrier.items();
while (next.hasNext()) {
next = next.next();
next.setHeadValue(message.getUserProperty(next.getHeadKey()));
}
return contextCarrier;
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.lang.reflect.Method;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
/**
* {@link MessageConcurrentlyConsumeInterceptor} set the process status after the {@link
* org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently#consumeMessage(java.util.List,
* org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext)} method execute.
*
* @author zhang xin
*/
public class MessageConcurrentlyConsumeInterceptor extends AbstractMessageConsumeInterceptor {
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
ConsumeConcurrentlyStatus status = (ConsumeConcurrentlyStatus)ret;
if (status == ConsumeConcurrentlyStatus.RECONSUME_LATER) {
AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name());
}
ContextManager.stopSpan();
return ret;
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.lang.reflect.Method;
import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
/**
* {@link MessageOrderlyConsumeInterceptor} set the process status after the {@link
* org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly#consumeMessage(java.util.List,
* org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext)} method execute.
*
* @author zhang xin
*/
public class MessageOrderlyConsumeInterceptor extends AbstractMessageConsumeInterceptor {
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
ConsumeOrderlyStatus status = (ConsumeOrderlyStatus)ret;
if (status == ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT) {
AbstractSpan activeSpan = ContextManager.activeSpan();
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, status.name());
}
ContextManager.stopSpan();
return ret;
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.lang.reflect.Method;
import org.apache.rocketmq.client.impl.CommunicationMode;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.protocol.header.SendMessageRequestHeader;
import org.skywalking.apm.agent.core.context.CarrierItem;
import org.skywalking.apm.agent.core.context.ContextCarrier;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.network.trace.component.ComponentsDefine;
import org.skywalking.apm.plugin.rocketMQ.v4.define.SendCallBackEnhanceInfo;
import org.skywalking.apm.util.StringUtil;
import static org.apache.rocketmq.common.message.MessageDecoder.NAME_VALUE_SEPARATOR;
import static org.apache.rocketmq.common.message.MessageDecoder.PROPERTY_SEPARATOR;
/**
* {@link MessageSendInterceptor} create exit span when the method {@link org.apache.rocketmq.client.impl.MQClientAPIImpl#sendMessage(String,
* String, Message, org.apache.rocketmq.common.protocol.header.SendMessageRequestHeader, long,
* org.apache.rocketmq.client.impl.CommunicationMode, org.apache.rocketmq.client.producer.SendCallback,
* org.apache.rocketmq.client.impl.producer.TopicPublishInfo, org.apache.rocketmq.client.impl.factory.MQClientInstance,
* int, org.apache.rocketmq.client.hook.SendMessageContext, org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl)}
* execute.
*
* @author zhang xin
*/
public class MessageSendInterceptor implements InstanceMethodsAroundInterceptor {
public static final String ASYNC_SEND_OPERATION_NAME_PREFIX = "RocketMQ/";
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
Message message = (Message)allArguments[2];
ContextCarrier contextCarrier = new ContextCarrier();
String namingServiceAddress = String.valueOf(objInst.getSkyWalkingDynamicField());
AbstractSpan span = ContextManager.createExitSpan(buildOperationName(message.getTopic()), contextCarrier, namingServiceAddress);
span.setComponent(ComponentsDefine.ROCKET_MQ);
span.setLayer(SpanLayer.MQ);
span.tag("brokerName", (String)allArguments[1]);
span.tag("tags", message.getTags());
span.tag("communication.mode", ((CommunicationMode)allArguments[5]).name());
SendMessageRequestHeader requestHeader = (SendMessageRequestHeader)allArguments[3];
StringBuilder properties = new StringBuilder(requestHeader.getProperties());
CarrierItem next = contextCarrier.items();
while (next.hasNext()) {
next = next.next();
if (!StringUtil.isEmpty(next.getHeadValue())) {
properties.append(next.getHeadKey());
properties.append(NAME_VALUE_SEPARATOR);
properties.append(next.getHeadValue());
properties.append(PROPERTY_SEPARATOR);
}
}
requestHeader.setProperties(properties.toString());
if (allArguments[6] != null) {
((EnhancedInstance)allArguments[6]).setSkyWalkingDynamicField(new SendCallBackEnhanceInfo(message.getTopic(), ContextManager.capture()));
}
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
ContextManager.stopSpan();
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
ContextManager.activeSpan().errorOccurred().log(t);
}
private String buildOperationName(String topicName) {
return ASYNC_SEND_OPERATION_NAME_PREFIX + topicName + "/Producer";
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.network.trace.component.ComponentsDefine;
import org.skywalking.apm.plugin.rocketMQ.v4.define.SendCallBackEnhanceInfo;
/**
* {@link OnExceptionInterceptor} create local span when the method {@link org.apache.rocketmq.client.producer.SendCallback#onException(Throwable)}
* execute.
*
* @author zhang xin
*/
public class OnExceptionInterceptor implements InstanceMethodsAroundInterceptor {
public static final String CALLBACK_OPERATION_NAME_PREFIX = "RocketMQ/";
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
SendCallBackEnhanceInfo enhanceInfo = (SendCallBackEnhanceInfo)objInst.getSkyWalkingDynamicField();
AbstractSpan activeSpan = ContextManager.createLocalSpan(CALLBACK_OPERATION_NAME_PREFIX + enhanceInfo.getTopicId() + "/Producer/Callback");
activeSpan.setComponent(ComponentsDefine.ROCKET_MQ);
activeSpan.errorOccurred().log((Throwable)allArguments[0]);
ContextManager.continued(enhanceInfo.getContextSnapshot());
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
ContextManager.stopSpan();
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
ContextManager.activeSpan().log(t);
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.lang.reflect.Method;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.SendStatus;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.skywalking.apm.network.trace.component.ComponentsDefine;
import org.skywalking.apm.plugin.rocketMQ.v4.define.SendCallBackEnhanceInfo;
/**
* {@link OnSuccessInterceptor} create local span when the method {@link org.apache.rocketmq.client.producer.SendCallback#onSuccess(SendResult)}
* execute.
*
* @author zhang xin
*/
public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor {
public static final String CALLBACK_OPERATION_NAME_PREFIX = "RocketMQ/";
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
SendCallBackEnhanceInfo enhanceInfo = (SendCallBackEnhanceInfo)objInst.getSkyWalkingDynamicField();
AbstractSpan activeSpan = ContextManager.createLocalSpan(CALLBACK_OPERATION_NAME_PREFIX + enhanceInfo.getTopicId() + "/Producer/Callback");
activeSpan.setComponent(ComponentsDefine.ROCKET_MQ);
SendStatus sendStatus = ((SendResult)allArguments[0]).getSendStatus();
if (sendStatus != SendStatus.SEND_OK) {
activeSpan.errorOccurred();
Tags.STATUS_CODE.set(activeSpan, sendStatus.name());
}
ContextManager.continued(enhanceInfo.getContextSnapshot());
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
ContextManager.stopSpan();
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
ContextManager.activeSpan().errorOccurred().log(t);
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
public class UpdateNameServerInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
objInst.setSkyWalkingDynamicField(allArguments[0]);
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static org.skywalking.apm.agent.core.plugin.match.HierarchyMatch.byHierarchyMatch;
/**
* {@link ConsumeMessageConcurrentlyInstrumentation} intercepts the {@link org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently#consumeMessage(java.util.List,
* org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext)} method by using {@link
* org.skywalking.apm.plugin.rocketMQ.v4.MessageConcurrentlyConsumeInterceptor}.
*
* @author zhang xin
*/
public class ConsumeMessageConcurrentlyInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
private static final String ENHANCE_CLASS = "org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently";
private static final String CONSUMER_MESSAGE_METHOD = "consumeMessage";
private static final String INTERCEPTOR_CLASS = "org.apache.rocketmq.common.message.MessageConcurrentlyConsumeInterceptor";
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[0];
}
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(CONSUMER_MESSAGE_METHOD);
}
@Override public String getMethodsInterceptor() {
return INTERCEPTOR_CLASS;
}
@Override public boolean isOverrideArgs() {
return false;
}
}
};
}
@Override protected ClassMatch enhanceClass() {
return byHierarchyMatch(new String[] {ENHANCE_CLASS});
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static org.skywalking.apm.agent.core.plugin.match.HierarchyMatch.byHierarchyMatch;
/**
* {@link ConsumeMessageOrderlyInstrumentation} intercepts the {@link org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly#consumeMessage(java.util.List,
* org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext)} method by using {@link
* org.skywalking.apm.plugin.rocketMQ.v4.MessageConcurrentlyConsumeInterceptor}.
*
* @author zhang xin
*/
public class ConsumeMessageOrderlyInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
private static final String ENHANCE_CLASS = "org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly";
private static final String ENHANCE_METHOD = "consumeMessage";
private static final String INTERCEPTOR_CLASS = "org.apache.rocketmq.common.message.MessageOrderlyConsumeInterceptor";
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[0];
}
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(ENHANCE_METHOD);
}
@Override public String getMethodsInterceptor() {
return INTERCEPTOR_CLASS;
}
@Override public boolean isOverrideArgs() {
return false;
}
}
};
}
@Override protected ClassMatch enhanceClass() {
return byHierarchyMatch(new String[] {ENHANCE_CLASS});
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
/**
* {@link MQClientAPIImplInstrumentation} intercepts the {@link org.apache.rocketmq.client.impl.MQClientAPIImpl#sendMessage(String,
* String, org.apache.rocketmq.common.message.Message, org.apache.rocketmq.common.protocol.header.SendMessageRequestHeader,
* long, org.apache.rocketmq.client.impl.CommunicationMode, org.apache.rocketmq.client.producer.SendCallback,
* org.apache.rocketmq.client.impl.producer.TopicPublishInfo, org.apache.rocketmq.client.impl.factory.MQClientInstance,
* int, org.apache.rocketmq.client.hook.SendMessageContext, org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl)}
* method by using {@link org.skywalking.apm.plugin.rocketMQ.v4.MessageSendInterceptor}.
*
* @author zhang xin
*/
public class MQClientAPIImplInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
private static final String ENHANCE_CLASS = "org.apache.rocketmq.client.impl.MQClientAPIImpl";
private static final String SEND_MESSAGE_METHOD_NAME = "sendMessage";
private static final String ASYNC_METHOD_INTERCEPTOR = "org.skywalking.apm.plugin.rocketMQ.v4.MessageSendInterceptor";
public static final String UPDATE_NAME_SERVER_INTERCEPT_CLASS = "org.skywalking.apm.plugin.rocketMQ.v4.UpdateNameServerInterceptor";
public static final String UPDATE_NAME_SERVER_METHOD_NAME = "updateNameServerAddressList";
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[0];
}
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(SEND_MESSAGE_METHOD_NAME).and(takesArguments(12));
}
@Override public String getMethodsInterceptor() {
return ASYNC_METHOD_INTERCEPTOR;
}
@Override public boolean isOverrideArgs() {
return false;
}
},
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(UPDATE_NAME_SERVER_METHOD_NAME);
}
@Override public String getMethodsInterceptor() {
return UPDATE_NAME_SERVER_INTERCEPT_CLASS;
}
@Override public boolean isOverrideArgs() {
return false;
}
}
};
}
@Override protected ClassMatch enhanceClass() {
return byName(ENHANCE_CLASS);
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4.define;
import org.skywalking.apm.agent.core.context.ContextSnapshot;
/**
* {@link SendCallBackEnhanceInfo} saves the topic Id and {@link ContextSnapshot} instance for trace.
*
* @author zhang xin
*/
public class SendCallBackEnhanceInfo {
private String topicId;
private ContextSnapshot contextSnapshot;
public SendCallBackEnhanceInfo(String topicId, ContextSnapshot contextSnapshot) {
this.topicId = topicId;
this.contextSnapshot = contextSnapshot;
}
public String getTopicId() {
return topicId;
}
public ContextSnapshot getContextSnapshot() {
return contextSnapshot;
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.apache.rocketmq.client.producer.SendResult;
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static org.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType;
import static org.skywalking.apm.agent.core.plugin.match.HierarchyMatch.byHierarchyMatch;
/**
* {@link SendCallbackInstrumentation} intercepts {@link org.apache.rocketmq.client.producer.SendCallback#onSuccess(SendResult)}
* method by using {@link org.skywalking.apm.plugin.rocketMQ.v4.OnSuccessInterceptor} and also intercepts {@link
* org.apache.rocketmq.client.producer.SendCallback#onException(Throwable)} by using {@link
* org.skywalking.apm.plugin.rocketMQ.v4.OnExceptionInterceptor}.
*
* @author zhang xin
*/
public class SendCallbackInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
private static final String ENHANCE_CLASS = "org.apache.rocketmq.client.producer.SendCallback";
private static final String ON_SUCCESS_ENHANCE_METHOD = "onSuccess";
private static final String ON_SUCCESS_INTERCEPTOR = "org.skywalking.apm.plugin.rocketMQ.v4.OnSuccessInterceptor";
private static final String ON_EXCEPTION_METHOD = "onException";
private static final String ON_EXCEPTION_INTERCEPTOR = "org.skywalking.apm.plugin.rocketMQ.v4.OnExceptionInterceptor";
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[0];
}
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(ON_SUCCESS_ENHANCE_METHOD).and(takesArgumentWithType(0, "org.apache.rocketmq.client.producer.SendResult"));
}
@Override public String getMethodsInterceptor() {
return ON_SUCCESS_INTERCEPTOR;
}
@Override public boolean isOverrideArgs() {
return false;
}
},
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(ON_EXCEPTION_METHOD).and(takesArgumentWithType(0, "java.lang.Throwable"));
}
@Override public String getMethodsInterceptor() {
return ON_EXCEPTION_INTERCEPTOR;
}
@Override public boolean isOverrideArgs() {
return false;
}
}
};
}
@Override protected ClassMatch enhanceClass() {
return byHierarchyMatch(new String[] {ENHANCE_CLASS});
}
}
rocketMQ-4.x=org.skywalking.apm.plugin.rocketMQ.v4.define.ConsumeMessageConcurrentlyInstrumentation
rocketMQ-4.x=org.skywalking.apm.plugin.rocketMQ.v4.define.ConsumeMessageOrderlyInstrumentation
rocketMQ-4.x=org.skywalking.apm.plugin.rocketMQ.v4.define.MQClientAPIImplInstrumentation
rocketMQ-4.x=org.skywalking.apm.plugin.rocketMQ.v4.define.SendCallbackInstrumentation
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.util.List;
import org.apache.rocketmq.client.impl.CommunicationMode;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.protocol.header.SendMessageRequestHeader;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.modules.junit4.PowerMockRunnerDelegate;
import org.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
import org.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.test.helper.SegmentHelper;
import org.skywalking.apm.agent.test.tools.AgentServiceRule;
import org.skywalking.apm.agent.test.tools.SegmentStorage;
import org.skywalking.apm.agent.test.tools.SegmentStoragePoint;
import org.skywalking.apm.agent.test.tools.SpanAssert;
import org.skywalking.apm.agent.test.tools.TracingSegmentRunner;
import org.skywalking.apm.network.trace.component.ComponentsDefine;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.powermock.api.mockito.PowerMockito.when;
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(TracingSegmentRunner.class)
public class MessageSendInterceptorTest {
private MessageSendInterceptor messageSendInterceptor;
@SegmentStoragePoint
private SegmentStorage segmentStorage;
@Rule
public AgentServiceRule serviceRule = new AgentServiceRule();
private Object[] arguments;
private Object[] argumentsWithoutCallback;
@Mock
private Message message;
@Mock
private SendMessageRequestHeader messageRequestHeader;
@Mock
private EnhancedInstance callBack;
private EnhancedInstance enhancedInstance;
@Before
public void setUp() {
messageSendInterceptor = new MessageSendInterceptor();
enhancedInstance = new EnhancedInstance() {
@Override public Object getSkyWalkingDynamicField() {
return "127.0.0.1:6543";
}
@Override public void setSkyWalkingDynamicField(Object value) {
}
};
arguments = new Object[] {"127.0.0.1", "test", message, messageRequestHeader, null, CommunicationMode.ASYNC, callBack};
argumentsWithoutCallback = new Object[] {"127.0.0.1", "test", message, messageRequestHeader, null, CommunicationMode.ASYNC, null};
when(messageRequestHeader.getProperties()).thenReturn("");
when(message.getTags()).thenReturn("TagA");
}
@Test
public void testSendMessage() throws Throwable {
messageSendInterceptor.beforeMethod(enhancedInstance, null, arguments, null, null);
messageSendInterceptor.afterMethod(enhancedInstance, null, arguments, null, null);
assertThat(segmentStorage.getTraceSegments().size(), is(1));
TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
assertThat(spans.size(), is(1));
AbstractTracingSpan mqSpan = spans.get(0);
SpanAssert.assertLayer(mqSpan, SpanLayer.MQ);
SpanAssert.assertComponent(mqSpan, ComponentsDefine.ROCKET_MQ);
SpanAssert.assertTag(mqSpan, 0, "test");
SpanAssert.assertTag(mqSpan, 1, "TagA");
verify(messageRequestHeader, times(1)).setProperties(anyString());
verify(callBack, times(1)).setSkyWalkingDynamicField(Matchers.any());
}
@Test
public void testSendMessageWithoutCallBack() throws Throwable {
messageSendInterceptor.beforeMethod(enhancedInstance, null, argumentsWithoutCallback, null, null);
messageSendInterceptor.afterMethod(enhancedInstance, null, argumentsWithoutCallback, null, null);
assertThat(segmentStorage.getTraceSegments().size(), is(1));
TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
assertThat(spans.size(), is(1));
AbstractTracingSpan mqSpan = spans.get(0);
SpanAssert.assertLayer(mqSpan, SpanLayer.MQ);
SpanAssert.assertComponent(mqSpan, ComponentsDefine.ROCKET_MQ);
SpanAssert.assertTag(mqSpan, 0, "test");
SpanAssert.assertTag(mqSpan, 1, "TagA");
verify(messageRequestHeader, times(1)).setProperties(anyString());
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.util.List;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.modules.junit4.PowerMockRunnerDelegate;
import org.skywalking.apm.agent.core.context.ContextSnapshot;
import org.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.test.helper.SegmentHelper;
import org.skywalking.apm.agent.test.helper.SpanHelper;
import org.skywalking.apm.agent.test.tools.AgentServiceRule;
import org.skywalking.apm.agent.test.tools.SegmentStorage;
import org.skywalking.apm.agent.test.tools.SegmentStoragePoint;
import org.skywalking.apm.agent.test.tools.SpanAssert;
import org.skywalking.apm.agent.test.tools.TracingSegmentRunner;
import org.skywalking.apm.plugin.rocketMQ.v4.define.SendCallBackEnhanceInfo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.powermock.api.mockito.PowerMockito.when;
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(TracingSegmentRunner.class)
public class OnExceptionInterceptorTest {
private OnExceptionInterceptor exceptionInterceptor;
@SegmentStoragePoint
private SegmentStorage segmentStorage;
@Rule
public AgentServiceRule serviceRule = new AgentServiceRule();
@Mock
private ContextSnapshot contextSnapshot;
private SendCallBackEnhanceInfo enhanceInfo;
@Mock
private EnhancedInstance enhancedInstance;
@Before
public void setUp() {
exceptionInterceptor = new OnExceptionInterceptor();
enhanceInfo = new SendCallBackEnhanceInfo("test", contextSnapshot);
when(enhancedInstance.getSkyWalkingDynamicField()).thenReturn(enhanceInfo);
}
@Test
public void testOnException() throws Throwable {
exceptionInterceptor.beforeMethod(enhancedInstance, null, new Object[] {new RuntimeException()}, null, null);
exceptionInterceptor.afterMethod(enhancedInstance, null, new Object[] {new RuntimeException()}, null, null);
assertThat(segmentStorage.getTraceSegments().size(), is(1));
TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
assertThat(spans.size(), is(1));
AbstractTracingSpan exceptionSpan = spans.get(0);
SpanAssert.assertException(SpanHelper.getLogs(exceptionSpan).get(0), RuntimeException.class);
SpanAssert.assertOccurException(exceptionSpan, true);
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.rocketMQ.v4;
import java.util.List;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.SendStatus;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.modules.junit4.PowerMockRunnerDelegate;
import org.skywalking.apm.agent.core.context.ContextSnapshot;
import org.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.test.helper.SegmentHelper;
import org.skywalking.apm.agent.test.tools.AgentServiceRule;
import org.skywalking.apm.agent.test.tools.SegmentStorage;
import org.skywalking.apm.agent.test.tools.SegmentStoragePoint;
import org.skywalking.apm.agent.test.tools.SpanAssert;
import org.skywalking.apm.agent.test.tools.TracingSegmentRunner;
import org.skywalking.apm.network.trace.component.ComponentsDefine;
import org.skywalking.apm.plugin.rocketMQ.v4.define.SendCallBackEnhanceInfo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.powermock.api.mockito.PowerMockito.when;
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(TracingSegmentRunner.class)
public class OnSuccessInterceptorTest {
private OnSuccessInterceptor successInterceptor;
@SegmentStoragePoint
private SegmentStorage segmentStorage;
@Rule
public AgentServiceRule serviceRule = new AgentServiceRule();
@Mock
private ContextSnapshot contextSnapshot;
@Mock
private SendResult sendResult;
private SendCallBackEnhanceInfo enhanceInfo;
@Mock
private EnhancedInstance enhancedInstance;
@Before
public void setUp() {
successInterceptor = new OnSuccessInterceptor();
enhanceInfo = new SendCallBackEnhanceInfo("test", contextSnapshot);
when(enhancedInstance.getSkyWalkingDynamicField()).thenReturn(enhanceInfo);
when(sendResult.getSendStatus()).thenReturn(SendStatus.SEND_OK);
}
@Test
public void testOnSuccess() throws Throwable {
successInterceptor.beforeMethod(enhancedInstance, null, new Object[] {sendResult}, null, null);
successInterceptor.afterMethod(enhancedInstance, null, new Object[] {sendResult}, null, null);
assertThat(segmentStorage.getTraceSegments().size(), is(1));
TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
assertThat(spans.size(), is(1));
AbstractTracingSpan successSpan = spans.get(0);
SpanAssert.assertComponent(successSpan, ComponentsDefine.ROCKET_MQ);
}
@Test
public void testOnSuccessWithErrorStatus() throws Throwable {
when(sendResult.getSendStatus()).thenReturn(SendStatus.FLUSH_SLAVE_TIMEOUT);
successInterceptor.beforeMethod(enhancedInstance, null, new Object[] {sendResult}, null, null);
successInterceptor.afterMethod(enhancedInstance, null, new Object[] {sendResult}, null, null);
assertThat(segmentStorage.getTraceSegments().size(), is(1));
TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
assertThat(spans.size(), is(1));
AbstractTracingSpan successSpan = spans.get(0);
SpanAssert.assertComponent(successSpan, ComponentsDefine.ROCKET_MQ);
SpanAssert.assertOccurException(successSpan, true);
}
}
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>spring-plugins</artifactId> <artifactId>spring-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>spring-plugins</artifactId> <artifactId>spring-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>spring-plugins</artifactId> <artifactId>spring-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.spring.mvc.v3;
import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.springframework.web.context.request.NativeWebRequest;
/**
* {@link HandlerMethodInvokerInterceptor} pass the {@link NativeWebRequest} object into the {@link
* org.springframework.stereotype.Controller} object.
*
* @author zhangxin
*/
public class HandlerMethodInvokerInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
Object handler = allArguments[1];
if (handler instanceof EnhancedInstance) {
((EnhanceRequireObjectCache)((EnhancedInstance)handler).getSkyWalkingDynamicField()).setNativeWebRequest((NativeWebRequest)allArguments[2]);
}
}
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Throwable t) {
}
}
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.skywalking.apm.plugin.spring.mvc.v3.define;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
/**
* {@link HandlerMethodInvokerInstrumentation} intercept the <code>invokeHandlerMethod</code> method in the
* <code>org.springframework.web.bind.annotation.support.HandlerMethodInvoker</code> class.
*
* @author zhangxin
*/
public class HandlerMethodInvokerInstrumentation extends AbstractSpring3Instrumentation {
private static final String ENHANCE_CLASS = "org.springframework.web.bind.annotation.support.HandlerMethodInvoker";
private static final String ENHANCE_METHOD = "invokeHandlerMethod";
private static final String INTERCEPTOR_CLASS = "org.skywalking.apm.plugin.spring.mvc.v3.HandlerMethodInvokerInterceptor";
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return new ConstructorInterceptPoint[0];
}
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(ENHANCE_METHOD);
}
@Override public String getMethodsInterceptor() {
return INTERCEPTOR_CLASS;
}
@Override public boolean isOverrideArgs() {
return false;
}
}
};
}
@Override protected ClassMatch enhanceClass() {
return byName(ENHANCE_CLASS);
}
}
spring-mvc-annotation-3.x=org.skywalking.apm.plugin.spring.mvc.v3.define.ControllerInstrumentation spring-mvc-annotation-3.x=org.skywalking.apm.plugin.spring.mvc.v3.define.ControllerInstrumentation
spring-mvc-annotation-3.x=org.skywalking.apm.plugin.spring.mvc.v3.define.HandlerMethodInstrumentation spring-mvc-annotation-3.x=org.skywalking.apm.plugin.spring.mvc.v3.define.HandlerMethodInstrumentation
spring-mvc-annotation-3.x=org.skywalking.apm.plugin.spring.mvc.v3.define.InvocableHandlerInstrumentation spring-mvc-annotation-3.x=org.skywalking.apm.plugin.spring.mvc.v3.define.InvocableHandlerInstrumentation
spring-mvc-annotation-3.x=org.skywalking.apm.plugin.spring.mvc.v3.define.HandlerMethodInvokerInstrumentation
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>spring-plugins</artifactId> <artifactId>spring-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>spring-plugins</artifactId> <artifactId>spring-plugins</artifactId>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>spring-plugins</artifactId> <artifactId>spring-plugins</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>spring-cloud</artifactId> <artifactId>spring-cloud</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>netflix-plugins</artifactId> <artifactId>netflix-plugins</artifactId>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>netflix-plugins</artifactId> <artifactId>netflix-plugins</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-spring-cloud-feign-1.x-plugin</artifactId> <artifactId>apm-spring-cloud-feign-1.x-plugin</artifactId>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>spring-plugins</artifactId> <artifactId>spring-plugins</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>spring-cloud</artifactId> <artifactId>spring-cloud</artifactId>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-spymemcached-2.x-plugin</artifactId> <artifactId>apm-spymemcached-2.x-plugin</artifactId>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sdk-plugin</artifactId> <artifactId>apm-sdk-plugin</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-xmemcached-2.x-plugin</artifactId> <artifactId>apm-xmemcached-2.x-plugin</artifactId>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm-sniffer</artifactId> <artifactId>apm-sniffer</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<artifactId>apm-test-tools</artifactId> <artifactId>apm-test-tools</artifactId>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-toolkit-activation</artifactId> <artifactId>apm-toolkit-activation</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-toolkit-activation</artifactId> <artifactId>apm-toolkit-activation</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-toolkit-activation</artifactId> <artifactId>apm-toolkit-activation</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-toolkit-activation</artifactId> <artifactId>apm-toolkit-activation</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-toolkit-activation</artifactId> <artifactId>apm-toolkit-activation</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm-sniffer</artifactId> <artifactId>apm-sniffer</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging> <packaging>pom</packaging>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>apm</artifactId> <artifactId>apm</artifactId>
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
version: '2.1' version: '2.1'
services: services:
skywalking-webui: skywalking-webui:
image: skywalking/skywalking-ui:3.3.0-2017 image: skywalking/skywalking-ui:3.2.6-2017
expose: expose:
- "8080" - "8080"
ports: ports:
...@@ -15,7 +15,7 @@ services: ...@@ -15,7 +15,7 @@ services:
- COLLECTOR_SERVERS=skywalking-collector:10800 - COLLECTOR_SERVERS=skywalking-collector:10800
skywalking-collector: skywalking-collector:
image: skywalking/skywalking-collector:3.3.0-2017 image: skywalking/skywalking-collector:3.2.6-2017
expose: expose:
- "10800" - "10800"
- "11800" - "11800"
......
...@@ -19,13 +19,15 @@ ...@@ -19,13 +19,15 @@
* Mysql Driver 5.x, 6.x * Mysql Driver 5.x, 6.x
* Oracle Driver * Oracle Driver
* H2 Driver * H2 Driver
* [Sharding-JDBC 1.5.x](https://github.com/shardingjdbc/sharding-jdbc) * [Sharding-JDBC](https://github.com/shardingjdbc/sharding-jdbc) 1.5.x
* PostgreSQL Driver 8.x, 9.x, 42.x * PostgreSQL Driver 8.x, 9.x, 42.x
* RPC Frameworks * RPC Frameworks
* [Dubbo](https://github.com/alibaba/dubbo) 2.5.3 * [Dubbo](https://github.com/alibaba/dubbo) 2.5.3
* [Dubbox](https://github.com/dangdangdotcom/dubbox) 2.8.4 * [Dubbox](https://github.com/dangdangdotcom/dubbox) 2.8.4
* [Motan](https://github.com/weibocom/motan) 0.2 * [Motan](https://github.com/weibocom/motan) 0.2
* [gRPC](https://github.com/grpc/grpc-java) 1.6+ * [gRPC](https://github.com/grpc/grpc-java) 1.6+
* MQ
* [RocketMQ](https://github.com/apache/rocketmq) 4.x
* NoSQL * NoSQL
* Redis * Redis
* [Jedis](https://github.com/xetorthio/jedis) 2.8 * [Jedis](https://github.com/xetorthio/jedis) 2.8
...@@ -37,6 +39,8 @@ ...@@ -37,6 +39,8 @@
* [Netflix Eureka](https://github.com/Netflix/eureka) * [Netflix Eureka](https://github.com/Netflix/eureka)
* Spring Ecosystem * Spring Ecosystem
* Spring Core Async SuccessCallback/FailureCallback/ListenableFutureCallback 4.x * Spring Core Async SuccessCallback/FailureCallback/ListenableFutureCallback 4.x
* Scheduler
* [Elastic Job](https://github.com/elasticjob/elastic-job) 2.x
* OpenTracing community supported * OpenTracing community supported
* Motan * Motan
* Hprose-java * Hprose-java
theme: jekyll-theme-midnight
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<groupId>org.skywalking</groupId> <groupId>org.skywalking</groupId>
<artifactId>apm</artifactId> <artifactId>apm</artifactId>
<version>3.3.0-2017</version> <version>3.2.6-2017</version>
<developers> <developers>
<developer> <developer>
...@@ -252,6 +252,7 @@ ...@@ -252,6 +252,7 @@
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<phase>none</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册