Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Connecting a Deployment Application to APM

Updated on 2023-06-19 GMT+08:00

Deployment is a workload that does not store any data or status. If you have deployed a Deployment application using Cloud Container Engine (CCE) or open-source Kubernetes, you can execute the configuration script to connect the application to APM and view its data on the topology and transaction pages.

Prerequisites

  • You have connected an Elastic Cloud Server (ECS) to a cluster by running the kubectl command. For details, see Connecting to a Cluster Using kubectl.
  • You have deployed an application using CCE or open-source Kubernetes.

Procedure

Step 1: Subscribe to APM

See Subscribing to APM and Buying a Package.

Step 2: Install the ICAgent

NOTE:
  • If the ICAgent is bound to CCE, skip this step.
  1. Obtain an Access Key ID/Secret Access Key (AK/SK).
  2. Log in to the APM console.
  3. In the navigation pane, choose Agent > Management.
  4. Click Install ICAgent. On the page that is displayed, set Host to HUAWEI CLOUD host and OS to Linux.
  5. Select the Obtain AK/SK installation mode, enter the obtained AK/SK in the text box to generate the ICAgent installation command, and click Copy Command.
    NOTE:

    Ensure that the AK/SK are correct. Otherwise, the ICAgent cannot be installed.

  6. Remotely log in to the ECS server as the root user and run the preceding command to install the ICAgent.

    When the message "ICAgent install success" is displayed, the ICAgent is successfully installed in the /opt/oss/servicemgr/ directory.

(Optional) Step 3: Modify Permissions

If you start the program as a non-root user, run the following commands to modify the permissions on the probe file and output directory before enabling application monitoring:

chmod -R 777 /opt/oss/servicemgr/ICAgent/pinpoint/
mkdir -p /opt/apm-container 
chmod -R 777 /opt/apm-container 

Step 4: Enable Application Monitoring

  1. On the ECS or CCE, configure the startup script of the Deployment. Specifically, add the following information in bold to the YAML file.

    Run the following command to edit the YAML file:

    vi xxx.yaml
    xxx indicates the name of the description file customized when you create the Deployment application. The following provides an example. For more information about deployments, see Kubernetes documents.
    kind: Deployment 
    apiVersion: apps/v1 
    metadata: 
      name: user-service 
      namespace: default 
      selfLink: /apis/apps/v1/namespaces/default/deployments/user-service 
      uid: b231788d-9abd-11e8-80a5-fa163e3a2cc7 
      resourceVersion: '50972062' 
      generation: 13 
      creationTimestamp: '2018-08-08T03:46:56Z' 
      labels: 
        app: user-service 
        stack-name: auto-test 
      annotations: 
        deployment.kubernetes.io/revision: '5' 
        description: '' 
      enable: true 
    spec: 
      replicas: 1 
      selector: 
        matchLabels: 
          app: user-service 
      template: 
        metadata: 
          creationTimestamp: null 
          labels: 
            app: user-service 
          enable: true 
        spec: 
          #External mount directory of the container, including the data output path and Java probe package path.
          volumes: 
            - name: paas-apm 
              hostPath:  
                path: /opt/apm-container 
            - name: pinpoint-pkg 
              hostPath:  
                path: /opt/oss/servicemgr/ICAgent/pinpoint 
          containers: 
            - name: user-service 
              image: '100.125.0.198:20202/zhyyy/user-service:v1' 
              ports: 
                - containerPort: 8080 
                  protocol: TCP 
              env: 
                - name: PAAS_APP_NAME 
                  # Workload name (service name).
                  value: user-service 
                - name: PAAS_NAMESPACE 
                  #CCE cluster namespace. For a non-CCE cluster, this parameter is left blank.
                  value: default 
                - name: PAAS_PROJECT_ID 
                  #Tenant's project ID.
                  value: d698369a975645bfb35f8437d11c5a12 
                - name: PAAS_CLUSTER_ID 
                  #CCE cluster ID, which can be queried by pressing F12 on the CCE console. For a non-CCE cluster, this parameter is left blank.
                  value: 89b49857-5433-11e8-941c-0255ac101f3e 
                 - name: PAAS_POD_ID
                               valueFrom:
                                 fieldRef:
                                   fieldPath: metadata.uid
                - name: PAAS_MONITORING_GROUP 
                 # Application name (monitoring group). You are advised to set the same application name for the services that fulfill the same function.
                  value: shoppingmall 
                - name: JAVA_TOOL_OPTIONS 
                  value: -javaagent:/opt/oss/servicemgr/ICAgent/pinpoint/pinpoint-bootstrap.jar -Dapm_container=true 
              resources: {} 
             #Internal mount directory of the container, including the data output path and Java probe package path.
              volumeMounts: 
                - name: paas-apm 
                  mountPath: /paas-apm/collectors/pinpoint 
                - name: pinpoint-pkg 
                  mountPath: /opt/oss/servicemgr/ICAgent/pinpoint 
    
              terminationMessagePath: /dev/termination-log 
              terminationMessagePolicy: File 
              imagePullPolicy: Always 
          restartPolicy: Always 
          terminationGracePeriodSeconds: 30 
          dnsPolicy: ClusterFirst 
          securityContext: {} 
          schedulerName: default-scheduler 
      strategy: 
        type: RollingUpdate 
        rollingUpdate: 
          maxUnavailable: 0 
          maxSurge: 1 
      revisionHistoryLimit: 10 
      progressDeadlineSeconds: 600 
    status: 
      observedGeneration: 13 
      replicas: 1 
      updatedReplicas: 1 
      readyReplicas: 1 
      availableReplicas: 1 
      conditions: 
        - type: Progressing 
          status: 'True' 
          lastUpdateTime: '2018-09-02T13:25:46Z' 
          lastTransitionTime: '2018-08-08T03:46:56Z' 
          reason: NewReplicaSetAvailable 
          message: ReplicaSet "user-service-f584f46b7" has successfully progressed. 
        - type: Available 
          status: 'True' 
          lastUpdateTime: '2018-12-21T11:01:33Z' 
          lastTransitionTime: '2018-12-21T11:01:33Z' 
          reason: MinimumReplicasAvailable 
          message: Deployment has minimum availability.
  2. Restart the application using the modified script, and enable application performance monitoring.

Step 5: Manage the Application on APM

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 APM User Guide.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback