Alibaba Cloud Managed Service for Prometheus offers seamless integration with NGINX components, enabling the collection of vital metrics such as incoming requests, bytes transferred, and response times. By integrating NGINX components with Managed Service for Prometheus, you can leverage out-of-the-box dashboards to monitor performance, optimize server configurations, and troubleshoot issues as needed. This topic describes how to monitor an NGINX cluster.
Background information
You can view the metrics collected from an NGINX cluster on the Integration Center page in the ARMS console.
Prerequisites
NGINX has been installed and can run as expected.
To enable the monitoring of the NGINX stub status module, install ngx_http_stub_status_module.
To enable the monitoring of the NGINX virtual host traffic status (VTS) module, install nginx-module-vts.
Procedure
Log on to the ARMS console.
In the left-side navigation pane, click Integration Center. On the page that appears, click the Nginx card.
On the Nginx page, set parameters.
Select the environment type.
Kubernetes Environment: The monitored object runs in a Container Service for Kubernetes (ACK) cluster.
ECS(VPC): The monitored object runs on an Elastic Compute Service (ECS) instance.
Select an ACK cluster or an ECS instance as prompted.
Set the Configuration Information section.
ACK cluster
Parameter
Description
Example
Name(Not required)
The name of the NGINX cluster that you want to integrate into Managed Service for Prometheus.
nginxtest123
Enable Nginx for Stub Status monitoring
Specifies whether to use ngx_http_stub_status_module (a built-in module in NGINX) to collect metrics, including the number of requests received and processed by NGINX.
NoteBefore enabling this monitoring feature, ensure that ngx_http_stub_status_module is installed. For more information, see ngx_http_stub_status_module.
N/A
Enable Nginx for Vts monitoring
Specifies whether to use nginx-module-vts to collect metrics, including the number of NGINX requests, number of bytes, and response time.
NoteBefore enabling this monitoring feature, ensure that nginx-module-vts is installed. For more information, see nginx-module-vts.
N/A
Nginx Host
The domain name of the NGINX service.
The following domain names are supported:
Endpoint of the NGINX service within the cluster
Internal IP address of the ACK cluster where the NGINX service resides
Public IPv4 address of the NGINX service
nginx-server.namespace
Nginx Port
The port number of the NGINX server.
80
Metric collection interval(Unit/second)
The interval for collecting monitoring data. Default value: 15. Unit: seconds.
15
ECS (VPC)
Parameter
Description
Example
Name(Not required)
The name of the NGINX cluster that you want to integrate into Managed Service for Prometheus.
nginxtest321
Enable Nginx for Stub Status monitoring
Specifies whether to use ngx_http_stub_status_module (a built-in module in NGINX) to collect metrics, including the number of requests received and processed by the NGINX service.
N/A
Enable Nginx for Vts monitoring
Specifies whether to use nginx-module-vts to collect metrics, including the number of NGINX requests, number of bytes, and response time.
NoteBefore enabling this monitoring feature, ensure that nginx-module-vts is installed. For more information, see nginx-module-vts.
N/A
Nginx Host
The domain name of the NGINX service.
The following domain names are supported:
Endpoint of the NGINX service within the cluster
Internal IP address of the ACK cluster where the NGINX service resides
Public IPv4 address of the NGINX service
nginx-server.namespace
Nginx Port
The port number of the NGINX server.
80
Metric collection interval(Unit/second)
The interval for collecting monitoring data. Default value: 15. Unit: seconds.
15
Custom Labels
The custom tags of metrics of the ECS instance deployed in a virtual private cloud (VPC) that you want to monitor.
By configuring tags, you can organize, query, monitor, or analyze the metrics in a fine-grained manner when you use tools such as Grafana. For more information, see Add tags to the metrics of an ECS instance using a VPC.
NoteA tag key cannot contain special characters, such as hyphens (-), periods (.), and percent signs (%). The special characters are used in the Prometheus functionality.
Tags are in a key-value data format.
test1:aaa
View monitoring information
To view integrated components, you can click Integration Management in the left-side navigation pane. After you click the component card, you can view information such as targets, metrics, dashboards, alerts, service discovery configurations, and components in the panel that appears.