tencent cloud

Tencent Cloud Observability Platform

Release Notes and Announcements
Release Notes
Product Introduction
Overview
Strengths
Basic Features
Basic Concepts
Use Cases
Use Limits
Purchase Guide
Tencent Cloud Product Monitoring
Application Performance Management
Mobile App Performance Monitoring
Real User Monitoring
Cloud Automated Testing
Prometheus Monitoring
Grafana
EventBridge
PTS
Quick Start
Monitoring Overview
Instance Group
Tencent Cloud Product Monitoring
Application Performance Management
Real User Monitoring
Cloud Automated Testing
Performance Testing Service
Prometheus Getting Started
Grafana
Dashboard Creation
EventBridge
Alarm Service
Cloud Product Monitoring
Tencent Cloud Service Metrics
Operation Guide
CVM Agents
Cloud Product Monitoring Integration with Grafana
Troubleshooting
Practical Tutorial
Application Performance Management
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Parameter Information
FAQs
Mobile App Performance Monitoring
Overview
Operation Guide
Access Guide
Practical Tutorial
Tencent Cloud Real User Monitoring
Product Introduction
Operation Guide
Connection Guide
FAQs
Cloud Automated Testing
Product Introduction
Operation Guide
FAQs
Performance Testing Service
Overview
Operation Guide
Practice Tutorial
JavaScript API List
FAQs
Prometheus Monitoring
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Terraform
FAQs
Grafana
Product Introduction
Operation Guide
Guide on Grafana Common Features
FAQs
Dashboard
Overview
Operation Guide
Alarm Management
Console Operation Guide
Troubleshooting
FAQs
EventBridge
Product Introduction
Operation Guide
Practical Tutorial
FAQs
Report Management
FAQs
General
Alarm Service
Concepts
Monitoring Charts
CVM Agents
Dynamic Alarm Threshold
CM Connection to Grafana
Documentation Guide
Related Agreements
Application Performance Management Service Level Agreement
APM Privacy Policy
APM Data Processing And Security Agreement
RUM Service Level Agreement
Mobile Performance Monitoring Service Level Agreement
Cloud Automated Testing Service Level Agreement
Prometheus Service Level Agreement
TCMG Service Level Agreements
PTS Service Level Agreement
PTS Use Limits
Cloud Monitor Service Level Agreement
API Documentation
History
Introduction
API Category
Making API Requests
Monitoring Data Query APIs
Alarm APIs
Legacy Alert APIs
Notification Template APIs
TMP APIs
Grafana Service APIs
Event Center APIs
TencentCloud Managed Service for Prometheus APIs
Monitoring APIs
Data Types
Error Codes
Glossary

Quickly Delivering Custom Events

PDF
Focus Mode
Font Size
Last updated: 2024-10-17 21:20:37

Overview

Cloud service monitoring events and Cloud Audit events generated by official Tencent Cloud services are delivered to the Tencent Cloud service event bus. Events generated by your own applications are delivered to custom event buses. You can create custom event buses and configure event connectors to deliver custom events. Alternatively, you can use an API/SDK to deliver custom events. This document describes how to deliver custom events by using an event connector.
Note
In addition to using an event connector, you can call an API to deliver custom events.

Delivering Custom Events

Step 1. Create a custom event bus

1. Log in to the EventBridge console and click Create event bus.

2. Enter the event bus name and description.

3. Click OK.

Step 2. Create an event connector

1. On the Event Bus page, click the name of the custom event bus to enter the event bus details page.

2. On the event bus details page, click Add in the Event connector section.

3. Set parameters as prompted. A CKafka event connector is taken as an example in the following figure:



Set Connector type to CMQ (Kafka), set other parameters as needed, and click OK. For more information about how to configure other types of connectors, see Overview.
4. Click OK. After the configuration is completed, the event connector can pull a message from CKafka, generate an event based on the message content, and deliver the event to the event bus. Taking the message "Hello from Ckafka again!" as an example, the event connector generates the following event:
{
"specversion":"1.0",
"id":"13a3f42d-7258-4ada-da6d-******3b4662",
"type":"connector:kafka",
"source":"ckafka.cloud.tencent",
"subject": "qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456",
"time":"1615430559146",
"region":"ap-guangzhou",
"datacontenttype":"application/json;charset=utf-8",
"data":{
"topic":"test-topic",
"Partition":1,
"offset":37,
"msgKey":"test",
"msgBody":"Hello from Ckafka again!"
}
}
For more information about the event format, see Event Structure.
Note
Currently, only delivery for Tencent Cloud CKafka instances is supported. Confirm that no username or password is configured for your CKafka instances. Otherwise, the connector may fail to get messages.

Step 3. Create an event rule

1. Click Event rule in the left sidebar.
2. At the top of the Event rule page, select the created event bus from the Event Bus drop-down list and click Create event rule.
3. Set parameters as prompted.



This event pattern means to receive all messages that are from CKafka. For more information about how to create an event pattern, see Event Pattern.
4. Click Next and configure the event target, which can be Serverless Cloud Function (SCF), Cloud Log Service (CLS), message pushing service, or CKafka Target. SCF is taken as an example in the following figure. Event content will be delivered to SCF as parameters.



The test function here is to print the events received, and you can write your function based on the actual business scenario. Alternatively, you can quickly deliver events to CKafka or a downstream SaaS service through a template function provided by the platform. For more information, see SCF Target.

Step 4. Test an event

After sending a message to the target topic, you can see the following information on the corresponding SCF log page:
START RequestId:79e6d53e-7a98-11ec-8f0d-******4284e2
Received event: {
"data": {
"Partition": 1,
"msgBody": "Hello from Ckafka again!",
"msgKey": "test",
"offset": 37,
"topic": "target-topic"
},
"datacontenttype": "application/json;charset=utf-8",
"id": "13a3f42d-7258-4ada-da6d-******3b4662",
"region": "ap-guangzhou",
"source": "ckafka.cloud.tencent",
"specversion": "0",
"status": "",
"subject": "qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456",
"tags": null,
"time": 1615430559146,
"type": "connector:kafka"
}

Step 5. Trace the event delivery history

EventBridge provides the event tracing capability. After enabling linkage tracing, you can view the event delivery history on the event query page of an event bus. If the event tracing mode is set to Default, only the matched events that failed to be delivered to the downstream can be queried. If you want to query all events, choose Event Bus > Event Tracking, set the delivery type to All logs, and select Always report logs of rule matching failures.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback