External Event Monitor Event Acceptance¶
POST /api/v1/push-events/{secret}/{subUri}
Overview¶
Receive an external event and generate corresponding event data based on the event.
Note, when the secret and subUri information do not match the information recorded 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 in the new 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 in the new 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 be added to the df_meta.extra_data field of the event Allow empty: False $required: False |
Parameter Additional Explanation¶
Parameter explanation:
Body request parameter structure explanation
| Parameter Name | Parameter Type | Required | Parameter Explanation |
|---|---|---|---|
| event | json | Y | Event data |
| extraData | json | N | Additional data that will be added to the df_meta.extra_data field of the event, must conform to key:value |
Event request parameter structure explanation
| Parameter Name | Parameter Type | Required | Parameter Explanation |
|---|---|---|---|
| date | int | N | Event time (unit: seconds) |
| status | string | Y | Event status, options: critical, error, warning, info, ok |
| title | string | N | Event title |
| message | string | N | Event content |
| dimension_tags | json | N | Dimension tags, e.g., |
| check_value | float | N | Check value |
| User-defined fields | str | N | 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 types, user-defined fields must meet the following restriction conditions:
- Field value must be of string type (e.g., "abc", "123")
- Field name must not start with underscore _ or df_
- Field name must not be the same as dimension_tags decomposed field names, labels decomposed field names
- Field name 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