Skip to content

Adds POST event v2 alert example #30899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 21 additions & 38 deletions content/en/api/v2/events/request.CreateEvent.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,37 @@
{
"data": {
"type": "event",
"attributes": {
"aggregation_key": "aggregation_key_123",
"attributes": {
"author": {
"name": "[email protected]",
"type": "user"
"custom": {
"threshold": 95,
"current_value": 98,
"metric": "cpu.utilization"
},
"change_metadata": {
"dd": {
"team": "datadog_team",
"user_email": "[email protected]",
"user_id": "datadog_user_id",
"user_name": "datadog_username"
"links": [
{
"category": "runbook",
"title": "CPU Alert Runbook",
"url": "https://example.com/runbooks/cpu-alert"
},
"resource_link": "datadog.com/feature/fallback_payments_test"
},
"changed_resource": {
"name": "fallback_payments_test",
"type": "feature_flag"
},
"impacted_resources": [
{
"name": "payments_api",
"type": "service"
"category": "dashboard",
"url": "https://example.com/dashboards/cpu-usage"
}
],
"new_value": {
"enabled": true,
"percentage": "50%",
"rule": {
"datacenter": "devcycle.us1.prod"
}
},
"prev_value": {
"enabled": true,
"percentage": "10%",
"rule": {
"datacenter": "devcycle.us1.prod"
}
}
"priority": "2",
"status": "error"
},
"category": "change",
"category": "alert",
"integration_id": "custom-events",
"message": "payment_processed feature flag has been enabled",
"message": "CPU usage exceeded the 95% threshold for more than 5 minutes.",
"tags": [
"env:api_client_test"
"env:production",
"team:infrastructure"
],
"title": "payment_processed feature flag updated"
},
"type": "event"
"timestamp": "2025-08-05T10:30:00Z",
"title": "High CPU usage on production nodes"
}
}
}
54 changes: 54 additions & 0 deletions content/en/api/v2/events/request.CreateEvent_change.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"data": {
"attributes": {
"aggregation_key": "aggregation_key_123",
"attributes": {
"author": {
"name": "[email protected]",
"type": "user"
},
"change_metadata": {
"dd": {
"team": "datadog_team",
"user_email": "[email protected]",
"user_id": "datadog_user_id",
"user_name": "datadog_username"
},
"resource_link": "datadog.com/feature/fallback_payments_test"
},
"changed_resource": {
"name": "fallback_payments_test",
"type": "feature_flag"
},
"impacted_resources": [
{
"name": "payments_api",
"type": "service"
}
],
"new_value": {
"enabled": true,
"percentage": "50%",
"rule": {
"datacenter": "devcycle.us1.prod"
}
},
"prev_value": {
"enabled": true,
"percentage": "10%",
"rule": {
"datacenter": "devcycle.us1.prod"
}
}
},
"category": "change",
"integration_id": "custom-events",
"message": "payment_processed feature flag has been enabled",
"tags": [
"env:api_client_test"
],
"title": "payment_processed feature flag updated"
},
"type": "event"
}
}
9 changes: 7 additions & 2 deletions data/api/v2/CodeExamples.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,12 @@
{
"group": "events",
"suffix": "",
"description": "Post an event returns \"OK\" response"
"description": "Example"
},
{
"group": "events",
"suffix": "_change",
"description": "Example 2"
}
],
"SearchEvents": [
Expand Down Expand Up @@ -1599,4 +1604,4 @@
"description": "Update an existing Workflow returns \"Successfully updated a workflow.\" response"
}
]
}
}
Loading