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
1 change: 1 addition & 0 deletions examples/v2/events/CreateEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static void main(String[] args) {
"{'datacenter': 'devcycle.us1.prod'}")))))
.category(EventCategory.CHANGE)
.integrationId(EventPayloadIntegrationId.CUSTOM_EVENTS)
.host("test-host")
.message("payment_processed feature flag has been enabled")
.tags(Collections.singletonList("env:api_client_test"))
.title("payment_processed feature flag updated"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
EventPayload.JSON_PROPERTY_AGGREGATION_KEY,
EventPayload.JSON_PROPERTY_ATTRIBUTES,
EventPayload.JSON_PROPERTY_CATEGORY,
EventPayload.JSON_PROPERTY_HOST,
EventPayload.JSON_PROPERTY_INTEGRATION_ID,
EventPayload.JSON_PROPERTY_MESSAGE,
EventPayload.JSON_PROPERTY_TAGS,
Expand All @@ -39,6 +40,9 @@ public class EventPayload {
public static final String JSON_PROPERTY_CATEGORY = "category";
private EventCategory category;

public static final String JSON_PROPERTY_HOST = "host";
private String host;

public static final String JSON_PROPERTY_INTEGRATION_ID = "integration_id";
private EventPayloadIntegrationId integrationId;

Expand Down Expand Up @@ -138,6 +142,28 @@ public void setCategory(EventCategory category) {
this.category = category;
}

public EventPayload host(String host) {
this.host = host;
return this;
}

/**
* Host name to associate with the event. Any tags associated with the host are also applied to
* this event. Limited to 255 characters.
*
* @return host
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_HOST)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getHost() {
return host;
}

public void setHost(String host) {
this.host = host;
}

public EventPayload integrationId(EventPayloadIntegrationId integrationId) {
this.integrationId = integrationId;
this.unparsed |= !integrationId.isValid();
Expand Down Expand Up @@ -273,6 +299,7 @@ public boolean equals(Object o) {
return Objects.equals(this.aggregationKey, eventPayload.aggregationKey)
&& Objects.equals(this.attributes, eventPayload.attributes)
&& Objects.equals(this.category, eventPayload.category)
&& Objects.equals(this.host, eventPayload.host)
&& Objects.equals(this.integrationId, eventPayload.integrationId)
&& Objects.equals(this.message, eventPayload.message)
&& Objects.equals(this.tags, eventPayload.tags)
Expand All @@ -283,7 +310,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
aggregationKey, attributes, category, integrationId, message, tags, timestamp, title);
aggregationKey, attributes, category, host, integrationId, message, tags, timestamp, title);
}

@Override
Expand All @@ -293,6 +320,7 @@ public String toString() {
sb.append(" aggregationKey: ").append(toIndentedString(aggregationKey)).append("\n");
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" host: ").append(toIndentedString(host)).append("\n");
sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
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 @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"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\"}}"
"json": "{\"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\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -27,6 +27,6 @@
"timeToLive": {
"unlimited": true
},
"id": "b35f8f84-50dc-70b8-3d76-61b05817ff7e"
"id": "df202477-5328-5206-f854-ba0313ce3ab1"
}
]
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 @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"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\"}}"
"json": "{\"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\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"attributes\":{\"attributes\":{\"evt\":{\"uid\":\"AZdafqaTAACKG_iMQ82pmAAA\"}}},\"id\":\"_\",\"type\":\"event\"},\"links\":{\"self\":\"https://app.datadoghq.com/event/event?uid=AZdafqaTAACKG_iMQ82pmAAA\"}}",
"body": "{\"data\":{\"attributes\":{\"attributes\":{\"evt\":{\"id\":\"8407723285051133019\",\"uid\":\"AZsKLCxvAACrUQTfNDwMWwAA\"}}},\"id\":\"_\",\"type\":\"event\"},\"links\":{\"self\":\"https://app.datadoghq.com/event/event?uid=AZsKLCxvAACrUQTfNDwMWwAA\"}}",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,6 +27,6 @@
"timeToLive": {
"unlimited": true
},
"id": "12f2ce8c-e9b9-19c0-6a47-1c2b7d261fb3"
"id": "7b0f8268-4418-29ad-8e3e-52424c7477bd"
}
]
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
Loading