skywalking-java/docs/en/setup/service-agent/java-agent
吴晟 Wu Sheng fc79937619
Doc polish, remove unrelated documents and fix source code LICENSE (#5)
2021-08-27 10:08:36 +08:00
..
agent-optional-plugins Replace the URL width https (#6392) 2021-02-18 09:52:18 +08:00
Application-toolkit-log4j-1.x.md Support print SkyWalking context to logs (#6795) 2021-04-23 09:55:14 +08:00
Application-toolkit-log4j-2.x.md Support print SkyWalking context to logs (#6795) 2021-04-23 09:55:14 +08:00
Application-toolkit-logback-1.x.md Support print SkyWalking context to logs (#6795) 2021-04-23 09:55:14 +08:00
Application-toolkit-meter.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
Application-toolkit-micrometer.md Provide agent-side meter api (#4816) 2020-06-22 14:07:34 +08:00
Application-toolkit-trace-cross-thread.md add SupplierWrapper to support java 1.8+ CompletableFuture.supplyAsync #3779 (#3783) 2019-11-06 19:32:16 +08:00
Application-toolkit-trace.md export the segmentId and spanId in toolkit (#6213) 2021-01-16 09:04:01 +08:00
Customize-enhance-trace.md Update all "incubator-skywalking" to "skywalking" ,"incubator-servicecomb-java-chassis" to "servicecomb-java-chassis" correctly, and ".gitmodules" will update at #2531 (#2548) 2019-04-28 15:47:14 +08:00
How-to-disable-plugin.md Finish the new document structure. 2018-07-08 21:04:50 -07:00
How-to-tolerate-exceptions.md exception-ignore-plugin (#5426) 2020-09-09 15:07:01 +08:00
Java-Plugin-Development-Guide.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
Namespace.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
Opentracing.md Finish the new document structure. 2018-07-08 21:04:50 -07:00
Plugin-list.md Upgrade agent plugin for ElasticJob 3.0.0 GA version (#7345) 2021-07-22 15:30:00 +08:00
Plugin-test.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
README.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
Setting-override.md feat:Active System.env Config In Both Collector And agent.config. (#1957) 2018-11-26 00:12:01 +08:00
Specified-agent-config.md Add the function of the specified agent config 2018-08-25 21:41:42 +08:00
Supported-list.md Upgrade agent plugin for ElasticJob 3.0.0 GA version (#7345) 2021-07-22 15:30:00 +08:00
TLS.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
Token-auth.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
advanced-features.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
advanced-reporters.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
configuration-discovery.md Support config `agent.span_limit_per_segment` can be changed in the runtime. (#6482) 2021-03-05 15:22:02 +08:00
configurations.md Doc polish, remove unrelated documents and fix source code LICENSE (#5) 2021-08-27 10:08:36 +08:00
containerization.md Add Docker image doc (#6780) 2021-04-19 08:09:50 +08:00
logic-endpoint.md Separate agent docs to avoid long single page. (#7537) 2021-08-23 20:10:01 +08:00

README.md

Setup java agent

  1. Agent is available for JDK 8 - 14.
  2. Find agent folder in SkyWalking release package
  3. Set agent.service_name in config/agent.config. Could be any String in English.
  4. Set collector.backend_service in config/agent.config. Default point to 127.0.0.1:11800, only works for local backend.
  5. Add -javaagent:/path/to/skywalking-package/agent/skywalking-agent.jar to JVM argument. And make sure to add it before the -jar argument.

The agent release dist is included in Apache official release. New agent package looks like this.

+-- agent
    +-- activations
         apm-toolkit-log4j-1.x-activation.jar
         apm-toolkit-log4j-2.x-activation.jar
         apm-toolkit-logback-1.x-activation.jar
         ...
    +-- config
         agent.config  
    +-- plugins
         apm-dubbo-plugin.jar
         apm-feign-default-http-9.x.jar
         apm-httpClient-4.x-plugin.jar
         .....
    +-- optional-plugins
         apm-gson-2.x-plugin.jar
         .....
    +-- bootstrap-plugins
         jdk-http-plugin.jar
         .....
    +-- logs
    skywalking-agent.jar
  • Start your application.

Install javaagent FAQs

  • Linux Tomcat 7, Tomcat 8, Tomcat 9
    Change the first line of tomcat/bin/catalina.sh.
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/skywalking-agent/skywalking-agent.jar"; export CATALINA_OPTS
  • Windows Tomcat 7, Tomcat 8, Tomcat 9
    Change the first line of tomcat/bin/catalina.bat.
set "CATALINA_OPTS=-javaagent:/path/to/skywalking-agent/skywalking-agent.jar"
  • JAR file
    Add -javaagent argument to command line in which you start your app. eg:
java -javaagent:/path/to/skywalking-agent/skywalking-agent.jar -jar yourApp.jar
  • Jetty
    Modify jetty.sh, add -javaagent argument to command line in which you start your app. eg:
export JAVA_OPTIONS="${JAVA_OPTIONS} -javaagent:/path/to/skywalking-agent/skywalking-agent.jar"

Plugins

Supported middleware, framework and library

SkyWalking agent has supported various middlewares, frameworks and libraries. Read supported list to get them and supported version. If the plugin is in Optional² catalog, go to optional plugins section to learn how to active it.

  • All plugins are in /plugins folder. The plugin jar is active when it is in there. Remove the plugin jar, it disabled.
  • The default logging output folder is /logs.

Optional Plugins

Java agent plugins are all pluggable. Optional plugins could be provided in optional-plugins folder under agent or 3rd party repositories. For using these plugins, you need to put the target plugin jar file into /plugins.

Now, we have the following known optional plugins.

  • Plugin of tracing Spring annotation beans
  • Plugin of tracing Oracle and Resin
  • Filter traces through specified endpoint name patterns
  • Plugin of Gson serialization lib in optional plugin folder.
  • Plugin of Zookeeper 3.4.x in optional plugin folder. The reason of being optional plugin is, many business irrelevant traces are generated, which cause extra payload to agents and backends. At the same time, those traces may be just heartbeat(s).
  • Customize enhance Trace methods based on description files, rather than write plugin or change source codes.
  • Plugin of Spring Cloud Gateway 2.1.x in optional plugin folder. Please only active this plugin when you install agent in Spring Gateway. spring-cloud-gateway-2.x-plugin and spring-webflux-5.x-plugin are both required.
  • Plugin of Spring Transaction in optional plugin folder. The reason of being optional plugin is, many local span are generated, which also spend more CPU, memory and network.
  • Plugin of Kotlin coroutine provides the tracing across coroutines automatically. As it will add local spans to all across routines scenarios, Please assess the performance impact.
  • Plugin of quartz-scheduler-2.x in the optional plugin folder. The reason for being an optional plugin is, many task scheduling systems are based on quartz-scheduler, this will cause duplicate tracing and link different sub-tasks as they share the same quartz level trigger, such as ElasticJob.
  • Plugin of spring-webflux-5.x in the optional plugin folder. Please only activate this plugin when you use webflux alone as a web container. If you are using SpringMVC 5 or Spring Gateway, you don't need this plugin.
  • Plugin of mybatis-3.x in optional plugin folder. The reason of being optional plugin is, many local span are generated, which also spend more CPU, memory and network.
  • Plugin of sentinel-1.x in the optional plugin folder. The reason for being an optional plugin is, the sentinel plugin generates a large number of local spans, which have a potential performance impact.
  • Plugin of ehcache-2.x in the optional plugin folder. The reason for being an optional plugin is, this plugin enhanced cache framework, generates large number of local spans, which have a potential performance impact.
  • Plugin of guava-cache in the optional plugin folder. The reason for being an optional plugin is, this plugin enhanced cache framework, generates large number of local spans, which have a potential performance impact.

Bootstrap class plugins

All bootstrap plugins are optional, due to unexpected risk. Bootstrap plugins are provided in bootstrap-plugins folder. For using these plugins, you need to put the target plugin jar file into /plugins.

Now, we have the following known bootstrap plugins.

  • Plugin of JDK HttpURLConnection. Agent is compatible with JDK 1.6+
  • Plugin of JDK Callable and Runnable. Agent is compatible with JDK 1.6+

Plugin Development Guide

SkyWalking java agent supports plugin to extend the supported list. Please follow our Plugin Development Guide.