Skip to content

fix: render alerts for local-cluster monitors when data source is enabled (#1488) - #1495

Open
Aeternax wants to merge 1 commit into
opensearch-project:mainfrom
Aeternax:fix/1488-alerts-blank-page-local-cluster
Open

fix: render alerts for local-cluster monitors when data source is enabled (#1488)#1495
Aeternax wants to merge 1 commit into
opensearch-project:mainfrom
Aeternax:fix/1488-alerts-blank-page-local-cluster

Conversation

@Aeternax

@Aeternax Aeternax commented Aug 3, 2026

Copy link
Copy Markdown

Description

When data_source.enabled: true, viewing a local-cluster monitor's own Alerts tab — or clicking through from an alert on the Alerting overview into an individual alert — rendered a blank page: no alerts, no error, and no request to /api/alerting/alerts ever issued.

Root cause is in public/pages/Dashboard/containers/DashboardClassic.js, getAlerts():

if (dataSourceEnabled() && resolvedDataSourceId === undefined) {
  return;
}

For a plain local-cluster monitor (no data source association), resolvedDataSourceId is undefined, so this guard treated the normal local-cluster case as disqualifying and silently returned before making any request. Both the monitor's own Alerts tab and the individual-alert click-through render through this same method, so both went blank.

This change removes the early-return guard. params.dataSourceId is still only set when a data source actually resolves (a few lines further down), so the local-cluster case correctly omits it — and the server treats a missing dataSourceId as the local cluster. This mirrors the fix already applied to the overview alerts card in #1099 (DataSourceAlertsCard), bringing DashboardClassic in line with that accepted pattern.

A regression test (DashboardClassic.test.js) is added covering three cases: local-cluster + data source enabled (issues the request with no dataSourceId), data source enabled + resolved id (includes dataSourceId), and data source disabled.

Issues Resolved

Closes #1488

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…bled (opensearch-project#1488)

When `data_source.enabled: true`, viewing a local-cluster monitor's own
"Alerts" tab or clicking through to an individual alert rendered a blank
page. `DashboardClassic.getAlerts()` returned early whenever no
`dataSourceId` resolved — which is the normal case for a plain
local-cluster monitor — so no request to `/api/alerting/alerts` was ever
issued.

Remove the early-return guard. `params.dataSourceId` is still only set
when a data source actually resolves, so the local-cluster case correctly
omits it (the server treats a missing `dataSourceId` as the local
cluster). This mirrors the fix already applied to the overview alerts
card in opensearch-project#1099.

Add a regression test covering the local-cluster, resolved-data-source,
and data-source-disabled cases.

Signed-off-by: Marco Arts <marcoarts88@gmail.com>
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.

[BUG] Alerting UI blank page when data source feature is enabled

1 participant