Skip to content
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
8 changes: 8 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20219,6 +20219,13 @@ components:
$ref: '#/components/schemas/EventPayloadAttributes'
category:
$ref: '#/components/schemas/EventCategory'
host:
description: Host name to associate with the event. Any tags associated
with the host are also applied to this event. Limited to 255 characters.
example: hostname
maxLength: 255
minLength: 1
type: string
integration_id:
$ref: '#/components/schemas/EventPayloadIntegrationId'
message:
Expand Down Expand Up @@ -67608,6 +67615,7 @@ paths:
rule:
datacenter: devcycle.us1.prod
category: change
host: hostname
integration_id: custom-events
message: payment_processed feature flag has been enabled
tags:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2025-06-10T15:38:58.529Z"
"2025-12-10T21:31:06.468Z"
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"entries": [
{
"_id": "b35f8f8450dc70b83d7661b05817ff7e",
"_id": "df20247753285206f854ba0313ce3ab1",
"_order": 0,
"cache": {},
"request": {
"bodySize": 867,
"bodySize": 886,
"cookies": [],
"headers": [
{
Expand All @@ -26,13 +26,13 @@
"value": "application/json"
}
],
"headersSize": 592,
"headersSize": 590,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"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\":\"invalid\",\"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\"}}"
"text": "{\"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\":\"invalid\",\"host\":\"test-host\",\"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\"}}"
},
"queryString": [],
"url": "https://event-management-intake.datadoghq.com/api/v2/events"
Expand All @@ -57,8 +57,8 @@
"status": 400,
"statusText": "Bad Request"
},
"startedDateTime": "2025-06-10T15:38:58.757Z",
"time": 189
"startedDateTime": "2025-12-10T21:31:06.473Z",
"time": 204
}
],
"pages": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2025-06-10T15:38:58.954Z"
"2025-12-10T21:30:25.683Z"
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"entries": [
{
"_id": "12f2ce8ce9b919c06a471c2b7d261fb3",
"_id": "7b0f8268441829ad8e3e52424c7477bd",
"_order": 0,
"cache": {},
"request": {
"bodySize": 866,
"bodySize": 885,
"cookies": [],
"headers": [
{
Expand All @@ -32,17 +32,17 @@
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"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\"}}"
"text": "{\"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\",\"host\":\"test-host\",\"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\"}}"
},
"queryString": [],
"url": "https://event-management-intake.datadoghq.com/api/v2/events"
},
"response": {
"bodySize": 191,
"bodySize": 218,
"content": {
"mimeType": "application/json",
"size": 191,
"text": "{\"data\":{\"attributes\":{\"attributes\":{\"evt\":{\"uid\":\"AZdafqaTAACKG_iMQ82pmAAA\"}}},\"id\":\"_\",\"type\":\"event\"},\"links\":{\"self\":\"https://app.datadoghq.com/event/event?uid=AZdafqaTAACKG_iMQ82pmAAA\"}}"
"size": 218,
"text": "{\"data\":{\"attributes\":{\"attributes\":{\"evt\":{\"id\":\"8407723285051133019\",\"uid\":\"AZsKLCxvAACrUQTfNDwMWwAA\"}}},\"id\":\"_\",\"type\":\"event\"},\"links\":{\"self\":\"https://app.datadoghq.com/event/event?uid=AZsKLCxvAACrUQTfNDwMWwAA\"}}"
},
"cookies": [],
"headers": [
Expand All @@ -57,8 +57,8 @@
"status": 202,
"statusText": "Accepted"
},
"startedDateTime": "2025-06-10T15:38:58.956Z",
"time": 212
"startedDateTime": "2025-12-10T21:30:25.687Z",
"time": 1083
}
],
"pages": [],
Expand Down
4 changes: 2 additions & 2 deletions features/v2/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ Feature: Events
@team:DataDog/event-management
Scenario: Post an event returns "Bad request" response
Given new "CreateEvent" request
And body with value {"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": "invalid", "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"}}
And body with value {"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": "invalid", "integration_id": "custom-events", "host": "test-host", "message": "payment_processed feature flag has been enabled", "tags": ["env:api_client_test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
When the request is sent
Then the response status is 400 Bad request

@skip-validation @team:DataDog/event-management
Scenario: Post an event returns "OK" response
Given new "CreateEvent" request
And body with value {"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"}}
And body with value {"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", "host": "test-host", "message": "payment_processed feature flag has been enabled", "tags": ["env:api_client_test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
When the request is sent
Then the response status is 202 OK
And the response "data.type" is equal to "event"
Expand Down
8 changes: 8 additions & 0 deletions services/events/src/v2/models/EventPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export class EventPayload {
* Event category identifying the type of event.
*/
"category": EventCategory;
/**
* Host name to associate with the event. Any tags associated with the host are also applied to this event. Limited to 255 characters.
*/
"host"?: string;
/**
* Integration ID sourced from integration manifests.
*/
Expand Down Expand Up @@ -66,6 +70,10 @@ export class EventPayload {
type: "EventCategory",
required: true,
},
host: {
baseName: "host",
type: "string",
},
integrationId: {
baseName: "integration_id",
type: "EventPayloadIntegrationId",
Expand Down