Scenarios
Cloud Log Service (CLS) provides preset alarm policy templates for common logs. You can quickly create alarm policies in batches using these templates. Currently, it only supports audit logs and event logs of Tencent Kubernetes Engine (TKE). More cloud product logs will be supported in the future.
|
TKE | TKE event logs | |
TKE | TKE audit logs | |
Operation Steps
Creating Policies in Batches
Use the template to create multiple alarm policies in batches and quickly build a monitoring system for cloud products.
2. In the left sidebar, choose Monitoring and Alerts > Alarm Policy to go to the alarm policy management page.
3. Click Batch Create, and fill in the following information in the Batch Create Alarm Policy drawer:
Instance selection: Select the region of the cloud product instance and select the corresponding instance, such as a TKE container cluster in the Guangzhou region.
Alarm template selection: Select the alarm template to be enabled.
Associate notification group: Select an existing notification group or create a notification group, and set the method and recipients for sending notifications. Notification methods include SMS, email, phone call, WeChat, WeCom, DingTalk, Lark, and custom webhooks. Tag: Set tags for the created alarm policy to facilitate categorized resource management from different dimensions.
4. Click Confirm to complete the creation.
Creating Policies Separately
Use the template to create alarm policies separately. In this way, you can adjust some configurations (such as alarm name and preset trigger conditions) separately.
2. In the left sidebar, choose Monitoring and Alerts > Alarm Policy to go to the alarm policy management page.
3. Click Create, and fill in the following information on the Create Alarm Policy page:
Basic information:
Alarm name: 1 to 255 characters.
Enabling status: Whether to enable the current alarm policy. When the alarm policy is not enabled, no alarm or notification will be generated.
Tag: Set tags for the current alarm policy to be created to facilitate categorized resource management from different dimensions.
Setting method: Select template configuration.
Type of cloud product: Select the type of cloud product to be monitored, such as TKE.
Template type: Some cloud products include various types of logs, each corresponding to a template, such as TKE audit logs and TKE Event Logs.
Monitored object: Select the region of the cloud product instance and select the corresponding instance, such as a TKE container cluster in the Guangzhou region.
Monitoring task:
Alarm template: Select the alarm template you need to use. Each alarm template represents a type of exception, such as deleting resources in a TKE cluster.
Trigger condition: Set the trigger threshold.
Alarm notification:
Alarm frequency:
Duration: A notification will be sent only after the trigger condition is met consistently for a certain number of times (ranging from 1 to 10 times, with 1 as the default value).
Interval: After the last notification was sent, no notifications will be sent within the specified interval. For example, a 15-minute interval indicates that only one alarm notification will be sent within 15 minutes.
Notification group: By associating a notification group, you can set the method and recipients for sending. Notification methods include SMS, email, phone call, WeChat, WeCom, DingTalk, Lark, and custom webhooks. For details, see Managing Notification Groups. If the selected notification group includes a custom webhook, the Set custom API callback parameters individually switch will be displayed. When this feature is not enabled, the custom webhook will use the configuration in the notification content template for the request header and request body. When it is enabled, you can define the request header and request body separately in the alarm policy, where alarm notification variables are available. Additional classification field: Classify alarms. Configure it in key:value format. The key only supports letters, digits, and underscores, and should start with a letter. The key can be up to 50 characters, and the value can be up to 200 characters. You can configure different notification rules in the notification group based on this field, or reference this field in {{.Label}} format in additional notification content and custom webhook.
For example, set the classification field to.service:payService (indicating that the service name corresponding to the current alarm is payService):
Configure notification rules in the notification group so that when the service contains payService, an alarm will be sent to the corresponding team.
Use {{.Label}} or {{.Label.service}} in the custom webhook configuration to get the field values (which are {"service": "payService"} and payService respectively). The third-party platform can identify the service name corresponding to this alarm after receiving the webhook.
Additional notification content: Add extra text to the alarm notification to enrich its content. You can use alarm notification variables to dynamically generate it. 4. Click Confirm to complete the creation.