This article describes how to enable SkyWalking when starting the Linkis service to facilitate subsequent distributed trace and troubleshooting.
SkyWalking is an open source observability platform used to collect, analyze, aggregate and visualize data from services and cloud native infrastructures. SkyWalking provides an easy way to maintain a clear view of your distributed systems, even across Clouds. It is a modern APM, specially designed for cloud native, container based distributed systems.
The following figure is the overall architecture of SkyWalking.
SkyWalking is logically split into four parts: Probes, Platform backend, Storage and UI.
Using SkyWalking in Linkis requires that the user already has the Backend service and the corresponding Storage. The Probe can be integrated when the Linkis service is started. There are three main ways of Probe integration:
-javaagent command line argument to manipulate codes in runtime, where manipulate means to change and inject user’s codes. Another kind of agents uses certain hook or intercept mechanism provided by target libraries. As you can see, these agents are based on languages and libraries.We used Language based native agent when Linkis integrated SkyWalking, that is, the method of java agent. Below we will show you how to enable SkyWalking in Linkis service.
The SkyWalking backend is a prerequisite for enabling SkyWalk. The following is a brief demonstration of how to install the SkyWalking backend.
First download SkyWalking APM from SkyWalking's Downloads page.
After downloading, unzip it directly, and we get the following directory structure.
$ ls bin config config-examples LICENSE licenses logs NOTICE oap-libs README.txt tools webapp
The backend uses the H2 in-memory database as the backend storage by default, and does not need to modify the configuration. Start as follows.
Start Backend
$ bash bin/startup.sh
Start WebApp
$ bash bin/webappService.sh
The UI starts on port 8080 by default. You can also modify the listening port by modifying the webapp.yml file in the webapp directory.
server: port: 8080 spring: cloud: gateway: routes: - id: oap-route uri: lb://oap-service predicates: - Path=/graphql/** discovery: client: simple: instances: oap-service: - uri: http://127.0.0.1:12800 # - uri: http://<oap-host-1>:<oap-port1> # - uri: http://<oap-host-2>:<oap-port2> mvc: throw-exception-if-no-handler-found: true web: resources: add-mappings: true management: server: base-path: /manage
It is assumed here that the service deployment of Linkis is relatively clear. If it is not clear, it can be asynchronous:
To start SkyWalking in Linkis, you first need to download the Java agent of SkyWalking, we can download it from the Downloads page.
After downloading, unzip it directly, the internal file structure is as follows:
tree skywalking-agent $ skywalking-agent ├── LICENSE ├── NOTICE ├── activations │ ├── apm-toolkit-kafka-activation-8.8.0.jar │ ├── ... ├── bootstrap-plugins │ ├── apm-jdk-http-plugin-8.8.0.jar │ └── apm-jdk-threading-plugin-8.8.0.jar ├── config │ └── agent.config ├── licenses │ └── LICENSE-asm.txt ├── logs ├── optional-plugins │ ├── apm-customize-enhance-plugin-8.8.0.jar │ ├── ... ├── optional-reporter-plugins │ ├── kafka-reporter-plugin-8.8.0.jar │ ├── ... ├── plugins │ ├── apm-activemq-5.x-plugin-8.8.0.jar │ ├── ... └── skywalking-agent.jar
Modify the configuration item SKYWALKING_AGENT_PATH in linkis-env.sh of Linkis. Set it to the path to skywalking-agent.jar.
SKYWALKING_AGENT_PATH=/path/to/skywalking-agent.jar
Then start Linkis.
$ bash linkis-start-all.sh
The UI port of Linkis starts at port 8080 by default. After Linkis opens SkyWalking and opens the UI, if you can see the following picture, it means success.