Java Agent server probe
Help is given with reference to the official website Setup the Java Agent , we need to use the official probe for us to achieve the purpose of monitoring, according to the actual situation we need to achieve three deployment
- IDEA deployment probe
- Java startup mode deployment probe (we are Spring Boot application, you need to use
java -jar
way to start the application) - Docker start deploy probes (needs to be done to build continuous integration effect once run anywhere, this section temporarily to provide solutions to the real part of the back and then realize)
Probe files in apache-skywalking-apm-incubating/agent
directory
# IDEA deployment probe
The case continues before the project, create a named hello-spring-cloud-external-skywalking
directory, and agent
copy the entire directory to come
VM operating parameters to modify the project, click on the menu bar Run
-> EditConfigurations...
, where our nacos-provider
project as an example, modify the parameters as follows
-javaagent:D:\Workspace\Others\hello-spring-cloud-alibaba\hello-spring-cloud-external-skywalking\agent\skywalking-agent.jar
-Dskywalking.agent.service_name=nacos-provider
-Dskywalking.collector.backend_service=localhost:11800
1
2
3
-javaagent
: Specifies the path to the probe-Dskywalking.agent.service_name
: Used to override theagent/config/agent.config
service name in the configuration file-Dskywalking.collector.backend_service
: For rewriting theagent/config/agent.config
service address in the configuration file
# The Java startup mode
java -javaagent:/path/to/skywalking-agent/skywalking-agent.jar -Dskywalking.agent.service_name=nacos-provider -Dskywalking.collector.backend_service=localhost:11800 -jar yourApp.jar
1
# Test monitoring
Start nacos-provider
project can be found by looking at the log, we have been successfully loaded probe
Written before access interface http: // localhost: 8081 / echo / hi and refresh SkyWalking Web UI, you will find the Service and Endpoint has successfully detected
So far, it represents SkyWalking link track configuration is successful
# SkyWalking Trace monitoring
SkyWalking dependency analysis by business call monitoring, it provides us with a service call topological relationships between services, as well as Trace records for each of Endpoint.
# Call link monitoring
Click on Trace
the menu, enter the tracking page
Click Trace ID
to expand for more information
The figure shows a normal response, a total response time of 185ms
a total of Span a (basic unit of work representing a complete request, a response, i.e., request and response)
Span /echo/{message}
follows:
- Duration: 185 ms response time
- component: the component type is SpringMVC
- url: Request address
- http.method: Request Type
# Service performance monitoring
Click on Service
the menu, enter the service performance monitoring page
Select the desired monitoring service
- Avg SLA: service availability (mainly calculated by requesting success and failures)
- CPM: call per minute
- Avg Response Time: Average Response Time
Click More Server Details...
can also view details
The figure above shows the service within a certain range of time-related data, including:
- Service Availability SLA metrics
- The average number of responses per minute
- The average response time
- Service process PID
- IP physical machine where the service, Host, OS
- Run-time CPU usage
- Runtime heap memory usage
- Non-heap memory usage is running
- GC case