tencent cloud

Feedback

Alarm Policy Configuration

Last updated: 2024-01-22 20:52:28
    Important
    EventBridge is integrated with Tencent Cloud Observability Platform (TCOP). You can configure the alert rules in the TCOP console.

    Overview

    Upon the activation of EventBridge, a default Tencent Cloud service event bus in created automatically in the Guangzhou region. Events of all services connected to the event bus are deliver events. You can also set event rules and delivery targets to configure an alarm link.

    Configuring Alerting Rules

    1. View the event list

    Log in to the EventBridge console, go to the default Tencent Cloud service event bus, and view the events of all connected Tencent Cloud services.
    
    
    
    
    The standard event format is as shown below:
    {
    "specversion":"1.0",
    "id":"13a3f42d-7258-4ada-da6d-023a333b4662",
    "source":"${ProductName}.cloud.tencent",
    "type":"cvm:ErrorEvent:ping_unreachable",
    "subject":"${resource ID}",
    "time": 1615430559146,
    "region":"ap-guangzhou",
    "resource":[
    "qcs::eb:ap-guangzhou:uid1250000000:eventbusid/eventruleid"
    ],
    "datacontenttype":"application/json;charset=utf-8",
    "tags":{
    "key1":"value1",
    "key2":"value2"
    },
    "status":"1",
    "data":{
    "appId":"1250000011",
    "instanceId":"ins-sjdksjk",
    "projectId":"11",
    "dimensions":{
    "ip":"127.0.0.1"
    },
    "additionalMsg":{
    "IP":"something unnormal"
    }
    }
    }
    The preceding fields are described as follows:
    Field
    Description
    String
    specversion
    Event structure version (CloudEvents version), which is 1.0.2.
    String
    ID
    ID returned by PUT Event.
    String
    type
    Type of the event passed in PUT Event. The standard format of a Tencent Cloud service alarm event is ${ProductName}:ErrorEvent:${EventType}, where colons (:) are used to separate type fields.
    String
    source
    Event source (which is required for a Tencent Cloud service event and is the abbreviation of subject). The value is xxx.cloud.tencent by default for a Tencent Cloud service.
    String
    subject
    Event source details, which can be customized. QCS description such as qcs::dts:ap-guangzhou:appid/uin:xxx is used for a Tencent Cloud service by default.
    String
    timer
    Event time, which is a GMT+0 timestamp in milliseconds, such as 1615430559146.
    Timestamp
    datacontenttype
    Data media type declaration.
    String
    region
    Region.
    String
    status
    Alert event status. Valid values: 1 (abnormal), 0 (resolved), and - (stateless).
    String
    tags
    Resource tags.
    JSON
    data
    Details of the event input through PUT Event, which are customizable based on the specific business.
    JSON

    2. Configure an alert event rule

    Go to the Event Rule page, select the target event bus. Create an event rule.
    
    
    
    
    
    
    

    Sample alert rule

    To receive and deliver all CVM alert events, the rule should be as below:
    {
    "source":"cvm.cloud.tencent"
    }
    To receive and deliver only unreachable ping events from CVM, the rule should be as below. In this case, other events are discarded.
    {
    "source":"cvm.cloud.tencent",
    "type":"cvm:ErrorEvent:PingUnreachable"
    }
    Receiving events from the specified instance: Events from the CVM resource "ins-XXX" are received and delivered. Other events are discarded. The format of subject varies for different event sources. You can check the formats in the complete event delivered to CLS.
    {
    "source":"cvm.cloud.tencent",
    "subject":"ins-xxxxxx"
    }
    You can also specify multiple resources by using an array.
    {
    "source":"cvm.cloud.tencent",
    "subject":["ins-xxxxxx","ins-xxxxxx"]
    }
    For more information about the matching rules, see Event Pattern.

    3. Configure delivery targets

    In event alarm scenarios, we recommend you configure two delivery targets: CLS and Notification message.
    CLS
    Notification message
    EventBridge provides a dedicated CLS log set for the default Tencent Cloud service event bus, which helps you trace back delivered alarm events.
    
    
    
    Description
    EventBridge offers a free tier of 1 GB per 30 days for storage in the dedicated logset to ensure that you can view and manage basic alarm events free of charge. Excessive storage will be billed according to the CLS billing rules. For more information, see Billing Overview.
    
    You can configure a notification message to push your alarm events in the specified delivery method to promptly reach users.
    
    
    

    4. Test the configuration result

    After completing the configuration, return to the EventBridge console, select the bound event bus, and click Deliver Event. You can select a bound event rule template and click Deliver Event for test.
    Note
    The test template displays only the data field, while other fields are fixed and cannot be customized.
    
    After completing the configuration, you can view and configure the push of alarm events in the EventBridge console.

    Sample push content text

    Email content:
    ${ProductName} Alarm Notification
    Dear user,
    
    An alarm is triggered for Tencent Cloud ${ProductName} under your account (Account ID: ${1}; Name: ${2}). Check and resolve the issue in time.
    
    Alert event: ${EventType}
    Service: ${ProductName}
    Resource: ${Subject}
    Region: ${Region}
    Event occurrence time: ${Time}
    Event status: ${} (It can be `error`, `recovered`, or `stateless`)
    
    For more details, log in to the EventBridge console.
    Sample HTTP callback content:
    {
    "sessionId": "xxxxxxxxxxxxxxxx", // Event ID
    "alarmStatus": "1",//Event.Status
    "alarmType": "event",// The value is fixed, indicating an event alert
    "alarmObjInfo": {
    "region": "sh", // Event region
    "dimensions": { // Additional description of the resource, which is subjected to the related Tencent Cloud service (CVM here)
    "unInstanceId": "ins-xxxxx",
    "objDetail": {
    "deviceLanIp": "xxxx",
    "deviceWanIp": ""
    "uniqVpcId": "vpc-xxx"
    },
    
    "deviceName": "xxx"
    }
    },
    "alarmPolicyInfo": { // Alarm policy information, which is compatible with existing TCOP callbacks
    "policyName": "xxxx", // EventBridge event rule name
    "conditions": {
    "productName": "cvm", // Abbreviation of the related Tencent Cloud service
    "eventName": "guest_reboot", // Event type
    "alarmNotifyType": "", // It is left empty and is compatible with existing TCOP callbacks
    "alarmNotifyPeriod": "" // It is left empty and is compatible with existing TCOP callbacks
    }
    },
    "additionalMsg": [{ // Additional information of the event, which is determined by the event reporter (CVM here)
    "key": "alias",
    "value": "xxxx"
    }, {
    "key": "deviceLanIp",
    "value": "xxxx"
    }, {
    "key": "deviceWanIp",
    "value": ""
    }, {
    "key": "uniqVpcId",
    "value": ""
    }],
    "firstOccurTime": "2021-10-19 11:15:47", // Alerted time
    "durationTime": 0, // Duration
    "recoverTime": "0" // Recovery time
    
    }
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support