Skip to content

Emit Warning Events for Consul Integration#23779

Open
ddog-nasirthomas wants to merge 8 commits into
masterfrom
nasir.thomas/consul-warning-events
Open

Emit Warning Events for Consul Integration#23779
ddog-nasirthomas wants to merge 8 commits into
masterfrom
nasir.thomas/consul-warning-events

Conversation

@ddog-nasirthomas
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds optional warning events when Consul health checks transition to warning, via a new config option health_check_warning_events. The config option makes it so existing customers do not have their monitors interferred with

When collect_health_checks is enabled, the check already emits events on transitions to critical (consul.check_failed, alert_type: error). With health_check_warning_events: true, it also emits events on transitions to warning (consul.check_warning, alert_type: warning).

Motivation

Customer FR for the need to have warning events emitted as well.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@datadog-prod-us1-3
Copy link
Copy Markdown

datadog-prod-us1-3 Bot commented May 20, 2026

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 92.82% (+5.43%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e0e082d | Docs | Datadog PR Page | Give us feedback!

@ddog-nasirthomas
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.07%. Comparing base (2340f5e) to head (e0e082d).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ddog-nasirthomas ddog-nasirthomas marked this pull request as ready for review May 21, 2026 14:30
@ddog-nasirthomas ddog-nasirthomas requested review from a team as code owners May 21, 2026 14:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03110884da

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +438 to +439
"msg_text": f"Check {check_id} for service {service_name}, id: {service_id}"
f"{label} on node {node_name}: {check_output}",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add separator before status label in event message

When a warning event is emitted, msg_text concatenates service_id and label without any delimiter, producing strings like id: server-loadbalancerwarning on node .... This is a user-visible regression in the new warning-event path and can break downstream parsing or simple text matching for event content. Add a space (or punctuation) between service_id and the status word.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was like this before my change so I did not change it in case customer's monitors would be affected. I can fix the the typo if need be

@ddog-nasirthomas ddog-nasirthomas added the qa/required QA is required for this PR and will generate a QA card label May 21, 2026
@janine-c janine-c self-assigned this May 21, 2026
janine-c
janine-c previously approved these changes May 21, 2026
Comment thread consul/assets/configuration/spec.yaml Outdated
@temporal-github-worker-1 temporal-github-worker-1 Bot dismissed janine-c’s stale review May 21, 2026 19:34

Review from janine-c is dismissed. Related teams and files:

  • documentation
    • consul/assets/configuration/spec.yaml
    • consul/datadog_checks/consul/data/conf.yaml.example
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 21, 2026

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and Codecov settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants