Skip to content

fix(datadog): allow specifying Datadog site while keeping default US1#1754

Merged
jertel merged 2 commits into
jertel:masterfrom
gryphonai:datadog-customize-dd-site
Mar 26, 2026
Merged

fix(datadog): allow specifying Datadog site while keeping default US1#1754
jertel merged 2 commits into
jertel:masterfrom
gryphonai:datadog-customize-dd-site

Conversation

@BillyWeans
Copy link
Copy Markdown

Description

Summary

The Datadog alerter currently hardcodes https://api.datadoghq.com/api/v1/events as the events endpoint. Datadog operates multiple regional sites (US1, US3, US5, EU1, AP1, etc.), each with a distinct API hostname. Users on non-default Datadog sites cannot use the built-in Datadog alerter without patching the source.
This PR adds an optional datadog_api_url rule parameter that allows the endpoint to be overridden. The default value is https://api.datadoghq.com/api/v1/events, preserving full backwards compatibility.

Changes

  • elastalert/alerters/datadog.py — read datadog_api_url from rule config in init, use self.dd_api_url in alert() instead of hardcoded string
  • elastalert/schema.yaml — add datadog_api_url: {type: string} to Datadog section
  • tests/alerters/datadog_test.py — add test_datadog_alerter_custom_api_url and test_datadog_alerter_default_api_url
  • docs/source/alerts.rst — document new optional parameter
  • CHANGELOG.md — add entry for new feature

Checklist

  • I have reviewed the contributing guidelines.
  • I have included unit tests for my changes or additions.
  • I have successfully run make test-docker with my changes.
  • I have manually tested all relevant modes of the change in this PR.
  • I have updated the documentation.
  • I have updated the changelog.

Questions or Comments

Comment thread CHANGELOG.md Outdated

## New features
- None
- [Datadog] Add optional `datadog_api_url` parameter to support regional Datadog sites (US3, US5, EU1, AP1, etc.) - @BillyWeans
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting the PR. Please update this line to use the pattern shown in the other release sections in this document:

@BillyWeans
Copy link
Copy Markdown
Author

Corrected. Apologies!

@jertel jertel merged commit c99df2d into jertel:master Mar 26, 2026
1 check passed
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.

2 participants