Skip to content

fix(metrics): warn when the packaged Xenna Grafana dashboard is missing (#2189) - #2371

Open
chethanuk wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
chethanuk:fix/issue-2189-ship
Open

fix(metrics): warn when the packaged Xenna Grafana dashboard is missing (#2189)#2371
chethanuk wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
chethanuk:fix/issue-2189-ship

Conversation

@chethanuk

Copy link
Copy Markdown

Description

write_grafana_configs() folded the packaged-file check into the copy condition:

if os.path.isfile(xenna_dashboard_src) and not os.path.isfile(xenna_dashboard_dst):
    shutil.copy(xenna_dashboard_src, xenna_dashboard_dst)

so "the packaged dashboard is missing" and "it is already provisioned" took the same silent
branch. When the JSON was absent from the install the function returned normally, having written
only the Ray dashboards, with no log at any level. The reporter had to list site-packages to
work out why the Xenna dashboard never appeared in Grafana.

This guards on the destination first and warns only when the packaged source is genuinely
absent, so an already-provisioned dashboard stays quiet and is never overwritten.

Packaging itself is untouched: the missing-from-the-wheel half of the report was already fixed
by ad58743 (#1911), which added recursive-include nemo_curator ... *.json to MANIFEST.in.
What was left is the silent skip, which is what the issue's "Suggested fix" asks for.

closes #2189

Usage

No API change. When the packaged dashboard is missing, write_grafana_configs() now logs it
instead of returning quietly:

from nemo_curator.metrics.utils import write_grafana_configs

write_grafana_configs(3000, 9090)
# WARNING | Xenna Grafana dashboard not found at /.../nemo_curator/metrics/xenna_grafana_dashboard.json;
#           the Xenna dashboard will not be provisioned. This usually means the packaged data file is
#           missing from the installed nemo_curator distribution.

Tests

Added a parametrized test in tests/metrics/test_metrics_utils.py covering the four
(source present, destination present) states for write_grafana_configs; only the
"source missing, destination missing" case fails on main today, with the reported symptom
(no warning logged). All four pass with this fix, and the rest of tests/metrics/ (28 tests)
is unaffected.

  • pytest tests/metrics/test_metrics_utils.py -k WriteGrafanaConfigs — 4 passed
  • pytest tests/metrics/ — 28 passed
  • ruff check / ruff format --check on both changed files — clean

Checklist

  • I am familiar with the Contributing Guide.
  • New or Existing tests cover these changes.
  • The documentation is up to date with these changes.

write_grafana_configs folded the source check into the copy condition, so
"package data missing" and "already provisioned" shared one silent branch:
a missing xenna_grafana_dashboard.json produced no log at any level and the
user had to inspect site-packages to find out why the dashboard never
appeared in Grafana.

Guard on the destination first, then warn only when the packaged source is
genuinely absent. A dashboard already present in dashboards_path is
provisioned by Grafana regardless of the package, so re-runs stay silent.

Adds a parametrized test over the four (src present, dst present) states.
The missing-from-package case fails without this fix.

Fixes NVIDIA-NeMo#2189

Signed-off-by: ChethanUK <chethanuk@outlook.com>
@chethanuk
chethanuk requested a review from a team as a code owner September 5, 2026 04:50
@chethanuk
chethanuk requested review from oyilmaz-nvidia and removed request for a team September 5, 2026 04:50
@copy-pr-bot

copy-pr-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR distinguishes an already-provisioned Xenna dashboard from a missing packaged dashboard.

  • Logs a warning only when both the packaged source and provisioned destination are absent.
  • Preserves existing dashboards without overwriting them.
  • Adds parameterized coverage for all source/destination presence combinations.

Confidence Score: 5/5

The PR appears safe to merge, with the intended missing-dashboard warning and preservation behavior covered by tests.

No actionable correctness, security, or repository-rule violations remain; the changed branch behaves correctly for realistic callers and all relevant file-presence states.

Important Files Changed

Filename Overview
nemo_curator/metrics/utils.py Adds a targeted warning for a genuinely missing packaged Xenna dashboard while preserving existing provisioning behavior.
tests/metrics/test_metrics_utils.py Adds isolated parameterized tests covering all four source and destination states.

Reviews (1): Last reviewed commit: "fix(metrics): warn when the packaged Xen..." | Re-trigger Greptile

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.

xenna_grafana_dashboard.json missing from the wheel — Xenna Grafana dashboard is never provisioned

1 participant