[External Event Monitor] Event Acceptance¶
POST /api/v1/push-events/{secret}/{subUri}
Overview¶
Accept an external event and generate corresponding event data based on the event.
Note: When the secret
and subUri
information does not match the information recorded in the monitor, this event will be ignored.
Route Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
secret | string | Y | External event monitor secret (corresponds to the secret field when creating a monitor; if this value does not match the monitor configuration, the event will be ignored) |
subUri | string | Y | External event monitor subUri (corresponds to the jsonScript.subUri field when creating a monitor; if this value does not match the monitor configuration, the event will be ignored) |
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
event | json | Y | Event data Allow empty: False |
extraData | json | Additional data that will eventually be added to the df_meta.extra_data field of the event Allow empty: False $required: False |
Parameter Supplemental Notes¶
Body Request Parameter Structure Explanation¶
Parameter Name | Parameter Type | Required | Parameter Description |
---|---|---|---|
event | json | Yes | Event data |
extra_data | json | No | Additional data that will eventually be added to the df_meta.extra_data field of the event. Must follow key:value format |
Event Request Parameter Structure Explanation¶
Parameter Name | Parameter Type | Required | Parameter Description |
---|---|---|---|
date | int | No | Event time (unit: seconds) |
status | string | Yes | Event status, options: critical, error, warning, info, ok |
title | string | No | Event title |
message | string | No | Event content |
dimension_tags | json | No | Dimension tags, e.g., |
check_value | float | No | Detection value |
User-defined Field | str | No | User-defined fields as top-level event fields, must meet restriction conditions |
Restrictions for event.{User-defined Field}
¶
To avoid issues caused by reporting different types for the same field name, user-defined fields must meet the following restrictions:
- The field value must be of string type (e.g., "abc", "123")
- The field name must not start with an underscore
_
ordf_
- The field name must not conflict with the decomposed field names of
dimension_tags
orlabels
- The field name must not use the following reserved fields (it is recommended to prefix all custom fields with your own prefix, such as
ext_xxx
,biz_xxx
, etc., to distinguish them):- date
- status
- source
- title
- message
- dimension_tags
- check_value
- time
- time_us
- timestamp
- workspace_uuid
- workspace_name
- extra_data
- create_time
Request Example¶
curl 'https://openapi.guance.com/api/v1/push-events/<secret>/<subUri>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"event":{"status":"warning","title":"External Event Monitor Test 1","message":"Hello, this is the message from the external event monitor","dimension_tags":{"heros":"caiwenji"},"check_value":20},"extraData":{"name":"xxxxxxxx"}}' \
--compressed