Skip to content

Dbz#2314 Alerting support to the Debezium Platform - #486

Open
mfvitale wants to merge 20 commits into
debezium:mainfrom
mfvitale:dbz#2314
Open

Dbz#2314 Alerting support to the Debezium Platform#486
mfvitale wants to merge 20 commits into
debezium:mainfrom
mfvitale:dbz#2314

Conversation

@mfvitale

@mfvitale mfvitale commented Aug 7, 2026

Copy link
Copy Markdown
Member

Fixes debezium/dbz#2314

Description

This pull request introduces a comprehensive REST API for managing alerting and notification features in the platform conductor module. It adds new resources for alert events, alert rules, and notification channels, along with their associated request and response DTOs. The changes enable CRUD operations, status queries, and notification channel testing, and add the necessary dependencies for email notifications.

The most important changes are:

API Resource Additions:

  • Added AlertEventResource, AlertRuleResource, and NotificationChannelResource classes, providing REST endpoints for querying alert events and statuses, managing alert rules (CRUD, enable/disable), and managing notification channels (CRUD, test channel) (AlertEventResource.java [1] AlertRuleResource.java [2] NotificationChannelResource.java [3].

DTOs for API Communication:

  • Introduced DTO records for API requests and responses: AlertEventResponse, AlertRuleRequest, AlertRuleResponse, AlertStatusResponse, NotificationChannelRequest, NotificationChannelResponse, PagedAlertEventResponse, and TestNotificationResponse, standardizing data exchange formats for the new endpoints [1] [2] [3] [4] [5] [6] [7] [8].

Dependency Updates:

  • Added the quarkus-mailer dependency to the project to support email-based notification channels.

PR Checklist

  • I have read the contribution guidelines and the governance document on PR expectations.
  • Minimal changes to code not directly related to your change (e.g. no unnecessary formatting changes or refactoring to existing code)
  • One feature/change per PR unless tightly coupled
  • Do a rebase on upstream main

@Naros Naros left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @mfvitale, this looks really clean. 🚀 I have a few questions below.

}

@Transactional
public void evaluate(AlertRuleEntity rule, String pipelineId, double value,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This method and resolve both open a transaction that blocks until webhooks are sent synchronously, including retries that can block for ~30 seconds. Should we persist the transition and then handle the event/webhook dispatch using a CDI bean or using an @Async / Vert.x event bus?

@mfvitale mfvitale Aug 17, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. Effectively this is the "dual-write" problem resolvable with the "outbox` pattern :D

For now I think that CDI events is reasonable solution for this uses case.

case OK -> evaluateOk(conditionMet, forDuration, now);
case PENDING -> evaluatePending(conditionMet, forDuration, pendingSince, now);
case FIRING -> evaluateFiring(conditionMet);
default -> new StateTransition(currentState, StateTransition.Action.NONE, null, null);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this include an explicit case for RESOLVED, with the default as an error case if new enum values are added but not handled here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Naros This effectively works on the currentStatus so the case the RESOLVED state is never an input state.

So I just removed the RESOLVED state and simplified the switch. Thanks for spotting it.

@Override
public AlertRule create(@Valid AlertRule view) {
validatePanelExists(view.getPanelId());
validateForDuration(view.getForDuration());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should there also be validation for the evaluationWindow that carries the same requirement as the forDuration property? Same question for update method in this class.

.findFirst()
.orElse(null);

if (panel == null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this eventually lead to stale/orphaned AlertStateEntity with no way to resolve them? If so, should we consider resolving them after a configurable no-data grace period?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch! I'll just auto-resolve in that case and so if a panel is then re-added and the alters is still firing it will be correctly re-evaluated.

Note that for now the panels, are just configured via k8s and not via UI so adding/removing will be less frequent.

…ntities, services, and REST API

Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
…Prometheus integration

Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
…te transaction to avoid blocking it.

Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
Signed-off-by: Fiore Mario Vitale <mvitale@redhat.com>
@mfvitale

Copy link
Copy Markdown
Member Author

@Naros Could I ask another pass?

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.

Alerting support to the Debezium Platform

2 participants