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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

pablo-encinas
Copy link
Contributor

@pablo-encinas pablo-encinas commented Aug 5, 2025

What does this PR do? What is the motivation?

Adds a new example for Alert V2 events in API documentation.

Preview changes here.

This is the content in the new example tab:

{
  "data": {
    "type": "event",
    "attributes": {
      "aggregation_key": "aggregation_key_123",
      "attributes": {
        "custom": {
          "threshold": 95,
          "current_value": 98,
          "metric": "cpu.utilization"
        },
        "links": [
          {
            "category": "runbook",
            "title": "CPU Alert Runbook",
            "url": "https://example.com/runbooks/cpu-alert"
          },
          {
            "category": "dashboard",
            "url": "https://example.com/dashboards/cpu-usage"
          }
        ],
        "priority": "2",
        "status": "error"
      },
      "category": "alert",
      "integration_id": "custom-events",
      "message": "CPU usage exceeded the 95% threshold for more than 5 minutes.",
      "tags": [
        "env:production",
        "team:infrastructure"
      ],
      "timestamp": "2025-08-05T10:30:00Z",
      "title": "High CPU usage on production nodes"
    }
  }
}

Merge instructions

Merge readiness:

  • Ready for merge

For Datadog employees:

Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). Without this format, your pull request will not pass CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.

If your branch doesn't follow this format, rename it or create a new branch and PR.

[6/5/2025] Merge queue has been disabled on the documentation repo. If you have write access to the repo, the PR has been reviewed by a Documentation team member, and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #documentation channel in Slack.

Additional notes

Copy link
Contributor

github-actions bot commented Aug 5, 2025

✅ Documentation Team Review

The documentation team has approved this pull request. Thank you for your contribution!

@pablo-encinas pablo-encinas marked this pull request as ready for review August 5, 2025 12:01
@pablo-encinas pablo-encinas requested a review from a team as a code owner August 5, 2025 12:01
@Yuqing-Bian
Copy link
Contributor

In the code example, it's titled "example(alert)" but it's still using change event:
image

@pablo-encinas
Copy link
Contributor Author

In the code example, it's titled "example(alert)" but it's still using change event: image

I only added an example request for the alert event, but did not modify the code examples below (which are not directly related.) I think the code examples are more about the libraries usage, and not so much about the payloads themselves. That's why I think this change is good to solve the confusion some users may have for creating alert events.

@pablo-encinas pablo-encinas force-pushed the pablo.encinas/ECT-3791 branch from 67bc18c to 609e648 Compare August 5, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants