External Event Monitor Event Acceptance¶
POST /api/v1/push-events/{secret}/{subUri}
Overview¶
Receives an external event and generates corresponding event data.
Note: If the secret and subUri information does not match the records in the monitor, the 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 | Extra data, which will eventually be added to the df_meta.extra_data field of the event.Allow empty: False $required: False |
Parameter Supplementary Explanation¶
Parameter explanation:
Body request parameter main structure explanation
| Parameter Name | Parameter Type | Required | Parameter Description |
|---|---|---|---|
| event | json | Yes | Event data |
| extraData | json | No | Extra data, which will eventually be added to the df_meta.extra_data field of the event. Conforms to key:value format. |
Event request parameter main structure explanation
| Parameter Name | Parameter Type | Required | Parameter Description |
|---|---|---|---|
| date | int | No | Event time (unit: seconds) |
| status | string | Yes | Event status, options: fatal, 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 fields | str | No | 2024-09-04 User-defined fields, as top-level fields of the event, must meet the restriction conditions. |
event.{User-defined fields} Restriction Condition Explanation
To avoid issues caused by fields with the same name reporting different data types, user-defined fields must meet the following restrictions:
- Field values must be of string type (e.g., "abc", "123").
- Field names must not start with an underscore
_ordf_. - Field names must not duplicate the field names after unpacking
dimension_tagsorlabels. - Field names must not use the following reserved fields (it is recommended that all custom fields start with a self-defined prefix, such as
ext_xxx,biz_xxx, etc., for distinction):- 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.truewatch.com/api/v1/push-events/<secret>/<subUri>' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"event":{"status":"warning","title":"title1","message":"message1","dimension_tags":{"heros":"caiwenji"},"check_value":20},"extraData":{"name":"xxxxxxxx"}}' \
--compressed