Skip to content

feat(dashboard): expand observability UI and microservice demo#19

Merged
kingwill101 merged 1 commit intomasterfrom
feat/workflow-dx-1-6
Feb 26, 2026
Merged

feat(dashboard): expand observability UI and microservice demo#19
kingwill101 merged 1 commit intomasterfrom
feat/workflow-dx-1-6

Conversation

@kingwill101
Copy link
Owner

@kingwill101 kingwill101 commented Feb 26, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added dedicated dashboard views for tasks, jobs, workflows, audit logs, and search functionality.
    • Integrated alerting system with webhook notifications for backlog and task failure thresholds.
    • Enabled task replay and revocation capabilities for operational management.
    • Added configurable base path support for dashboard routing.
  • Improvements

    • Enhanced UI with responsive design and improved navigation.
    • Updated microservice example with comprehensive Docker Compose setup for local observability.

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8035fe4 and 78b2fd8.

📒 Files selected for processing (28)
  • packages/dashboard/CHANGELOG.md
  • packages/dashboard/README.md
  • packages/dashboard/bin/dashboard.dart
  • packages/dashboard/lib/dashboard.dart
  • packages/dashboard/lib/src/config/config.dart
  • packages/dashboard/lib/src/server.dart
  • packages/dashboard/lib/src/services/models.dart
  • packages/dashboard/lib/src/services/stem_service.dart
  • packages/dashboard/lib/src/state/dashboard_state.dart
  • packages/dashboard/lib/src/ui/content.dart
  • packages/dashboard/lib/src/ui/event_templates.dart
  • packages/dashboard/lib/src/ui/layout.dart
  • packages/dashboard/pubspec.yaml
  • packages/dashboard/test/dashboard_browser_test.dart
  • packages/dashboard/test/dashboard_state_property_test.dart
  • packages/dashboard/test/server_test.dart
  • packages/dashboard/test/services/sqlite_dashboard_service_test.dart
  • packages/stem/CHANGELOG.md
  • packages/stem/example/microservice/README.md
  • packages/stem/example/microservice/beat/Dockerfile
  • packages/stem/example/microservice/beat/bin/beat.dart
  • packages/stem/example/microservice/beat/pubspec.yaml
  • packages/stem/example/microservice/dashboard/Dockerfile
  • packages/stem/example/microservice/docker-compose.yml
  • packages/stem/example/microservice/enqueuer/Dockerfile
  • packages/stem/example/microservice/enqueuer/bin/main.dart
  • packages/stem/example/microservice/enqueuer/pubspec.yaml
  • packages/stem/example/microservice/grafana-datasources.yml

📝 Walkthrough

Walkthrough

This pull request significantly expands the dashboard with alerting infrastructure, audit logging, modularized UI, configurable base path mounting, and enhanced task/workflow data access. It introduces new dashboard data models, extends service capabilities for task replay/revocation, and updates the example microservice with observability initialization and auto-fill features.

Changes

Cohort / File(s) Summary
Dashboard Configuration & Mounting
bin/dashboard.dart, lib/dashboard.dart, lib/src/config/config.dart, lib/src/server.dart
Added DASHBOARD_BASE_PATH environment variable support and basePath parameter to DashboardServerOptions. Introduced new public mounting API: DashboardMountOptions, buildDashboardEngine, mountDashboard, registerDashboardRoutes. Extended config with alert webhook URLs and thresholds (backlog, failed tasks, offline workers, cooldown).
Dashboard State & Alerting
lib/src/state/dashboard_state.dart
Expanded DashboardState with audit limit and alerting parameters. Added audit recording, alert evaluation against thresholds, and webhook-based alert emission with retry-safe delivery and audit logging.
Dashboard Data Models
lib/src/services/models.dart
Added comprehensive data models: DashboardAuditEntry, DashboardTaskStatusEntry, DashboardNamespaceSnapshot, DashboardJobSummary, DashboardWorkflowRunSummary/Snapshot, DashboardWorkflowStepSnapshot. Introduced builder functions for aggregating data into summaries.
Dashboard Service Expansion
lib/src/services/stem_service.dart
Extended DashboardDataSource interface with task/workflow fetching methods (fetchTaskStatuses, fetchTaskStatus, fetchTaskStatusesForRun, fetchWorkflowRun, fetchWorkflowSteps) and control operations (replayTaskById, revokeTask). Enhanced StemDashboardService with WorkflowStore/RevokeStore support, PayloadSigner integration, and runtime reconnection retry logic.
Dashboard UI Refactoring
lib/src/ui/content.dart, lib/src/ui/event_templates.dart, lib/src/ui/layout.dart
Modularized content rendering by delegating to specialized builders. Added HTML escaping for security. Expanded DashboardPage enum with new pages (taskDetail, failures, search, audit, namespaces, workflows, jobs). Enhanced renderLayout with basePath and streamPath support, Tailwind-based styling, persistent sidebar/header, frame-based content loading, WebSocket event streaming, and dynamic task detail loading.
Documentation & Dependencies
CHANGELOG.md, README.md, pubspec.yaml
Updated changelog with feature enhancements. Added environment variable documentation, Library Embedding section with Dart code examples, and lifecycle guidance. Added workspace resolution and artisanal dependency override.
Test Infrastructure
test/dashboard_browser_test.dart, test/dashboard_state_property_test.dart, test/server_test.dart, test/services/sqlite_dashboard_service_test.dart
Extended fake/recording services with task status handling, filtering, and operation tracking. Added stub implementations for new DashboardDataSource methods. Introduced task-related test cases with state/queue filtering.
Example Microservice Updates
example/microservice/{beat,enqueuer,dashboard}/, example/microservice/{docker-compose.yml,grafana-datasources.yml}
Updated Docker working directories to reflect monorepo paths. Added observability initialization (metric exporters, signal configuration). Implemented auto-fill feature in enqueuer with configurable interval/batch size via environment variables. Added demo task specs and workflow templates. Updated datasources with UIDs and new URL paths.

