- What: Dual frontend plugins for OpenShift observability (monitoring-plugin + monitoring-console-plugin)
- Purpose: Alerts, Metrics, Targets, Dashboards + Perses, Incidents, ACM integration
- Tech Stack: React + TypeScript + Webpack + i18next + Go
- Key Files:
config/*.patch.json,web/src/features/,web/src/shared/
- Check if it belongs in
monitoring-plugin(core) ormonitoring-console-plugin(extended) - Add or update the relevant patch file in
config/(e.g.config/alerting.patch.json) - Add React components in
web/src/features/(feature-specific) orweb/src/shared/(shared) - Add translations in
public/locales/ - Test with
make lint-frontend && make test-backend
- Build failures: Check
Makefiletargets - Console integration: Verify the relevant
config/*.patch.jsonpatch file - Plugin loading: Check OpenShift Console logs
- Perses dashboards: Debug at
web/src/features/perses-dashboards/
- See README.md for full setup
- Deployment: https://github.com/observability-ui/development-tools/
- Files:
web/src/features/alerts/ - Integration: Alertmanager API
- Testing: Cypress tests in
web/cypress/
- Legacy: Standard OpenShift dashboards
- Perses:
web/src/features/perses-dashboards/(uses ECharts wrapper) - Upstream: https://github.com/perses/perses
- Multi-cluster observability
- Hub cluster aggregation
- Thanos/Alertmanager integration
Before editing incident specs, the incidents page object, incident fixtures, or
their schema/mock support code, read
.agents/references/incidents-testing-guidelines.md. This applies to:
web/cypress/e2e/incidents/web/cypress/views/incidents-page.tsweb/cypress/fixtures/incident-scenarios/web/cypress/support/incidents_prometheus_query_mocks/
- monitoring-plugin: Core observability (always available)
- monitoring-console-plugin: Optional features (COO required)
- Check compatibility with OpenShift Console versions
- Verify i18next translation support
- Consider CMO vs COO deployment differences
The web/src/ directory is organized into two top-level areas:
web/src/features/— Feature-specific code, one subdirectory per feature. Each feature directory contains sub-folders as needed:components/,pages/,hooks/,utils/,types/,assets/.web/src/shared/— Code used by more than one feature, organized by kind.
| Feature | Directory |
|---|---|
| Alerting (alerts, silences, alert rules) | features/alerts/ |
| Incidents | features/incidents/ |
| Legacy Dashboards | features/legacy-dashboards/ |
| Metrics / PromQL | features/metrics/ |
| Perses Dashboards | features/perses-dashboards/ |
| Targets | features/targets/ |
| Shared Directory | Contents |
|---|---|
shared/components/ |
Reusable UI components (labels.tsx, format.tsx, query-browser/) |
shared/hooks/ |
Shared React hooks (useAlerts.ts, usePerspective.tsx) |
shared/store/ |
Redux store, actions, reducers, thunks, alert fetching |
shared/contexts/ |
React contexts (MonitoringContext.tsx) |
shared/constants/ |
Shared constants (data-test.ts, query-params.ts) |
shared/types/ |
Shared TypeScript types (types.ts) |
shared/utils/ |
Shared pure utility functions (utils.ts) |
shared/assets/ |
Static assets such as fonts (codicon.ttf) |
shared/console/ |
Vendored/adapted OpenShift Console internals |
Placement rules:
- If a file is only used within one feature, it belongs in that feature's directory.
- If a component or utility is only used by a single page, co-locate it inside that page's own subdirectory (e.g.
features/alerts/pages/alerts-page/AggregateAlertTableRow.tsx). - If a file is used across multiple features, it belongs in
shared/.
Note:
web/src/components/no longer exists. Do not create files there.
| System | Repository | Purpose |
|---|---|---|
| CMO | https://github.com/openshift/cluster-monitoring-operator | Manages monitoring-plugin |
| COO | https://github.com/rhobs/observability-operator | Manages monitoring-console-plugin |
| Perses | https://github.com/perses/perses | Dashboard engine |
| Console SDK | https://github.com/openshift/console | Plugin framework |
- Plugin SDK: https://github.com/openshift/console/tree/main/frontend/packages/console-dynamic-plugin-sdk
- Extensions docs: https://github.com/openshift/console/blob/main/frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md
- Example plugin: https://github.com/openshift/console/tree/main/dynamic-demo-plugin
- CMO (monitoring-plugin): Integrated with cluster monitoring stack
- COO (monitoring-console-plugin): Optional operator for extended features
- UIPlugin CR example:
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
name: monitoring
spec:
type: Monitoring
monitoring:
acm:
enabled: true
alertmanager:
url: "https://alertmanager.open-cluster-management-observability.svc:9095"
thanosQuerier:
url: "https://rbac-query-proxy.open-cluster-management-observability.svc:8443"
perses:
enabled: true
clusterHealthAnalyzer:
enabled: true- Core: https://github.com/perses/perses
- Plugins: https://github.com/perses/plugins (chart specifications and datasources)
- Operator: https://github.com/perses/perses-operator (Red Hat fork: https://github.com/rhobs/perses)
- Chart Engine: ECharts (https://echarts.apache.org/)
- Multi-cluster monitoring: Centralized observability across managed clusters
- Components: Hub cluster Thanos, Grafana, Alertmanager + endpoint operators
- Integration: COO provides unified alerting UI for ACM environments
- Features: Cross-cluster silences, cluster-labeled alerts, centralized metrics
make lint-frontend
make lint-backend
make test-translations
make test-backend
make test-frontend
# future slash command for test execution- Title format:
[JIRA_ISSUE]: Description - Testing: All linting and tests must pass
- Translations: Ensure i18next keys are properly added
The Monitoring Plugin uses a dual testing approach for unit tests:
- Frontend Unit Tests: Vitest + TypeScript for React components and utilities
- Backend Unit Tests: Go's built-in testing framework for server functionality
Unit tests focus on isolated function testing and run quickly in CI/CD pipelines, while E2E tests (Cypress) validate full user workflows.
Frontend Tests:
- Location: Co-located with source files in
web/src/ - Naming:
*.spec.ts(e.g.,format.spec.ts,utils.spec.ts) - Framework: Vitest 4.1.11
- Configuration:
web/vitest.config.mts
Backend Tests:
- Location: Co-located with source files in
pkg/(sub-packages:pkg/server/,pkg/monitoring/) - Naming:
*_test.go(e.g.,server_test.go) - Framework: Go testing package + testify/require
- Configuration: Standard Go test conventions
# Run all tests (backend + frontend)
make test-backend
make test-frontend
# Run individually from web directory
cd web && npm run test:unit
# Run with coverage
cd web && npm run test:unit:coverage
# Run Go tests directly
go test ./pkg/... -vCreate unit tests when:
- Adding utility functions: Pure functions, formatters, data transformations
- Adding business logic: Data processing, calculations, validations
- Fixing bugs: Regression tests to prevent bug recurrence
- Adding API handlers: Backend endpoint logic (Go tests)
Frontend:
vitest(v4.1.11) - Test runner and assertions@vitest/coverage-v8(v4.1.11) - Code coverage (v8 provider)
Backend:
testing(stdlib) - Go testing frameworkgithub.com/stretchr/testify(v1.9.0) - Assertions and test utilities
Testing Framework & Configuration Test Framework: Vitest Configuration File: web/vitest.config.mts
Test File Location & Naming Convention Pattern: *.spec.ts files co-located with source code
Test Coverage Areas
- Edge cases (null, undefined, empty values)
- Normal behavior and expected outputs
- Boundary conditions
- Complex scenarios and integration
- Data transformations and formatting
Testing Framework & Configuration Test Framework: Go's built-in testing package Assertion Library: github.com/stretchr/testify v1.9.0
Test File Location & Naming Convention Pattern: *_test.go files in the same directory as source code
Test Helper Functions
startTestServer()- Starts server for testingprepareServerAssets()- Sets up test environmentgenerateCertificate()- Creates TLS certificates for testscheckHTTPReady()- Waits for server to be readygetRequestResults()- Makes HTTP requests
Test Coverage Areas
- HTTP server functionality
- HTTPS/TLS configuration
- Certificate handling
- Security settings (TLS versions, cipher suites)
- Endpoint availability
The Monitoring Plugin uses Cypress for comprehensive End-to-End (E2E) testing to ensure functionality across both the core monitoring-plugin (managed by CMO) and the monitoring-console-plugin (managed by COO). Our test suite covers test scenarios including alerts, metrics, dashboards, and integration with Virtualization and Fleet Management (ACM).
Key Testing Documentation:
- Setup & Configuration:
web/cypress/README.md- Environment variables, installation, troubleshooting - Testing Guide:
web/cypress/CYPRESS_TESTING_GUIDE.md- Test architecture, creating tests, workflows - Test Catalog:
web/cypress/E2E_TEST_SCENARIOS.md- Complete list of all test scenarios
You should create new Cypress tests when:
- Adding New Features: Any new UI feature requires corresponding E2E tests
- Fixing Bugs: Bug fixes should include tests to prevent regression
- Modifying Existing Features: Changes to existing functionality require test updates
cd web/cypress
# Run all regression tests
npm run cypress:run --spec "cypress/e2e/**/regression/**"
# Run BVT (Build Verification Tests)
npm run cypress:run --spec "cypress/e2e/monitoring/00.bvt_admin.cy.ts"
# Run COO tests
npm run cypress:run --spec "cypress/e2e/coo/*.cy.ts"
# Interactive mode
npm run cypress:openFor detailed testing instructions, see web/cypress/CYPRESS_TESTING_GUIDE.md
Vitest Browser Mode mounts individual React components in Playwright Chromium without a cluster. Use Jest-style Vitest assertions and vitest-browser-react rendering.
- Test location: Co-located
*.browser.spec.tsxfiles inweb/src/ - Support file:
web/vitest.browser.setup.ts - Config:
web/vitest.browser.config.mts
- Testing a component's rendering logic (conditional display, empty states)
- Verifying props are handled correctly
- Validating user interactions within a single component
- When E2E tests would be overkill for the behavior under test
cd web
npx playwright install chromium
# Headless mode - all component tests
npm run test:component
# Run a single component test file
npm run test:component -- Labels.browser.spec.tsxComponent test files use .browser.spec.tsx and are co-located with the source:
import { render } from 'vitest-browser-react';
import { MyComponent } from '@/shared/components/MyComponent';
describe('MyComponent', () => {
it('renders correctly', async () => {
const screen = await render(<MyComponent prop="value" />);
await expect.element(screen.getByText('expected text')).toBeVisible();
});
});- Konflux: Handles CI/CD and release automation
- CMO releases: Follow OpenShift release cycles
- COO releases: Independent release schedule
Reusable workflows live under .agents/skills/. Invoke them with
$skill-name in Codex or /skill-name in Claude Code and Cursor. If a client
does not discover Agent Skills, ask it to read the corresponding
.agents/skills/<name>/SKILL.md explicitly.
| Skill | Purpose |
|---|---|
backport |
Backport a commit with release-branch adaptations. |
build-images |
Build both plugin development images with a unique tag. |
run-perses-dev |
Start the integrated plugin/Perses tmux environment. |
cypress-setup |
Install and configure the Cypress environment. |
cypress-run |
Select and run Cypress tests. |
generate-incident-fixture |
Create a schema-valid incident fixture. |
validate-incident-fixtures |
Validate one or all incident fixtures. |
fixture-schema-reference |
Explain the incident fixture schema. |
generate-regression-test |
Generate an Incidents regression test from documented flows. |
refactor-regression-test |
Refactor an existing Incidents regression test. |
For backporting features from main to release branches (for example,
release-4.x or release-coo-x.y), invoke the shared backport skill:
# Codex
$backport release-4.18 [commit-hash]
# Claude Code or Cursor
/backport release-coo-0.4 [commit-hash]
The canonical workflow is .agents/skills/backport/SKILL.md and handles:
- PatternFly v6 → v5 component transformations
- React Router v6 → v5 hook adaptations
- Console SDK API compatibility
- Dependency version differences between branches
- Project structure differences (web/ vs root for older releases)
- Inherits OpenShift Console RBAC
- Respects cluster monitoring permissions
- ACM integration requires appropriate hub cluster access
- No credentials in code
- Use cluster service accounts
- Follow OpenShift security guidelines
| Topic | Channel/Resource |
|---|---|
| Console Plugins | OpenShift Console SDK documentation |
| Perses | Slack: Cloud Native Computing Foundation >> #perses-dev |
| COO | Slack: Internal Red Hat >> #forum-cluster-observability-operator |
- Monitoring Plugin: https://github.com/observability-ui/development-tools/tree/main/monitoring-plugin
- Perses: https://github.com/observability-ui/development-tools/tree/main/perses
- Wiki: https://github.com/observability-ui/development-tools/tree/main/wiki
- TypeScript: https://www.typescriptlang.org/
- React: https://react.dev/
- Webpack: https://webpack.js.org/
- Go: https://go.dev/
- i18next: https://www.i18next.com/
This guide is optimized for AI agents and developers. For detailed setup instructions, also refer to README.md and Makefile.