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.
Create an application to be monitored. In this example, create an Nginx application. For more information, see Create an Nginx webserver from an image.
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.
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
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 node IP and port exposed by this application. 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.
aliyun.monitoring.addon.influxdb: "http://node IP:port" #The node IP and port are the ones you copied in step 7.
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
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 running status data of containers collected by application influxdb to
On the Application List page, click the application name influxdb and then click the Containers tab. Copy the port exposed by influxdb container.
We recommend that you access InfluxDB by using the Web proxy.
To access InfluxDB by using Internet, follow these steps:
Perform Internet authentication.
Configure the inbound security group rules of ports 8083 and 8086 for the node in which the application influxdb resides.
Access InfluxDB by using
http://node public IP:8083according to the cluster network mode (Virtual Private Cloud (VPC) or Classic).
Access the InfluxDB page in the browser to view the metric data written by the container monitoring service.
- Select telegraf. If telegraf does not exist, run CREATE DATABASE telegraf first and then redeploy the application that needs to be monitored.
- Click Query Templates and select Show Measurements from the list.
- Press Enter.
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.