tencent cloud

Feedback

Creating Event Rule

Last updated: 2022-07-11 15:57:31

    Overview

    TencentDB for Redis has been connected to Cloud Monitor (CM) to report cloud monitoring events. All events will be automatically delivered to the Tencent Cloud service event bus in EventBridge.

    Cloud monitoring events

    Currently, the following events can be reported:

    Event Name Type Dimension Recoverable Description Solution and Suggestion
    Master/Replica switch MasterSlaveSwitched Status change TencentDB for Redis instance No A failover occurs in TencentDB for Redis. The failure will cause the TencentDB for Redis service to become inaccessible and momentarily unavailable. Make sure that your business has an automatic reconnection mechanism for quick business recovery.
    Unavailable service ServiceNotAvailable Exception TencentDB for Redis instance Yes The TencentDB for Redis service is unavailable due to a failure. We will recover the service as soon as possible and send a service recovery notification. If you have a disaster recovery instance, try switching your business to it.
    Read-only replica failover ReadonlyReplicaSwitched Status change TencentDB for Redis instance Yes A failover occurs in the TencentDB for Redis read-only replica. We will recover the service as soon as possible and send a service recovery notification. If you have a disaster recovery instance, try switching your business to it. You can also add more read-only replicas.
    Unavailable read-only replica ReadonlyReplicaNotAvailable Exception TencentDB for Redis instance Yes A failure occurs in the TencentDB for Redis read-only replica. We will recover the service as soon as possible and send a service recovery notification. If you have a disaster recovery instance, try switching your business to it. You can also add more read-only replicas.

    Delivery target

    An event rule can have multiple delivery targets. Before creating an event rule, plan the delivery target types first. Currently, EventBridge supports the following delivery targets:

    Billing Details

    EventBridge is pay-as-you-go. For more information, see Product Pricing.

    Billing mode Pay-as-you-go
    Payment mode Fees are charged hourly by the number of events actually delivered to the event bus.
    Billing unit CNY/million events
    Scenario Low or fluctuating message volumes

    Directions

    1. Log in to the EventBridge console and select Event rule on the left sidebar.
    2. At the top of the page on the right, select Guangzhou for Region and select default in the Event bus drop-down list.
    • The Tencent Cloud service event bus collects monitoring and audit events generated by Tencent Cloud services in all regions. It is created in Guangzhou region by default and cannot be deleted.
    • Select Event bus on the left sidebar. In the event bus list, click default, and you can see that the default event bus already contains TencentDB for Redis. For detailed directions, see Tencent Cloud Service Event Source.
    1. Click Create event rule. On the Rule pattern page, configure parameters by referring to the following descriptions:

      SectionParameterDescription
      Basic information Region The region where to create an event rule.
      Event bus Information of the event bus to which the event rule belongs.
      Rule nameEvent rule name, which can contain 2–60 letters, digits, underscores, and hyphens and must start with a letter and end with a digit or letter.
      Rule descriptionBrief description of the event rule.
      Event matching Rule patternSelect Default.
      Tencent Cloud serviceSelect TencentDB for Redis in the drop-down list.
      Event typeSelect a supported event type.
      Rule pattern previewYou can preview the event rule.
    2. Click Test Event Matching and select an event template in the drop-down list after Template. The fields of this event type are displayed in Event fields. Click Test to test the network connectivity of the defined event type.

    3. (Optional) To convert the data format, select Enable data conversion to enter the event transformation page as shown below. Configure the data conversion formats and fields according to the parameter descriptions in the following table and click OK to start parsing the data. After data parsing is completed, set the filter rule and data processing method. For detailed directions, see Configuring Data Conversion.

      Note:

      EventBridge provides the simple data processing feature. You only need to pass in data and configuration items, and this feature can format the data, return the processed structured data, and distribute it to downstream targets, connecting data sources to data processing systems.

      ParameterDescription
      Rule pattern preview If you select Sample event, you can use an event template. If you select **Manually input**, you can customize the event fields in the input box below.
      Event template This parameter will be displayed if you select Sample event for Rule pattern preview. You can search for "Redis" in the drop-down list and select the TencentDB for Redis event template. Then, the specific field information of the event template will be displayed in the input box below.
      Target
      • All events: The complete structure of event fields will be routed to the delivery target.
      • Specified events: EventBridge will extract event parameters according to the event fields configured in `JSONPath` to route the specified event fields to the delivery target.
      JSONPath This parameter will be displayed if **Specified events** is selected for **Target**. Enter the event fields to be converted in the input box.
      Parsing mode Select a parsing mode, which can be **JSON**, **Separator**, or **Extract with regex**.
    4. Click Next to select the delivery target bound to the rule. You can deliver collected events to the specified target to process and consume them. In the figure below, Notification message is selected for Trigger method as an example.

    5. To make the event rule take effect immediately, select Enable event rules now and click Complete.

    Event Rule APIs

    API Description
    CheckRule Checks a rule.
    CreateRule Creates an event rule.
    DeleteRule Deletes an event rule.
    GetRule Gets the event rule details.
    ListRules Gets the list of event rules.
    UpdateRule Updates an event rule.

    More Operations

    You can view, edit, and delete event rules. For more information, see Managing Event Rule.

    FAQs

    For FAQs about event rule concepts and billing, see FAQs.

    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