You can collect the configuration data and metric data of hosts to the Full-stack Monitoring application. This way, you can monitor the data in a visualized manner. The configuration data includes CPU models and memory sizes. The metric data includes CPU utilization and memory usage.

Prerequisites

An instance is created. For more information, see Create an instance.

Procedure

  1. Log on to the Log Service console.
  2. In the Log Application section, click Full-stack Monitoring.
  3. On the Full-stack Monitoring page, click the instance.
  4. On the Data Import page, enable Host.

    If this is your first time to create a Logtail configuration for host monitoring, turn on the switch to go to the configuration page. If you have created a Logtail configuration, click the Create icon to go to the configuration page.

  5. In the Install Logtail step, select the machine on which you want to install Logtail and click Next.
    • If you want to install Logtail on an Elastic Compute Service (ECS) instance, select the ECS instance on the ECS Instances tab and click Execute Now. For more information, see Install Logtail on ECS instances.
    • If you want to install Logtail on a self-managed Linux server or a Linux server from a third-party cloud, you must manually install Logtail V0.16.40 or later on the server. For more information, see Install Logtail on a Linux server.
  6. In the Create Machine Group step, create a machine group and click Next.
    Log Service allows you to create IP address-based machine groups and custom identifier-based machine groups. For more information, see Create an IP address-based machine group and Create a custom ID-based machine group.
  7. In the Machine Group Settings step, select the machine group that you create in the Source Server Groups section and move the machine group to the Applied Server Groups section. Then, click Next.
    Notice If you immediately apply a machine group after it is created, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Log Service. In this case, you can click Automatic Retry. If the issue persists, see What do I do if no heartbeat connections are detected on Logtail?
  8. In the Specify Data Source step, configure the following parameters and click Complete.
    Log Service provides the following two collection plug-ins for host monitoring:
    • metric_system_v2: used to collect the metric data of hosts. The data includes CPU utilization and memory usage. The collected data is stored in a Metricstore named {instance}-node-metrics.
    • metric_meta_host: used to collect the configuration data of hosts. The data includes CPU models and memory sizes. The collected data is stored in a Logstore named {instance}-metas.

    {instance} specifies the ID of the Full-stack Monitoring instance that you create.

    Parameter Description Example
    Config Name The name of the Logtail configuration. host-szytbsxv
    node-metrics The configurations of the metric_system_v2 plug-in that is used to collect the metric data of hosts. The data includes CPU utilization and memory usage.
    • IntervalMs: the interval of requests. Unit: ms. The value must be greater than or equal to 5000. We recommend that you set the value to 30000.
    • cluster: the name of the cluster. The name must meet the following requirements:
      • The name can contain lowercase letters, digits, hyphens (-), and underscores (_).
      • The name must start and end with a lowercase letter or a digit.
      • The name must be 3 to 63 characters in length.

      After you configure this parameter, Log Service adds a cluster=Cluster name tag to the host monitoring data that is collected by using the Logtail configuration.

    • type: the type of the data source. Set the value to metric_system_v2.
    {
      "inputs": [
        {
          "detail": {
            "IntervalMs": 30000,
            "Labels": {
              "cluster": "my-cluster"
            }
          },
          "type": "metric_system_v2"
        }
      ]
    }
    node-metas The configurations of the metric_meta_host plug-in that is used to collect the configuration data of hosts. The data includes CPU models and memory sizes.
    • IntervalMs: the interval of requests. Unit: ms. The value must be greater than or equal to 5000. We recommend that you set the value to 30000.
    • cluster: the name of the cluster. The name must meet the following requirements:
      • The name can contain lowercase letters, digits, hyphens (-), and underscores (_).
      • The name must start and end with a lowercase letter or a digit.
      • The name must be 3 to 63 characters in length.

      After you configure this parameter, Log Service adds a cluster=Cluster name tag to the host monitoring data that is collected by using the Logtail configuration.

    • type: the type of the data source. Set the value to metric_meta_host.
    {
      "inputs": [
        {
          "detail": {
            "IntervalMs": 30000,
            "Labels": {
              "cluster": "my-cluster"
            }
          },
          "type": "metric_meta_host"
        }
      ]
    }

    After you complete the configurations, Log Service automatically creates assets such as Metricstores. For more information, see Assets.

What to do next

After host monitoring data is collected to Log Service, the Full-stack Monitoring application automatically creates dedicated dashboards for the monitoring data. You can use the dashboards to analyze the monitoring data. For more information, see View dashboards.