* SWAuxiliaryTypeNamingStrategy
Auxiliary type name pattern: <origin_class_name>$<name_trait>$auxiliary$<auxiliary_type_instance_hash>
* DelegateNamingResolver
Interceptor delegate field name pattern: <name_trait>$delegate$<class_name_hash>$<plugin_define_hash>$<intercept_point_hash>
* SWMethodNameTransformer
Renamed origin method pattern: <name_trait>$original$<method_name>$<method_description_hash>
* SWImplementationContextFactory
Method cache value field pattern: cachedValue$<name_trait>$<origin_class_name_hash>$<field_value_hash>
Accessor method name pattern: <renamed_origin_method>$accessor$<name_trait>$<origin_class_name_hash>
Here is an example of manipulated enhanced class with new naming policies of auxiliary classes, fields, and methods
```java
import sample.mybatis.controller.HotelController$sw$auxiliary$19cja42;
import sample.mybatis.controller.HotelController$sw$auxiliary$p257su0;
import sample.mybatis.domain.Hotel;
import sample.mybatis.service.HotelService;
@RequestMapping(value={"/hotel"})
@RestController
public class HotelController
implements EnhancedInstance {
@Autowired
@Lazy
private HotelService hotelService;
private volatile Object _$EnhancedClassField_ws;
// Interceptor delegate fields
public static volatile /* synthetic */ InstMethodsInter sw$delegate$td03673$ain2do0$8im5jm1;
public static volatile /* synthetic */ InstMethodsInter sw$delegate$td03673$ain2do0$edkmf61;
public static volatile /* synthetic */ ConstructorInter sw$delegate$td03673$ain2do0$qs9unv1;
public static volatile /* synthetic */ InstMethodsInter sw$delegate$td03673$fl4lnk1$m3ia3a2;
public static volatile /* synthetic */ InstMethodsInter sw$delegate$td03673$fl4lnk1$sufrvp1;
public static volatile /* synthetic */ ConstructorInter sw$delegate$td03673$fl4lnk1$cteu7s1;
// Origin method cache value field
private static final /* synthetic */ Method cachedValue$sw$td03673$g5sobj1;
public HotelController() {
this(null);
sw$delegate$td03673$ain2do0$qs9unv1.intercept(this, new Object[0]);
}
private /* synthetic */ HotelController(sw.auxiliary.p257su0 p257su02) {
}
@GetMapping(value={"city/{cityId}"})
public Hotel selectByCityId(@PathVariable(value="cityId") int n) {
// call interceptor with auxiliary type and parameters and origin method object
return (Hotel)sw$delegate$td03673$ain2do0$8im5jm1.intercept(this, new Object[]{n}, new HotelController$sw$auxiliary$19cja42(this, n), cachedValue$sw$td03673$g5sobj1);
}
// Renamed origin method
private /* synthetic */ Hotel sw$origin$selectByCityId$a8458p3(int cityId) {
/*22*/ return this.hotelService.selectByCityId(cityId);
}
// Accessor of renamed origin method, calling from auxiliary type
final /* synthetic */ Hotel sw$origin$selectByCityId$a8458p3$accessor$sw$td03673(int n) {
// Calling renamed origin method
return this.sw$origin$selectByCityId$a8458p3(n);
}
@Override
public Object getSkyWalkingDynamicField() {
return this._$EnhancedClassField_ws;
}
@Override
public void setSkyWalkingDynamicField(Object object) {
this._$EnhancedClassField_ws = object;
}
static {
ClassLoader.getSystemClassLoader().loadClass("org.apache.skywalking.apm.dependencies.net.bytebuddy.dynamic.Nexus").getMethod("initialize", Class.class, Integer.TYPE).invoke(null, HotelController.class, -1072476370);
// Method object
cachedValue$sw$td03673$g5sobj1 = HotelController.class.getMethod("selectByCityId", Integer.TYPE);
}
}
```
Auxiliary type of Constructor :
```java
class HotelController$sw$auxiliary$p257su0 {
}
```
Auxiliary type of `selectByCityId` method:
```java
class HotelController$sw$auxiliary$19cja42
implements Runnable,
Callable {
private HotelController argument0;
private int argument1;
public Object call() throws Exception {
return this.argument0.sw$origin$selectByCityId$a8458p3$accessor$sw$td03673(this.argument1);
}
@Override
public void run() {
this.argument0.sw$origin$selectByCityId$a8458p3$accessor$sw$td03673(this.argument1);
}
HotelController$sw$auxiliary$19cja42(HotelController hotelController, int n) {
this.argument0 = hotelController;
this.argument1 = n;
}
}
```
|
||
|---|---|---|
| .. | ||
| agent-optional-plugins | ||
| Application-toolkit-dependency.md | ||
| Application-toolkit-kafka.md | ||
| Application-toolkit-log4j-1.x.md | ||
| Application-toolkit-log4j-2.x.md | ||
| Application-toolkit-logback-1.x.md | ||
| Application-toolkit-meter.md | ||
| Application-toolkit-micrometer-1.10.md | ||
| Application-toolkit-micrometer.md | ||
| Application-toolkit-trace-annotation.md | ||
| Application-toolkit-trace-correlation-context.md | ||
| Application-toolkit-trace-cross-thread.md | ||
| Application-toolkit-trace-read-context.md | ||
| Application-toolkit-trace.md | ||
| Application-toolkit-tracer.md | ||
| Application-toolkit-webflux.md | ||
| Bootstrap-plugins.md | ||
| Customize-enhance-trace.md | ||
| How-to-disable-plugin.md | ||
| How-to-tolerate-exceptions.md | ||
| Java-Plugin-Development-Guide.md | ||
| Opentracing.md | ||
| Optional-plugins.md | ||
| Plugin-list.md | ||
| Plugin-test.md | ||
| README.md | ||
| Setting-override.md | ||
| Specified-agent-config.md | ||
| Supported-list.md | ||
| TLS.md | ||
| Token-auth.md | ||
| advanced-features.md | ||
| advanced-reporters.md | ||
| configuration-discovery.md | ||
| configurations.md | ||
| containerization.md | ||
| logic-endpoint.md | ||
README.md
Setup java agent
- Agent is available for JDK 8 - 17.
- Find
agentfolder in SkyWalking release package - Set
agent.service_nameinconfig/agent.config. Could be any String in English. - Set
collector.backend_serviceinconfig/agent.config. Default point to127.0.0.1:11800, only works for local backend. - Add
-javaagent:/path/to/skywalking-package/agent/skywalking-agent.jarto JVM argument. And make sure to add it before the-jarargument.
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 oftomcat/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 oftomcat/bin/catalina.bat.
set "CATALINA_OPTS=-javaagent:/path/to/skywalking-agent/skywalking-agent.jar"
- JAR file
Add-javaagentargument to command line in which you start your app. eg:
java -javaagent:/path/to/skywalking-agent/skywalking-agent.jar -jar yourApp.jar
- Jetty
Modifyjetty.sh, add-javaagentargument to command line in which you start your app. eg:
export JAVA_OPTIONS="${JAVA_OPTIONS} -javaagent:/path/to/skywalking-agent/skywalking-agent.jar"
Plugins
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 and bootstrap class plugin section to learn how to active it.
- All plugins in
/pluginsfolder are active. Remove the plugin jar, it disabled. - The default logging output folder is
/logs.