Updated on 2024-09-30 GMT+08:00

Configuring APM

Scenario

Application Performance Management (APM) allows you to monitor Java workloads through tracing and topology. You can install APM probes to locate and analyze problems for Java workloads.

You can configure Java workload monitoring when and after a workload is created.

Prerequisites

  • You have enabled the APM service. If you have not enabled the APM service, go to the APM console and enable it as prompted.
  • You have created a VPC endpoint for APM. If you have not created an endpoint, create one by following the instructions on the performance management configuration page.

Precautions

  • If a VPC endpoint for APM is deleted, data will fail to be uploaded to APM. If you create this endpoint again, the metrics will not be uploaded to APM automatically. In this case, you can restart the application.
  • Deleting a workload that uses APM will not delete the endpoint. To delete it, go to the network console.

Procedure

  1. Log in to the CCE console.
  2. Click the cluster name to go to the cluster console, choose Workloads in the navigation pane, and click the Create Workload in the upper right corner.
  3. When creating a workload, click APM Settings in the Advanced Settings area. By default, the probe is Disabled. You can select APM 2.0. After the probe is enabled, APM can locate and analyze problems for Java programs.

    1. The APM 2.0 probe will be initialized in an automatically-created init container named init-javaagent. This init container will be allocated 0.25 CPU cores and 250 MiB of memory.
    2. Adding an APM probe will add the following environment variables to all service containers: PAAS_MONITORING_GROUP, JAVA_TOOL_OPTIONS, PAAS_CLUSTER_ID, and APM_ACCESS_ADDRESS.
    3. Adding an APM 2.0 probe will mount a local storage volume named paas-apm2 to all service containers.

  4. Set probe-related parameters.

    • To access APM in a CCE Autopilot cluster, you need to create a VPC endpoint for APM to connect to the VPC. For details about the VPC endpoint price, see VPC Endpoint Pricing.
    • Probe Version: Select the probe version.
    • Probe Upgrade Policy: By default, Auto upgrade upon restart is selected.
      • Auto upgrade upon restart: The system downloads the probe image each time the pod is restarted.
      • Manual upgrade upon restart: This policy means that if a local image is available, the local image will be used. The system downloads the probe image only when a local image is unavailable.
    • APM Environment: (Optional) Enter an environment name.
    • APM Service: Select an existing APM application.
    • Sub-service: (Optional) Enter a sub-service of the APM application.
    • Access key: The system automatically obtains the key information of APM. You can go to the APM console to view the key details.

  5. Three minutes after the application is started, its data will be displayed on the APM console. You can log in to the APM console and optimize application performance through topology and tracing. For details, see Topology.

Configuring APM Settings

  1. Log in to the CCE console.
  2. Click the cluster name to go to the cluster console, choose Workloads in the navigation pane, and click the desired workload name.
  3. On the page displayed, click the APM Settings tab and click Edit in the lower right corner.

    For details about the parameters, see 4.