Skip to content

Integrated Grafana dashboard panels#12

Merged
wistefan merged 32 commits into
mainfrom
ticket-35/work
May 6, 2026
Merged

Integrated Grafana dashboard panels#12
wistefan merged 32 commits into
mainfrom
ticket-35/work

Conversation

@wistefan
Copy link
Copy Markdown
Collaborator

@wistefan wistefan commented May 5, 2026

Summary

Integrated Grafana dashboard panels into the fdsc-dashboard, embedding them via iframes through the BFF proxy.

Release Notes

Integrated Grafana dashboard panels into the fdsc-dashboard, embedding them via iframes through the BFF proxy.

Testing

Checklist

  • I applied exactly one of major / minor / patch labels.
  • The ## Summary and ## Release Notes sections are filled in, or
    I added a release-notes/next.md file on this branch.
  • Lint and build pass locally (npm run lint, npm run build).

general-agent-1 and others added 12 commits May 4, 2026 13:14
5-step plan to embed Grafana panels into fdsc-dashboard via BFF proxy,
following the established Apisix Dashboard iframe pattern. Uses Grafana
auth proxy mode (X-WEBAUTH-USER header injection from JWT) to eliminate
separate login. Panel definitions are operator-configurable via
GRAFANA_PANELS_JSON env var.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t-35/plan into ticket-35/work

Reviewed-on: http://localhost:3001/general-agent-1/fdsc-dashboard/pulls/14
Reviewed-by: wistefan <wistefan@dev-env.local>
Add GRAFANA_URL and GRAFANA_PANELS_JSON environment variables to the BFF
server. When configured, a /api/grafana proxy route is mounted that
forwards requests to the upstream Grafana instance, injecting an
X-WEBAUTH-USER header extracted from the JWT Bearer token so Grafana's
auth proxy mode trusts the upstream identity. The runtime /config.js
endpoint now includes a window.__GRAFANA_CONFIG__ global for the frontend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sc-dashboard' (#15) from ticket-35/step-1 into ticket-35/work

Reviewed-on: http://localhost:3001/general-agent-1/fdsc-dashboard/pulls/15
Reviewed-by: wistefan <wistefan@dev-env.local>
…osable

Create the frontend Grafana module (src/grafana/) mirroring the existing
Apisix integration pattern:

- types.ts: GrafanaPanel and GrafanaConfig interfaces
- constants.ts: route paths, proxy base path, runtime config keys
- config.ts: loadGrafanaConfig() with runtime global + build-time env
  fallback, isGrafanaConfigured() predicate, and panel validation
- useGrafana.ts: composable returning config, isConfigured, and reactive
  isVisible (visible to all authenticated users, not just admins)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ants, config loader, and composable' (#16) from ticket-35/step-2 into ticket-35/work

Reviewed-on: http://localhost:3001/general-agent-1/fdsc-dashboard/pulls/16
Reviewed-by: wistefan <wistefan@dev-env.local>
…rings

Create the Grafana panels view component with three rendering states
(not configured, no panels, panels grid), wire up the route without
admin restriction (monitoring is read-only for all authenticated users),
add the navigation drawer and home card entries with conditional
visibility, and add all user-facing i18n strings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sc-dashboard' (#17) from ticket-35/step-3 into ticket-35/work

Reviewed-on: http://localhost:3001/general-agent-1/fdsc-dashboard/pulls/17
Reviewed-by: wistefan <wistefan@dev-env.local>
…hboard

Wire up development tooling for the Grafana integration:

- vite.config.ts: Add /api/grafana proxy in direct mode (strips prefix,
  targets VITE_GRAFANA_URL or localhost:3100) and inject
  window.__GRAFANA_CONFIG__ in the runtimeConfigPlugin so the frontend
  sees Grafana config without a running BFF.

- docker-compose.yml: Add a grafana service (grafana/grafana:latest)
  with auth proxy mode enabled (X-WEBAUTH-USER), iframe embedding
  allowed, and light theme default. Mount provisioning directory for
  auto-provisioned TestData datasource and sample dashboard. Configure
  the dashboard BFF service with GRAFANA_URL and GRAFANA_PANELS_JSON
  pointing at the three sample panels.

- mocks/grafana/provisioning/: Add TestData datasource config, dashboard
  provisioning config, and a sample dashboard JSON with three panels
  (time series, table, gauge) for out-of-the-box demonstration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…roxy, Docker Compose, and mock/sample Grafana' (#18) from ticket-35/step-4 into ticket-35/work

Reviewed-on: http://localhost:3001/general-agent-1/fdsc-dashboard/pulls/18
Reviewed-by: wistefan <wistefan@dev-env.local>
Add comprehensive tests for the three frontend Grafana modules:

- src/grafana/__tests__/config.spec.ts (36 tests): config loader,
  runtime global parsing, build-time env var fallback, panel validation,
  whitespace handling, frozen object checks, isGrafanaConfigured helper.

- src/composables/__tests__/useGrafana.spec.ts (12 tests): parameterized
  visibility truth table covering configured/unconfigured, auth
  enabled/disabled, authenticated/unauthenticated combinations. Verifies
  Grafana is visible to all authenticated users (not admin-only like Apisix).

- src/views/grafana/__tests__/GrafanaView.spec.ts (20 tests): three
  rendering states (not configured, no panels, configured with panels),
  iframe src construction, sandbox/referrerpolicy/loading attributes,
  panel dimensions (span and height defaults), panel title headings,
  back button navigation, and Escape key handler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t coverage' (#19) from ticket-35/step-5 into ticket-35/work

Reviewed-on: http://localhost:3001/general-agent-1/fdsc-dashboard/pulls/19
Reviewed-by: wistefan <wistefan@dev-env.local>
@wistefan wistefan added the minor label May 5, 2026
@wistefan wistefan merged commit a6949b3 into main May 6, 2026
6 checks passed
@wistefan wistefan deleted the ticket-35/work branch May 6, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant