edit-icon download-icon

Integrate with third-party monitoring solutions

Last Updated: Feb 06, 2018

Container Service provides the capability to integrate with third-party open-sourced monitoring solutions.

Note: Currently, Container Service monitoring integration only supports InfluxDB and Prometheus by default.

The following example introduces how to integrate the Container Service monitoring service with third-party monitoring solutions by taking InfluxDB as an example.

Procedure

  1. Log on to the Container Service console.

  2. Click Applications in the left-side navigation pane.

  3. Click Create Application in the upper-right corner.

    1

  4. Enter the basic information of the application and click Create with Orchestration Template.

    In this example, the name of the application is influxdb.

    1

  5. Enter the following orchestration template and click Create and Deploy. The label usage in Compose V3 is the same as that of earlier versions.

    Note: In a real production environment, the template in this example needs to be modified. Do not expose the port to the host in the influxdb service definition.

    1. version: '3' #Version number
    2. services: ##Define influxdb
    3. influxdb:
    4. image: tutum/influxdb:0.9
    5. ports:
    6. - "8083:8083" #Expose Web interface port
    7. - "8086:8086" #Expose data API Web interface port
  6. After the application is successfully created, click the application name influxdb on the Application List page to view the application details. Click the Containers tab to view the IP and port of the node where this application is running. Copy the node IP and port. (In this example, copy the node IP and port number of the port 8086. These are the data reporting address exposed by influxdb.)

    1

  7. Return to the Application List page.

  8. Click Update at the right of influxdb. Add the following contents to the template to declare the integration of InfluxDB and the container monitoring service. Then, click OK.

    Note: Currently, the third-party open-sourced monitoring integration only supports InfluxDB and Prometheus. The labels for InfluxDB and Prometheus integration are aliyun.monitoring.addon.influxdb and aliyun.monitoring.addon.prometheus respectively. The format of the label value must be schema:hostIp:port.

    1. labels
    2. aliyun.monitoring.addon.influxdb:"http://node IP:port" #The node IP and port are the ones you copied in step 6.

    Container Service cannot use link to identify InfluxDB because the container monitoring service Agent adopts host network mode. Therefore, create the influxdb application and then add the data reporting address exposed by influxdb to the application labels so as to inform the data collection client. Then, the monitoring service automatically writes the collected running status data of containers to influxdb.

  9. View the Elastic Compute Service (ECS) instance where the application is running. On the Node List page, click the node IP address and click the ECS instance ID to enter the ECS console.

    1

  10. In the ECS console, configure the security group rules for the cluster. Add the rules of ports 8083 and 8086. For more information, see Container Service security group rules.

    1

  11. Access the InfluxDB page in the browser to view the metric data written by the container monitoring service by using http://EIP:8083 port or http://node public IP:8083 according to the cluster network type (Virtual Private Cloud (VPC) or Classic).

    1. Select telegraf.
    2. Click Query Templates and select Show Measurements from the list.
    3. Press Enter.

    Note: If the cluster network type is VPC, to access the InfluxDB page by using http://EIP:8083, you must bind an Elastic IP (EIP) and configure ports 8083 and 8086 in the security group.

    You can view the database table.

    InfluxdbQuery

    View detailed data in a table.

    query

Subsequent operations

After Container Service is integrated with InfluxDB, select other data charts and frameworks, such as Grafana, to display your monitoring data based on your own business situation.

Thank you! We've received your feedback.