Skip to content

Commit

Permalink
Merge branch 'master' into fix/support-postgresql-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-sheng committed Dec 2, 2017
2 parents 75d8dc6 + 07f8257 commit cef99e8
Show file tree
Hide file tree
Showing 24 changed files with 143 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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.

# 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"/>

- Trace query.
Expand Down
4 changes: 2 additions & 2 deletions README_ZH.md
Expand Up @@ -19,7 +19,7 @@ Sky Walking | [English](README.md)
* 使用 [**@Trace**](docs/cn/Application-toolkit-trace-CN.md) 标注追踪业务方法
* 将 traceId 集成到 log4j, log4j2 或 logback这些日志组件中
* 纯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)
* 中文QQ群:392443393

Expand All @@ -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.

# 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"/>

- 调用链查询
Expand Down
1 change: 1 addition & 0 deletions apm-application-toolkit/apm-toolkit-log4j-1.x/pom.xml
Expand Up @@ -49,6 +49,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml
Expand Up @@ -49,6 +49,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-application-toolkit/apm-toolkit-logback-1.x/pom.xml
Expand Up @@ -49,6 +49,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-application-toolkit/apm-toolkit-trace/pom.xml
Expand Up @@ -41,6 +41,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
Expand Up @@ -103,10 +103,12 @@ private void makeSequence() throws CycleDependencyException {
if (isAllRequiredModuleStarted) {
startupSequence.add(provider);
allProviders.remove(i);
i--;
}
} else {
startupSequence.add(provider);
allProviders.remove(i);
i--;
}
}

Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/dubbo-plugin/pom.xml
Expand Up @@ -148,6 +148,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/h2-1.x-plugin/pom.xml
Expand Up @@ -64,6 +64,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/jdbc-commons/pom.xml
Expand Up @@ -58,6 +58,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/pom.xml
Expand Up @@ -60,6 +60,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/pom.xml
Expand Up @@ -54,6 +54,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/mysql-5.x-plugin/pom.xml
Expand Up @@ -70,6 +70,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/pom.xml
Expand Up @@ -64,6 +64,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/pom.xml
Expand Up @@ -143,6 +143,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/pom.xml
Expand Up @@ -64,6 +64,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/pom.xml
Expand Up @@ -63,6 +63,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/pom.xml
Expand Up @@ -63,6 +63,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
Expand Up @@ -66,6 +66,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
@@ -0,0 +1,53 @@
/*
* 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) {

}
}
@@ -0,0 +1,66 @@
/*
* 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);
}
}
@@ -1,3 +1,4 @@
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.InvocableHandlerInstrumentation
spring-mvc-annotation-3.x=org.skywalking.apm.plugin.spring.mvc.v3.define.HandlerMethodInvokerInstrumentation
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/pom.xml
Expand Up @@ -65,6 +65,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -252,6 +252,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
Expand Down

0 comments on commit cef99e8

Please sign in to comment.