Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
cf93d1ee
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cf93d1ee
编写于
12月 31, 2015
作者:
Z
zhangxin10
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.添加httpClient4.3的插件
2. 修改工程名字
上级
5c51f5af
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
231 addition
and
4 deletion
+231
-4
skywalking-sdk-plugin/dubbo-plugin/pom.xml
skywalking-sdk-plugin/dubbo-plugin/pom.xml
+1
-1
skywalking-sdk-plugin/httpclient-4.3.x-plugin/pom.xml
skywalking-sdk-plugin/httpclient-4.3.x-plugin/pom.xml
+38
-0
skywalking-sdk-plugin/httpclient-4.3.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/httpclient/v43x/HttpClientTracing.java
.../skywalking/plugin/httpclient/v43x/HttpClientTracing.java
+40
-0
skywalking-sdk-plugin/httpclient-4.3.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/httpclient/v43x/SWTracingCloseableHttpClient.java
.../plugin/httpclient/v43x/SWTracingCloseableHttpClient.java
+139
-0
skywalking-sdk-plugin/jdbc-plugin/pom.xml
skywalking-sdk-plugin/jdbc-plugin/pom.xml
+1
-1
skywalking-sdk-plugin/pom.xml
skywalking-sdk-plugin/pom.xml
+11
-1
skywalking-sdk-plugin/web-plugin/pom.xml
skywalking-sdk-plugin/web-plugin/pom.xml
+1
-1
未找到文件。
skywalking-sdk-plugin/dubbo-plugin/pom.xml
浏览文件 @
cf93d1ee
...
...
@@ -10,7 +10,7 @@
<artifactId>
skywalking-dubbo-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
spring
-plugin
</name>
<name>
dubbo
-plugin
</name>
<url>
http://maven.apache.org
</url>
<properties>
...
...
skywalking-sdk-plugin/httpclient-plugin/pom.xml
→
skywalking-sdk-plugin/httpclient-
4.3.x-
plugin/pom.xml
浏览文件 @
cf93d1ee
...
...
@@ -7,10 +7,10 @@
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
skywalking-http
Client
-plugin
</artifactId>
<artifactId>
skywalking-http
client-4.3.x
-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
http
Client
-plugin
</name>
<name>
http
client-4.3.x
-plugin
</name>
<url>
http://maven.apache.org
</url>
<properties>
...
...
@@ -18,38 +18,21 @@
</properties>
<dependencies>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
3.8.1
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-api
</artifactId>
<version>
${project.version}
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.2.1
</version>
<scope>
compile
</scope>
<version>
4.3
</version>
</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>
skywalking-sdk-plugin/httpclient-4.3.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/httpclient/v43x/HttpClientTracing.java
0 → 100644
浏览文件 @
cf93d1ee
package
com.ai.cloud.skywalking.plugin.httpclient.v43x
;
import
com.ai.cloud.skywalking.buriedpoint.RPCBuriedPointSender
;
import
com.ai.cloud.skywalking.conf.AuthDesc
;
import
com.ai.cloud.skywalking.model.Identification
;
import
org.apache.http.HttpRequest
;
import
java.io.IOException
;
public
class
HttpClientTracing
{
private
static
RPCBuriedPointSender
sender
=
new
RPCBuriedPointSender
();
public
static
<
R
>
R
execute
(
String
url
,
String
traceHearName
,
HttpRequest
httpRequest
,
Executor
<
R
>
executor
)
throws
IOException
{
if
(!
AuthDesc
.
isAuth
())
{
return
executor
.
execute
();
}
try
{
httpRequest
.
setHeader
(
traceHearName
,
"ContextData="
+
sender
.
beforeSend
(
Identification
.
newBuilder
()
.
viewPoint
(
url
)
.
spanType
(
"W"
)
.
build
())
.
toString
());
return
executor
.
execute
();
}
catch
(
IOException
e
)
{
sender
.
handleException
(
e
);
throw
e
;
}
finally
{
sender
.
afterSend
();
}
}
public
interface
Executor
<
R
>
{
R
execute
()
throws
IOException
;
}
}
skywalking-sdk-plugin/httpclient-4.3.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/httpclient/v43x/SWTracingCloseableHttpClient.java
0 → 100644
浏览文件 @
cf93d1ee
package
com.ai.cloud.skywalking.plugin.httpclient.v43x
;
import
org.apache.http.HttpHost
;
import
org.apache.http.HttpRequest
;
import
org.apache.http.client.ClientProtocolException
;
import
org.apache.http.client.ResponseHandler
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpUriRequest
;
import
org.apache.http.conn.ClientConnectionManager
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.params.HttpParams
;
import
org.apache.http.protocol.HttpContext
;
import
java.io.IOException
;
public
class
SWTracingCloseableHttpClient
extends
CloseableHttpClient
{
private
static
final
String
DEFAULT_TRACE_NAME
=
"SkyWalking-TRACING-NAME"
;
private
CloseableHttpClient
client
;
private
String
traceHeaderName
;
public
SWTracingCloseableHttpClient
(
CloseableHttpClient
client
,
String
traceHeaderName
)
{
this
.
client
=
client
;
if
(
traceHeaderName
==
null
||
traceHeaderName
.
length
()
<=
0
)
{
throw
new
IllegalArgumentException
(
"Trace header name can not be null"
);
}
this
.
traceHeaderName
=
traceHeaderName
;
}
public
SWTracingCloseableHttpClient
(
CloseableHttpClient
client
)
{
this
.
client
=
client
;
this
.
traceHeaderName
=
DEFAULT_TRACE_NAME
;
}
@Override
public
void
close
()
throws
IOException
{
client
.
close
();
}
@Override
public
HttpParams
getParams
()
{
return
client
.
getParams
();
}
@Override
public
ClientConnectionManager
getConnectionManager
()
{
return
client
.
getConnectionManager
();
}
@Override
public
CloseableHttpResponse
execute
(
final
HttpUriRequest
request
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
request
.
getURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
CloseableHttpResponse
>()
{
@Override
public
CloseableHttpResponse
execute
()
throws
IOException
{
return
client
.
execute
(
request
);
}
});
}
@Override
public
CloseableHttpResponse
execute
(
final
HttpUriRequest
request
,
final
HttpContext
context
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
request
.
getURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
CloseableHttpResponse
>()
{
@Override
public
CloseableHttpResponse
execute
()
throws
IOException
{
return
client
.
execute
(
request
,
context
);
}
});
}
@Override
public
CloseableHttpResponse
execute
(
final
HttpHost
target
,
final
HttpRequest
request
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
target
.
toURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
CloseableHttpResponse
>()
{
@Override
public
CloseableHttpResponse
execute
()
throws
IOException
{
return
client
.
execute
(
target
,
request
);
}
});
}
@Override
protected
CloseableHttpResponse
doExecute
(
final
HttpHost
target
,
final
HttpRequest
request
,
final
HttpContext
context
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
target
.
toURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
CloseableHttpResponse
>()
{
@Override
public
CloseableHttpResponse
execute
()
throws
IOException
{
return
client
.
execute
(
target
,
request
,
context
);
}
});
}
@Override
public
CloseableHttpResponse
execute
(
final
HttpHost
target
,
final
HttpRequest
request
,
final
HttpContext
context
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
target
.
toURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
CloseableHttpResponse
>()
{
@Override
public
CloseableHttpResponse
execute
()
throws
IOException
{
return
client
.
execute
(
target
,
request
,
context
);
}
});
}
@Override
public
<
T
>
T
execute
(
final
HttpUriRequest
request
,
final
ResponseHandler
<?
extends
T
>
responseHandler
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
request
.
getURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
T
>()
{
@Override
public
T
execute
()
throws
IOException
{
return
client
.
execute
(
request
,
responseHandler
);
}
});
}
@Override
public
<
T
>
T
execute
(
final
HttpUriRequest
request
,
final
ResponseHandler
<?
extends
T
>
responseHandler
,
final
HttpContext
context
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
request
.
getURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
T
>()
{
@Override
public
T
execute
()
throws
IOException
{
return
client
.
execute
(
request
,
responseHandler
,
context
);
}
});
}
@Override
public
<
T
>
T
execute
(
final
HttpHost
target
,
final
HttpRequest
request
,
final
ResponseHandler
<?
extends
T
>
responseHandler
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
target
.
toURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
T
>()
{
@Override
public
T
execute
()
throws
IOException
{
return
client
.
execute
(
target
,
request
,
responseHandler
);
}
});
}
@Override
public
<
T
>
T
execute
(
final
HttpHost
target
,
final
HttpRequest
request
,
final
ResponseHandler
<?
extends
T
>
responseHandler
,
final
HttpContext
context
)
throws
IOException
,
ClientProtocolException
{
return
HttpClientTracing
.
execute
(
target
.
toURI
().
toString
(),
traceHeaderName
,
request
,
new
HttpClientTracing
.
Executor
<
T
>()
{
@Override
public
T
execute
()
throws
IOException
{
return
client
.
execute
(
target
,
request
,
responseHandler
,
context
);
}
});
}
}
skywalking-sdk-plugin/jdbc-plugin/pom.xml
浏览文件 @
cf93d1ee
...
...
@@ -10,7 +10,7 @@
<artifactId>
skywalking-jdbc-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
spring
-plugin
</name>
<name>
jdbc
-plugin
</name>
<url>
http://maven.apache.org
</url>
<properties>
...
...
skywalking-sdk-plugin/pom.xml
浏览文件 @
cf93d1ee
...
...
@@ -10,7 +10,8 @@
<module>
spring-plugin
</module>
<module>
jdbc-plugin
</module>
<module>
web-plugin
</module>
<module>
httpclient-plugin
</module>
<module>
httpclient-4.2.x-plugin
</module>
<module>
httpclient-4.3.x-plugin
</module>
</modules>
<packaging>
pom
</packaging>
...
...
@@ -50,4 +51,13 @@
</plugin>
</plugins>
</build>
<!--发布-->
<distributionManagement>
<snapshotRepository>
<id>
company-private-nexus-library-snapshots
</id>
<name>
company-private-nexus-library-snapshots
</name>
<url>
http://10.1.228.199:18081/nexus/content/repositories/snapshots/
</url>
</snapshotRepository>
</distributionManagement>
</project>
skywalking-sdk-plugin/web-plugin/pom.xml
浏览文件 @
cf93d1ee
...
...
@@ -10,7 +10,7 @@
<artifactId>
skywalking-web-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
spring
-plugin
</name>
<name>
web
-plugin
</name>
<url>
http://maven.apache.org
</url>
<properties>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录