skywalking-java/skywalking-sdk-plugin/web-plugin/README.md

28 lines
940 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.

# 如何追踪web应用服务器访问
- 引入所需插件
```xml
<!-- web监控web调用 -->
<dependency>
<groupId>com.ai.cloud</groupId>
<artifactId>skywalking-web-plugin</artifactId>
<version>{latest_version}</version>
</dependency>
```
- 服务端使用Filter追踪web请求
```xml
<filter>
<filter-name>tracingFilter</filter-name>
<filter-class>com.ai.cloud.skywalking.plugin.web.SkyWalkingFilter</filter-class>
<init-param>
<param-name>tracing-name</param-name>
<!--分布式埋点信息默认放在request的header中key=SkyWalking-TRACING-NAME,可根据需要修改-->
<param-value>SkyWalking-TRACING-NAME</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>tracingFilter</filter-name>
<!--追踪路径应为MVC的请求路径不建议包括js/css/图片等资源路径-->
<url-pattern>/request-uri</url-pattern>
</filter-mapping>
```