Updated on 2025-03-13 GMT+08:00

Ingesting Nginx Metrics to AOM

Create a collection task and install Nginx Exporter to monitor Nginx metrics on a host.

Procedure

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane on the left, select either of the following methods to ingest middleware metrics:

    • Method 1: Choose Access > Access Center.

      There are old and new access centers. To switch from the old access center to the new one, click Experience the new version in the upper right corner of the page.

      • In the old access center, click the Nginx card in the Prometheus Middleware panel.
      • In the new access center, locate the Nginx card under Self-built middleware and click Ingest Metric (AOM) on the card.
    • Method 2: Choose Prometheus Monitoring > Instances. Click a Prometheus instance for ECS. On the instance details page, choose Access Center and then click the Nginx card.

  3. On the displayed page, set parameters by referring to the following table to configure a collection task and click Next.

    Figure 1 Configuring a collection task
    Table 1 Parameters for configuring a collection task

    Operation

    Parameter

    Description

    Select Instance

    Prometheus Instance

    Select a Prometheus instance for ECS to store collected data.

    A collection task is associated with the Prometheus instance to mark and classify collected data. If no Prometheus instance is available, create one.

    Set Plug-in

    OS

    Operating system of the host. Only Linux is supported.

    Collection Plug-in

    The default value is NGINX.

    Plug-in Version

    Select a plug-in version. Plug-in versions that have not been released are dimmed and cannot be selected.

    Set Collection Task

    Collection Task Name

    Name of a collection task. Enter 1 to 50 characters starting with a letter. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    Host

    Click Add Host. On the Add Host page, select the host for configuring the collection task and installing Exporter.

    • Search for and select a host by the host name, IP address, or Agent status.
    • You can click in the upper right corner to deselect the selected host.
    • Ensure that the UniAgent of the selected host is running. Otherwise, no data can be collected.

    Metric Dimension

    Click . In the displayed dialog box, select Built-in or Custom to add a metric dimension.
    • Metric dimension name:
      • Built-in metric dimensions: _app, _comp, and _env are available, which are used to identify applications, components, and environments, respectively.
      • Custom metric dimension: Enter a metric dimension name. Each name can contain 1 to 64 characters. Only letters, digits, and underscores (_) are allowed. Each name must start with a letter or underscore.

      For a host, each metric dimension name must be unique.

    • Metric dimension value: Enter the value of a metric dimension. This value can be duplicate but cannot be empty.

      Each value can contain 1 to 128 characters. The following characters are not allowed: &|><$;'!-()

    Up to 10 dimensions can be added. For example, if the dimension name is label1 and the dimension value is label2, label1:"label2" will be displayed.

    Advanced Settings

    • Configure the following parameters:

      • Collection Period (s): O&M data collection period, in seconds. Options: 10s, 30s, and 60s (default).
      • Timeout Period (s): the maximum time allowed for executing a collection task, in seconds. Options: 10s, 30s, and 60s (default). The timeout period cannot exceed the collection period.
      • Executor: user who executes the collection task, that is, the user of the selected host. The default value is root. Currently, only the root user is supported.

  4. Set Exporter installation parameters and click Install. Click View Log to check Exporter installation logs if the installation fails.

    Exporter collects monitoring data and regulates the data provided for external systems through Prometheus monitoring.
    Figure 2 Installing Exporter

    Parameter

    Description

    Nginx URL

    Nginx URL, which is in the format of "Connection address of Nginx+Nginx service status path".
    • Connection address of Nginx: IP address and listening port number of the Nginx service. The listening port is specified in the nginx.conf file. Example: 10.0.0.1:8080
    • Nginx service status path: specified by the location parameter in the nginx.conf file, for example, /stub_status.

    Example: https://10.0.0.1:8080/stub_status

  5. Click Create to connect the Nginx plug-in. The connected plug-in will be displayed on the collection task page. Click the name of a collection task. On the displayed page, you can check the configuration of the collection task.