Updated on 2024-11-20 GMT+08:00

API Monitoring

Introduction

API monitors monitor the API gateways of your services, and send gateway alarms to you in a timely manner.

This section uses an example to help you quickly get started. The general process includes:

Step 1: Create an Application

Applications isolate resources of different users in an instance. Monitors must be associated with applications.

  1. Log in to the MAS console. On the Multi-Active Instances page, click an instance to go to its console.
  2. Click the Applications tab, and click Create.
  3. Enter the application information, then click OK.
    Table 1 Application parameters

    Parameter

    Description

    Application

    Customize the application name.

    Description

    (Optional) Enter a description about the application.

Step 2: Add a Secret Key

  1. Log in to the MAS console. On the Multi-Active Instances page, click an instance whose namespace type is Intra-city multi-active.
  2. Click the Global tab.
  3. On the Secret Keys page, click Add Secret Key.
  1. Configure information and click OK.
    Figure 1 Secret key configurations
    Table 2 Secret key parameters

    Parameter

    Description

    Cloud

    Select the environment where the SMN service is deployed.

    AK

    Access key ID.

    SK

    Secret access key.

    Refer to Access Keys to obtain an AK/SK.

Step 3: Create a Notification

  1. Log in to the MAS console. On the Multi-Active Instances page, click an instance whose namespace type is Intra-city multi-active.
  2. Click the Global tab.
  3. On the Notifications page, click Create Notification.
  4. Enter the notification information, then click OK.
    Figure 2 Notification configurations
    Table 3 Notification parameters

    Parameter

    Description

    Subject

    Select a notification subject or click Add to create one.

    Notify

    Specify whether to enable notification.

    For details about how to create an SMN subject, see Publishing a JSON Message.

Step 4: Create an API Monitor

  1. Log in to the MAS console. On the Multi-Active Instances page, click an instance whose namespace type is Intra-city multi-active.
  2. Click the Monitor List tab, and click Create Monitor.
  3. Configure the basic information, then click Next: Data Centers.
    Figure 3 Basic information configurations
    Table 4 Basic information parameters

    Parameter

    Description

    Monitor

    Select API Monitoring.

    Application

    Select the application created in Step 1: Create an Application.

    Monitor Name

    Customize the monitor name.

    Exception Notification

    By default, this option is disabled. In this example, this option is enabled.

    If this option is enabled, monitor and database alarms will be sent to you in a timely manner with the Huawei Cloud SMN service. Configure a secret key before enabling this option.

    Subject

    Select a subject from the drop-down list or click Add to create one.

    Monitoring

    The default value is Yes. If No, the API gateway statuses will not be monitored.

  4. Configure the data centers, then click Next: Advanced.
    Figure 4 Data center configurations
    Table 5 Data center parameters

    Parameter

    Description

    Cloud

    Select the environments where the API gateways are deployed.

    Region

    Select the regions of the API gateways.

    Connection Address

    Select HTTP or HTTPS, and enter the addresses of the API gateways.

    Request Path

    Health check paths of the API gateways.

    Request Method

    Select GET, POST, DELETE, PUT, or PATCH.

    Status Code

    Set this parameter based on the requirements of the API gateways, for example, 200.

    Request Header

    Set this parameter based on the requirements of the API gateways.

  5. Configure the advanced settings, then click Next: Confirm. Default values are used in the following figure.
    Figure 5 Advanced configurations
  6. Confirm settings and click Create.