Skip to content

Update events intake specs for v2 events post endpoint #2210

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-02 04:31:15.271278",
"spec_repo_commit": "272cce39"
"regenerated": "2025-05-03 12:36:02.528934",
"spec_repo_commit": "d5e18a51"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-02 04:31:15.291066",
"spec_repo_commit": "272cce39"
"regenerated": "2025-05-03 12:36:02.544567",
"spec_repo_commit": "d5e18a51"
}
}
}
162 changes: 156 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2138,6 +2138,89 @@ components:
- id
- base_severity
type: object
AlertEventCustomAttributes:
additionalProperties: false
description: Object representing custom alert event attributes.
properties:
custom:
$ref: '#/components/schemas/AlertEventCustomAttributesCustom'
links:
$ref: '#/components/schemas/AlertEventCustomAttributesLinks'
priority:
$ref: '#/components/schemas/AlertEventCustomAttributesPriority'
status:
$ref: '#/components/schemas/AlertEventCustomAttributesStatus'
type: object
AlertEventCustomAttributesCustom:
additionalProperties: {}
description: Custom attributes support up to 100 properties and a maximum nesting
depth of 10 levels.
example: {}
type: object
AlertEventCustomAttributesLinks:
description: The links related to the event.
items:
$ref: '#/components/schemas/AlertEventCustomAttributesLinksItems'
maxItems: 20
minItems: 1
type: array
AlertEventCustomAttributesLinksItems:
description: A link.
properties:
category:
$ref: '#/components/schemas/AlertEventCustomAttributesLinksItemsCategory'
title:
description: The title of the link.
example: Runbook Link
maxLength: 300
type: string
url:
description: The URL of the link.
example: https://app.datadoghq.com/runbook
maxLength: 2048
type: string
required:
- url
- category
type: object
AlertEventCustomAttributesLinksItemsCategory:
description: The category of the link.
enum:
- runbook
example: runbook
type: string
x-enum-varnames:
- RUNBOOK
AlertEventCustomAttributesPriority:
description: The priority of the alert.
enum:
- '1'
- '2'
- '3'
- '4'
- '5'
example: '1'
type: string
x-enum-varnames:
- PRIORITY_ONE
- PRIORITY_TWO
- PRIORITY_THREE
- PRIORITY_FOUR
- PRIORITY_FIVE
AlertEventCustomAttributesStatus:
description: The status of the alert.
enum:
- info
- warn
- error
- ok
example: warn
type: string
x-enum-varnames:
- INFO
- WARN
- ERROR
- OK
Annotation:
description: A list of annotations used in the workflow. These are like sticky
notes for your workflow!
Expand Down Expand Up @@ -13949,28 +14032,34 @@ components:
type: string
type: object
EventCategory:
description: Event category to identify the type of event. Only the value `change`
is supported. Support for other categories are coming. please reach out to
datadog support if you're interested.
description: Event category to identify the type of event. For example, `change`
or `alert`.
enum:
- change
- alert
example: change
type: string
x-enum-varnames:
- CHANGE
- ALERT
EventCreateRequest:
description: Object representing an event creation request.
properties:
attributes:
$ref: '#/components/schemas/EventPayload'
type:
$ref: '#/components/schemas/EventCreateRequestType'
required:
- type
- attributes
type: object
EventCreateRequestPayload:
description: Payload for creating an event.
properties:
data:
$ref: '#/components/schemas/EventCreateRequest'
required:
- data
type: object
EventCreateRequestType:
description: Entity type.
Expand All @@ -13985,6 +14074,10 @@ components:
properties:
attributes:
$ref: '#/components/schemas/EventCreateResponseAttributes'
id:
description: Event ID
example: _
type: string
type:
description: Event type
example: event
Expand All @@ -14006,28 +14099,46 @@ components:
EventCreateResponseAttributesAttributesEvt:
description: JSON object of event system attributes.
properties:
id:
description: Event id
uid:
description: Event UID
example: ABCDEFGHIJKLMNOPQRSTUVWX
type: string
type: object
EventCreateResponsePayload:
description: Response containing information about created event.
properties:
data:
$ref: '#/components/schemas/EventCreateResponse'
links:
$ref: '#/components/schemas/EventCreateResponsePayloadLinks'
type: object
EventCreateResponsePayloadLinks:
description: Links attributes.
properties:
self:
description: The URL of the event.
example: https://app.datadoghq.com/event/event?id=123
type: string
type: object
EventPayload:
description: Event attributes.
properties:
aggregation_key:
description: An arbitrary string to use for aggregation when correlating
events. Limited to 100 characters.
example: aggregation_key_123
maxLength: 100
type: string
attributes:
$ref: '#/components/schemas/EventPayloadAttributes'
category:
$ref: '#/components/schemas/EventCategory'
integration_id:
description: Integration IDs sourced from manifests. Examples include custom-events,
containerd, docker, elasticsearch, helm, mongodb, mysql, and nagios. See
the full list of available IDs [here](https://docs.datadoghq.com/getting_started/integrations/).
example: custom-events
type: string
message:
description: The body of the event. Limited to 4000 characters.
example: payment_processed feature flag has been enabled
Expand All @@ -14041,7 +14152,10 @@ components:
- env:test
items:
description: A tag.
maxLength: 200
type: string
maxItems: 100
minItems: 1
type: array
timestamp:
description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
Expand All @@ -14067,6 +14181,7 @@ components:
event category.
oneOf:
- $ref: '#/components/schemas/ChangeEventCustomAttributes'
- $ref: '#/components/schemas/AlertEventCustomAttributes'
EventPriority:
description: The priority of the event's monitor. For example, `normal` or `low`.
enum:
Expand Down Expand Up @@ -45283,7 +45398,8 @@ paths:
- events_read
post:
description: "This endpoint allows you to post events.\n\n\u2705 **Only events
with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking)
with the `change` or `alert` category** are in General Availability. For change
events, see [Change Tracking](https://docs.datadoghq.com/change_tracking)
for more details.\n\n\u274C For use cases involving other event categories,
please use the V1 endpoint."
operationId: CreateEvent
Expand All @@ -45295,6 +45411,7 @@ paths:
value:
data:
attributes:
aggregation_key: aggregation_key_123
attributes:
author:
name: [email protected]
Expand Down Expand Up @@ -45323,6 +45440,7 @@ paths:
rule:
datacenter: devcycle.us1.prod
category: change
integration_id: custom-events
message: payment_processed feature flag has been enabled
tags:
- env:test
Expand Down Expand Up @@ -45356,6 +45474,38 @@ paths:
security:
- apiKeyAuth: []
appKeyAuth: []
servers:
- url: https://{subdomain}.{site}
variables:
site:
default: datadoghq.com
description: The regional site for customers.
enum:
- datadoghq.com
- us3.datadoghq.com
- us5.datadoghq.com
- ap1.datadoghq.com
- datadoghq.eu
- ddog-gov.com
subdomain:
default: event-management-intake
description: The subdomain where the API is deployed.
- url: '{protocol}://{name}'
variables:
name:
default: event-management-intake.datadoghq.com
description: Full site DNS name.
protocol:
default: https
description: The protocol for accessing the API.
- url: https://{subdomain}.{site}
variables:
site:
default: datadoghq.com
description: Any Datadog deployment.
subdomain:
default: event-management-intake
description: The subdomain where the API is deployed.
summary: Post an event
tags:
- Events
Expand Down
2 changes: 2 additions & 0 deletions examples/v2/events/CreateEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const params: v2.EventsApiCreateEventRequest = {
body: {
data: {
attributes: {
aggregationKey: "aggregation_key_123",
attributes: {
author: {
name: "[email protected]",
Expand Down Expand Up @@ -42,6 +43,7 @@ const params: v2.EventsApiCreateEventRequest = {
},
},
category: "change",
integrationId: "custom-events",
message: "payment_processed feature flag has been enabled",
tags: ["env:test"],
title: "payment_processed feature flag updated",
Expand Down
4 changes: 2 additions & 2 deletions features/v2/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ Feature: Events
@generated @skip @team:DataDog/event-management
Scenario: Post an event returns "Bad request" response
Given new "CreateEvent" request
And body with value {"data": {"attributes": {"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", "message": "payment_processed feature flag has been enabled", "tags": ["env: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", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
When the request is sent
Then the response status is 400 Bad request

@generated @skip @team:DataDog/event-management
Scenario: Post an event returns "OK" response
Given new "CreateEvent" request
And body with value {"data": {"attributes": {"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", "message": "payment_processed feature flag has been enabled", "tags": ["env: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", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
When the request is sent
Then the response status is 200 OK

Expand Down
29 changes: 29 additions & 0 deletions packages/datadog-api-client-common/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,35 @@ export const operationServers: {
subdomain: "http-intake.logs",
}),
],
"v2.EventsApi.createEvent": [
new ServerConfiguration<{
site:
| "datadoghq.com"
| "us3.datadoghq.com"
| "us5.datadoghq.com"
| "ap1.datadoghq.com"
| "datadoghq.eu"
| "ddog-gov.com";
subdomain: string;
}>("https://{subdomain}.{site}", {
site: "datadoghq.com",
subdomain: "event-management-intake",
}),
new ServerConfiguration<{
name: string;
protocol: string;
}>("{protocol}://{name}", {
name: "event-management-intake.datadoghq.com",
protocol: "https",
}),
new ServerConfiguration<{
site: string;
subdomain: string;
}>("https://{subdomain}.{site}", {
site: "datadoghq.com",
subdomain: "event-management-intake",
}),
],
"v2.LogsApi.submitLog": [
new ServerConfiguration<{
site:
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-api-client-v2/apis/EventsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export class EventsApi {
/**
* This endpoint allows you to post events.
*
* ✅ **Only events with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.
* ✅ **Only events with the `change` or `alert` category** are in General Availability. For change events, see [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.
*
* ❌ For use cases involving other event categories, please use the V1 endpoint.
* @param param The request object
Expand Down
6 changes: 6 additions & 0 deletions packages/datadog-api-client-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,11 @@ export { ActiveBillingDimensionsBody } from "./models/ActiveBillingDimensionsBod
export { ActiveBillingDimensionsResponse } from "./models/ActiveBillingDimensionsResponse";
export { ActiveBillingDimensionsType } from "./models/ActiveBillingDimensionsType";
export { Advisory } from "./models/Advisory";
export { AlertEventCustomAttributes } from "./models/AlertEventCustomAttributes";
export { AlertEventCustomAttributesLinksItems } from "./models/AlertEventCustomAttributesLinksItems";
export { AlertEventCustomAttributesLinksItemsCategory } from "./models/AlertEventCustomAttributesLinksItemsCategory";
export { AlertEventCustomAttributesPriority } from "./models/AlertEventCustomAttributesPriority";
export { AlertEventCustomAttributesStatus } from "./models/AlertEventCustomAttributesStatus";
export { Annotation } from "./models/Annotation";
export { AnnotationDisplay } from "./models/AnnotationDisplay";
export { AnnotationDisplayBounds } from "./models/AnnotationDisplayBounds";
Expand Down Expand Up @@ -1525,6 +1530,7 @@ export { EventCreateResponseAttributes } from "./models/EventCreateResponseAttri
export { EventCreateResponseAttributesAttributes } from "./models/EventCreateResponseAttributesAttributes";
export { EventCreateResponseAttributesAttributesEvt } from "./models/EventCreateResponseAttributesAttributesEvt";
export { EventCreateResponsePayload } from "./models/EventCreateResponsePayload";
export { EventCreateResponsePayloadLinks } from "./models/EventCreateResponsePayloadLinks";
export { EventPayload } from "./models/EventPayload";
export { EventPayloadAttributes } from "./models/EventPayloadAttributes";
export { EventPriority } from "./models/EventPriority";
Expand Down
Loading