Sequence Diagram(s)

sequenceDiagram
    participant Dashboard State as DashboardState
    participant Service as Service
    participant Evaluator as Alert Evaluator
    participant Webhook as External Webhook
    participant Audit as Audit Log

    Dashboard State->>Service: poll() fetch queues, workers, tasks
    Service-->>Dashboard State: return data
    Dashboard State->>Evaluator: _evaluateAlerts(queues, workers, tasks)
    
    alt Backlog exceeds threshold
        Evaluator->>Dashboard State: _emitAlert(backlog alert)
    end
    
    alt Failed tasks exceed threshold
        Evaluator->>Dashboard State: _emitAlert(failed tasks alert)
    end
    
    alt Offline workers exceed threshold
        Evaluator->>Dashboard State: _emitAlert(offline workers alert)
    end
    
    Dashboard State->>Dashboard State: check alertCooldown elapsed
    
    alt Cooldown passed and webhooks configured
        Dashboard State->>Dashboard State: _sendAlertWebhooks(alert)
        Dashboard State->>Webhook: POST alert payload
        Webhook-->>Dashboard State: response
        Dashboard State->>Audit: recordAudit(alert sent)
    else Cooldown not elapsed or no webhooks
        Dashboard State->>Audit: recordAudit(alert skipped)
    end
    
    Dashboard State->>Dashboard State: _broadcastRefreshSignal()
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Poem

🐰 Hops with glee through dashboards new,
Alerts and audits, basePath too!
Modular views and webhook streams,
The dashboard hops in the observer's dreams!
With Tailwind frames and task replay,
A rabbit's delight—hooray, hooray! 🎉

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/workflow-dx-1-6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kingwill101 kingwill101 merged commit e8d2f7f into master Feb 26, 2026
1 of 10 checks passed
@kingwill101 kingwill101 deleted the feat/workflow-dx-1-6 branch February 26, 2026 16:42
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78b2fd89cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- .env.example
environment:
STEM_WORKER_NAME: microservice-worker-1
STEM_WORKER_QUEUE: greetings

Choose a reason for hiding this comment

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

P1 Badge Replace unsupported STEM_WORKER_QUEUE env var

In the microservice docker compose stack, this worker is configured with STEM_WORKER_QUEUE, but Stem reads queue subscriptions from STEM_WORKER_QUEUES and the worker entrypoint still hardcodes queue: 'greetings', so these per-service queue overrides are ignored. With this commit’s enqueuer now emitting billing and reporting traffic, those queues do not get the intended dedicated consumers, which causes backlog growth and misleading demo behavior.

Useful? React with 👍 / 👎.

final encodedScope = Uri.encodeComponent(scope);
return ctx.turboSeeOther(
'/workers?flash=$encodedMessage&scope=$encodedScope',
'$workersPath?flash=$encodedMessage&scope=$encodedScope',

Choose a reason for hiding this comment

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

P2 Badge Build worker control redirects with query merging

workersPath can already contain ?namespace=... (it is constructed via _appendRedirectQuery), but this redirect appends another query string with raw ?flash=/?error= concatenation. When actions are submitted from a namespace-filtered workers view, redirects become malformed (for example /workers?namespace=foo?flash=...), which breaks the namespace filter and drops feedback parameters.

Useful? React with 👍 / 👎.

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.

1 participant