This topic explains how to monitor LogCollector log collection status using the TLS alarm feature.
After enabling the LogCollector service log feature in the host group, TLS records state logs generated by LogCollector and stores them in the tls_service-project project under the tls_log-collector-status log topic. LogCollector status logs record informations such as the LogCollector version number, CPU usage, number of logs sent, number of failed requests, and files bound to multiple collection configurations. For more information, see LogCollector status logs. You can create alarm tasks based on these fields to monitor the status of LogCollector log collection.
Alarm when a file is bound to multiple collection configurations
By default, a log file can only correspond to one collection configuration. If multiple configurations point to the same file, the system uses the latest collection configuration, and other configurations become invalid. The log entries in this log file are only collected into the log topic specified by the latest collection configuration.
To help you monitor this situation, the LogCollector service log offers the DuplicateFilePathCnt field, which indicates whether a log file is associated with multiple collection configurations. When the DuplicateFilePathCnt value is greater than 0, it means that a log file is associated with two or more collection configurations. By monitoring the DuplicateFilePathCnt field through the log alarm feature, you can quickly identify and resolve issues where a log file is associated with multiple collection configurations.
- Select the region where log service is located from the top navigation bar.
- On the left navigation bar, select log alarm > alarm policy.
- On the Alarm policy page, and click Create alarm policy.
- On the Create alarm policy page, configure the settings as needed.
- Set up basic information.
- Set the alarm policy name and project. The project must be set to tls_service-project.
-
- Configure monitoring tasks.
-
- Key parameter description:
- Configure alarm notifications.
-
- Key parameter description:
- Receive alarm notifications.
- You will receive an alarm notification when a log file is specified by multiple collection configurations.
- You can click Log query details and then View details to open the query and analysis page for the tls_log-collector-status log topic. On the original log page, you can view log file names bound to multiple collection configurations and information about the corresponding machines.
Collection failure alarm
The SendFailReqs field in LogCollector service logs shows the number of failed log requests. If the value of this field is greater than 0, it means some logs failed to send. Monitor the SendFailReqs field with the log alarm feature of TLS to promptly detect and address log sending failures.
- Select the region where log service is located from the top navigation bar.
- On the left navigation bar, select log alarm > alarm policy.
- On theAlarm policypage, and click Create alarm policy.
- On the Create alarm policy page, configure the settings as needed.
- Set up basic information.
- Set the alarm policy name and project. The project must be set to tls_service-project.
-
- Configure monitoring tasks.
-
- Key parameter description:
- Configure alarm notifications.
-
- Key parameter description:
- Receive alarm notifications.
- If log sending fails, you will receive an alarm notification.
- You can click Log query details and then View details to open the query and analysis page for the tls_log-collector-status log topic. In the Raw logs section of this page, you can view information about the machines that failed to send logs as well as the number of failed requests.