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.
Log on to the Container Service console.
Click Applications in the left-side navigation pane.
Click Create Application in the upper-right corner.
Enter the basic information of the application and click Create with Orchestration Template.
In this example, the name of the application is influxdb.
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
version: '3' #Version number
services: ##Define influxdb
- "8083:8083" #Expose Web interface port
- "8086:8086" #Expose data API Web interface port
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.)
Return to the Application List page.
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.prometheusrespectively. The format of the label value must be
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
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.
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.
Access the InfluxDB page in the browser to view the metric data written by the container monitoring service by using
http://node public IP:8083according to the cluster network type (Virtual Private Cloud (VPC) or Classic).
- Select telegraf.
- Click Query Templates and select Show Measurements from the list.
- 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.
View detailed data in a table.
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.