Skip to content

Alibaba Cloud EventBridge Best Practices


This article describes how to ingest Alibaba Cloud EventBridge events into the Guance platform. By leveraging the powerful unified aggregation capabilities of Guance, you can easily obtain Alibaba Cloud events and track the latest data information in real time.

Background

EventBridge is a serverless event bus service provided by Alibaba Cloud. It supports centralized, standardized access for Alibaba Cloud services, custom applications, and SaaS applications, and routes events between these applications using the standardized CloudEvents 1.0 protocol. This helps you build loosely coupled, distributed event-driven architectures. However, in multi-cloud environments or even traditional IDC + cloud service hybrid architectures, customers often want to aggregate cloud events, metrics, logs, and traces in one place for unified orchestration. The Guance platform provides exactly this capability.

Prerequisites

You have completed the following:

  • Installed DataKit. For details, see Install DataKit on a Host.
  • Enabled Alibaba Cloud EventBridge (currently free during public beta).
  • Allowed port 9529 in the server security group.

Use Cases

Push event information to Guance via the built-in HTTP service of EventBridge.

Step 1: Modify DataKit Listening Port

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

Step 2: Create an EventBridge Rule

  1. Log in to the Alibaba Cloud EventBridge console.

  2. Select Event Bus > default > Event Rules.

image.png

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

image.png

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

image.png

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

image.png

  1. Configure the event target. Select Service Type as HTTP, URL as the DataKit log API address, and Body as Template.

image.png

  1. When Body is Template, you need to define the variables in the template and the custom template. Alibaba Cloud template documentation

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

  3. Template: Reference variables using ${}. The format must comply with the DataKit API specification

image.png

  1. Select Network Type as Public Network, then click Confirm.

image.png

  1. Log in to Guance, click the Logs module, and view the generated events.

  2. measurement: Data source

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

image.png

Data Verification

  • Event Tracing > Event Details: View the raw cloud event data.

image.png

image.png

  • Event Tracing > Event Trajectory: Check whether the event was delivered successfully.

image.png

image.png

  • On the server, check /var/log/datakit/gin.log to see data reception status.

image.png

<Alibaba Cloud EventBridge Product Overview>

<Guance DataKit API Development Documentation>

Feedback

Is this page helpful?