Skip to content

Alibaba Cloud EventBridge Best Practices


This article explains how to integrate the content of Alibaba Cloud EventBridge into the Guance platform, leveraging Guance's powerful unified aggregation capabilities to easily obtain Alibaba Cloud events and track the latest data information in real time.

Background Information

EventBridge is a serverless event bus service provided by Alibaba Cloud. It supports standardized and centralized access for Alibaba Cloud services, custom applications, and SaaS applications, enabling these applications to route events using the standard CloudEvents 1.0 protocol. This helps you easily build loosely coupled, distributed event-driven architectures. However, for multi-cloud environments or even traditional IDC + cloud service hybrid architectures, customers prefer to consolidate cloud events, metrics, logs, traces, etc., for comprehensive orchestration. The Guance platform provides this capability.

Prerequisites

You have completed the following operations:

  • Installed DataKit; for detailed steps, refer to <Host DataKit Installation>
  • Enabled Alibaba Cloud EventBridge (currently free during public beta)
  • Allowed port 9529 in the server security group

Use Cases

Push event information through EventBridge's built-in HTTP service to Guance.

Step One: Modify DataKit Listening Port

  1. Edit the main DataKit configuration file /usr/local/datakit/conf.d/datakit.conf on your server:
[http_api]
  listen = "0.0.0.0:9529"
  1. Restart DataKit:
    systemctl restart datakit
    

Step Two: Create an EventBridge Rule

  1. Log in to the Alibaba Cloud EventBridge Console

  2. Select "EventBus" - "default" - "Event Rules"

image.png

  1. Create a rule, configure basic information, enter a name and description, then click "Next"

image.png

  1. Configure the event pattern, select "Alibaba Cloud Official Event Source," choose the desired "Event Source" and "Event Type"

image.png

  1. After selection, you can test the event pattern, then click "Next"

image.png

  1. Configure the event target, set "Service Type" to HTTP, "URL" to DataKit Logging API Address, and "Body" to Template

image.png

  1. When "Body" is set to Template, define the variables and custom template as per Alibaba Cloud Template Documentation

  2. Variables: Extract parameters from the original cloud event data using JSONPath with "$."

  3. Template: Reference variables using "${}" and ensure the format complies with the DataKit API Specification

image.png

  1. Set "Network Type" to Public Network, then click "Confirm"

image.png

  1. Log in to Guance, navigate to the "Logs" module to view the generated events

  2. measurement: Data source

  3. message: Log content
  4. fields: Extended fields

image.png

Data Validation

  • Event Tracking > Event Details, view the original cloud event data

image.png

image.png

  • Event Tracking > Event Trace, verify if the event was delivered successfully

image.png

image.png

  • Check data reception status on the server at /var/log/datakit/gin.log

image.png

<Alibaba Cloud EventBridge Product Introduction>

<Guance DataKit API Development Documentation>

Feedback

Is this page helpful? ×