Skip to content

External Event Monitor Event Acceptance



POST /api/v1/push-events/{secret}/{subUri}

Overview

Receives an external event and generates corresponding event data based on the event. Note: If 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
Allowed to be empty: False
extraData json Extra data, will be added to the event's df_meta.extra_data field
Allowed to be empty: False
$required: False

Parameter Supplementary Explanation

Parameter description:

Main structure description of body request parameters

Parameter Name Parameter Type Required Parameter Description
event json Yes Event data
extraData json No Extra data, will be added to the event's df_meta.extra_data field. Conforms to key:value format.

Main structure description of event request parameters

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 Check value
User-defined fields str No User-defined fields (added 2024-09-04), as top-level event fields, must satisfy the restriction conditions.

Restriction conditions for event.{user-defined fields}

To avoid issues caused by fields with the same name reporting different data types, user-defined fields must satisfy the following restrictions:

  1. Field values must be of string type (e.g., "abc", "123")
  2. Field names must not start with an underscore _ or df_
  3. Field names must not conflict with decomposed field names from dimension_tags or labels
  4. 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.guance.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

Response

{
    "code": 200,
    "content": {
        "data": {},
        "error": 200,
        "message": "",
        "ok": true,
        "reqCost": 458,
        "reqTime": "2023-10-19T07:26:30.743Z",
        "respTime": "2023-10-19T07:26:31.201Z",
        "traceId": "7390361544936022329"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "7390361544936022329"
} 

Feedback

Is this page helpful? ×