Java Application Monitor
For Java applications deployed in a CCE cluster, installing the APM application monitoring component - CCE OnePilot provides full-link intelligent monitoring capabilities.
Background
Application Performance Management (APM) is an application performance management platform that provides distributed application topology query and performance analysis capabilities. It enables monitoring the four golden metrics of applications (request count, QPS, latency, and error rate) through APM, and allows for locating issues via Traced call chain details, ensuring comprehensive system availability and stability.
Prerequisites
- Verify your JDK version. APM supports JDK1.8 and later versions.
- APM has been activated
Step I: Install the APM application management component
- Sign in to Cloud Container Engine Console (CCE).
- In the left navigation bar, click on the cluster list.
- On the Cluster List page, click on the desired cluster to open the cluster management page.
- From the left navigation bar on the cluster management page, select O&M - Component Management.
- In the Component Management section under the Monitor and Log tab, locate the CCE OnePilot component and click Install.
Once installed, you can upgrade or uninstall the CCE OnePilot component from the Component Management page.
Step II: Enable APM application management for Java applications
To enable ARMS application management when creating a new application, follow these steps.
- Sign in to the Cloud Container Engine console and select the Cluster List from the navigation bar at the left side.
- On the Cluster List page, click the target cluster name, then navigate to Workload - Stateless Deployment using the left navigation bar.
- On the Stateless Deployment page, click Create Resource Using YAML.
- Choose a custom template and, under spec.template.metadata in the YAML template, add the specified labels.
1labels:
2 cceOnepilotEnable: "on"
3 apmServiceName: "<your_service_name>" # replace <your_service_name> with your application instance name. If this tag is not set, metrics will be reported to APM using the workload's name metadata.name.
Below is a complete YAML example template for creating a stateless deployment application with APM application management enabled:
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4 name: test-demo
5 namespace: cce-onepilot
6spec:
7 replicas: 1
8 selector:
9 matchLabels:
10 app: test-demo
11 template:
12 metadata:
13 labels:
14 app: test-demo
15 cceOnepilotEnable: "on"
16 apmServiceName: "test-demo"
17 spec:
18 containers:
19 - name: test-demo
20 image: registry.baidubce.com/cce-plugin-dev/tomcat:my-tomcat
21 imagePullPolicy: Always
22 ports:
23 - containerPort: 8080
24 hostPort: 8080
View results
In the Stateless Deployment page, the APM Console button will appear in the operation column of the target application.

Next steps
After completing these steps, you've activated APM application management for applications deployed in the Kubernetes container service. Click the APM Console link in the operation column of the target application to access its management page.
