skywalking-java/skywalking-sdk-plugin/httpclient-4.3.x-plugin/README.md

20 lines
780 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## httpclient 4.3.x
- 引入所需插件
```xml
<!-- httpClient插件监控httpClient 4.3的调用 -->
<dependency>
<groupId>com.ai.cloud</groupId>
<artifactId>skywalking-httpClient-4.3.x-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
```
- 使用SWTracingCloseableHttpClient封装所需的httpClient此httpClient所有调用都会被监控
```java
CloseableHttpClient httpclient = new SWTracingCloseableHttpClient(closeableHttpClient);
```
- 上下文将被存储在http request head默认名称和SkyWalkingFilter保持一致。
- 如果服务端使用dubbox 2.8.4 的提供的http-rest请使用方法重载
```java
CloseableHttpClient httpclient = new SWTracingCloseableHttpClient(closeableHttpClient, "Dubbo-Attachments");
```