Skip to content

Repository files navigation

ORISO Health Dashboard

Overview

Real-time health monitoring dashboard for all Online Beratung microservices. Provides a beautiful web interface to monitor service status, response times, and historical health data.

Features

  • βœ… Real-time Monitoring - Checks services every 60 seconds
  • βœ… Beautiful UI - Modern dark-themed dashboard
  • βœ… Service Details - View detailed health information for each service
  • βœ… Helm Image Inventory - Shows Helm-deployed workloads with running images, source branch when exposed, and image hashes
  • βœ… Historical Data - Tracks last 10 health check runs
  • βœ… Manual Refresh - Trigger health checks on demand
  • βœ… API Proxy - Proxies health check requests to avoid CORS issues

Quick Start

Local Development

cd /home/caritas/Desktop/online-beratung/caritas-workspace/ORISO-HealthDashboard
npm install
npm start

Open http://localhost:9100

Production Build

docker build -t caritas-health-dashboard:latest .
sudo k3s ctr images import <(docker save caritas-health-dashboard:latest)
kubectl apply -f kubernetes-deployment.yaml

Configuration

Service Configuration

Edit config.json to configure which services to monitor:

{
  "TenantService": {
    "name": "TenantService",
    "url": "http://localhost:8081/actuator/health"
  },
  "UserService": {
    "name": "UserService",
    "url": "http://localhost:8082/actuator/health"
  },
  "ConsultingTypeService": {
    "name": "ConsultingTypeService",
    "url": "http://localhost:8083/actuator/health"
  },
  "AgencyService": {
    "name": "AgencyService",
    "url": "http://localhost:8084/actuator/health"
  },
  "VideoService": {
    "name": "VideoService",
    "url": "http://localhost:8090/actuator/health"
  }
}

Environment Variables

# Port (default: 9100)
PORT=9100

# Namespace to inspect for Helm workloads. Defaults to the pod namespace in Kubernetes.
ORISO_HELM_NAMESPACE=caritas

# Optional comma-separated Helm release filter. Leave unset to show every
# Helm-managed workload in the namespace.
ORISO_HELM_RELEASES=oriso

# Optional GitHub token used to resolve exact package-version URLs for image
# digests, e.g. /pkgs/container/oriso-agencyservice/1070196056?tag=pre-dev.
# Without this token the dashboard links to the package page only.
GITHUB_TOKEN=github_pat_or_classic_token_with_package_read_access

# Package tag to prefer when the running pod only exposes sha256 image text.
ORISO_PACKAGE_TAG=pre-dev

API Endpoints

GET /api/services

Returns list of all configured services.

Response:

{
  "TenantService": {
    "name": "TenantService",
    "url": "http://localhost:8081/actuator/health"
  }
}

GET /api/health/:key

Proxies health check request to the specified service.

Example: /api/health/TenantService

Response:

{
  "status": "UP",
  "components": {
    "db": {
      "status": "UP",
      "details": {
        "database": "MariaDB",
        "validationQuery": "isValid()"
      }
    }
  }
}

GET /api/cron/runs

Returns last 10 automated health check runs.

Response:

[
  {
    "id": 42,
    "timestamp": "2025-10-31T19:30:00.000Z",
    "results": {
      "TenantService": "UP",
      "UserService": "UP",
      "AgencyService": "UP"
    },
    "overall": "ALL_UP"
  }
]

POST /api/cron/run

Triggers an immediate health check of all services.

Response:

{
  "id": 43,
  "timestamp": "2025-10-31T19:31:00.000Z",
  "results": {
    "TenantService": "UP",
    "UserService": "DOWN",
    "AgencyService": "UP"
  },
  "overall": "PARTIAL_DOWN"
}

GET /api/helm-workloads

Returns Helm-managed Deployments, StatefulSets, and DaemonSets in the configured namespace with each container image and runtime image hash/digest from matching pods. When GITHUB_TOKEN or GH_TOKEN is available, ORISO image rows include packageUrl pointing to the exact GitHub package version when the digest or tag can be matched, and sourceBranch is populated from exact package version tags such as pre-dev, dev, or main. Without GitHub package metadata, sourceBranch falls back to workload labels/annotations or image tags. ORISO release image tags such as 2.0.1 are mapped to service release branches such as release/userservice-2.0.1.

Response:

{
  "namespace": "caritas",
  "releaseFilter": ["oriso"],
  "count": 1,
  "generatedAt": "2026-07-25T12:00:00.000Z",
  "workloads": [
    {
      "kind": "Deployment",
      "name": "oriso-userservice",
      "helmRelease": "oriso",
      "containers": [
        {
          "name": "userservice",
          "image": "ghcr.io/openresilienceinitiative/oriso-userservice:rebuild",
          "runningImage": "ghcr.io/openresilienceinitiative/oriso-userservice:rebuild",
          "digest": "sha256:abc123",
          "imageID": "containerd://sha256:abc123",
          "packageName": "oriso-userservice",
          "packageUrl": "https://github.com/OpenResilienceInitiative/ORISO-UserService/pkgs/container/oriso-userservice/123456789?tag=pre-dev",
          "packageTags": ["sha-abcdef1", "pre-dev"],
          "sourceBranch": "pre-dev",
          "sourceBranchUrl": "https://github.com/OpenResilienceInitiative/ORISO-UserService/tree/pre-dev",
          "sourceBranchSource": "GitHub package digest tag"
        }
      ]
    }
  ]
}

The dashboard pod needs RBAC to list pods, deployments, statefulsets, and daemonsets; see kubernetes-rbac.yaml. For exact branch reporting across all services, either deploy ORISO images with branch/release tags such as pre-dev, dev, main, or 2.0.1, or add one of these labels/annotations to workloads during deployment: app.kubernetes.io/source-branch, oriso.org/source-branch, or git.branch.

Architecture

Tech Stack

  • Backend: Node.js + Express
  • Frontend: Vanilla JavaScript (no framework)
  • Styling: Custom CSS (dark theme)
  • Health Checks: HTTP requests to /actuator/health endpoints

How It Works

  1. Dashboard loads list of services from /api/services
  2. Frontend displays services in sidebar
  3. Every 60 seconds, backend performs health checks on all services
  4. Results are stored in memory (last 10 runs)
  5. Frontend polls /api/cron/runs to show historical data
  6. User can click services to see detailed health information
  7. Backend proxies requests to avoid CORS issues

Kubernetes Deployment

Deployment File

Create kubernetes-deployment.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: health-dashboard
  namespace: caritas
spec:
  replicas: 1
  selector:
    matchLabels:
      app: health-dashboard
  template:
    metadata:
      labels:
        app: health-dashboard
    spec:
      hostNetwork: true
      containers:
      - name: health-dashboard
        image: caritas-health-dashboard:latest
        imagePullPolicy: Never
        env:
        - name: PORT
          value: "9001"
        ports:
        - containerPort: 9001
          name: http
---
apiVersion: v1
kind: Service
metadata:
  name: health-dashboard
  namespace: caritas
spec:
  selector:
    app: health-dashboard
  ports:
  - port: 9001
    targetPort: 9001
    name: http

Deploy

kubectl apply -f kubernetes-deployment.yaml

Access

Service URLs

Localhost (with hostNetwork: true)

{
  "TenantService": "http://localhost:8081/actuator/health",
  "UserService": "http://localhost:8082/actuator/health",
  "ConsultingTypeService": "http://localhost:8083/actuator/health",
  "AgencyService": "http://localhost:8084/actuator/health"
}

Kubernetes Service Discovery

{
  "TenantService": "http://tenantservice.caritas.svc.cluster.local:8081/actuator/health",
  "UserService": "http://userservice.caritas.svc.cluster.local:8082/actuator/health",
  "ConsultingTypeService": "http://consultingtypeservice.caritas.svc.cluster.local:8083/actuator/health",
  "AgencyService": "http://agencyservice.caritas.svc.cluster.local:8084/actuator/health"
}

Dashboard UI

Features

  • Sidebar Navigation - List of all services with status indicators
  • Service Details - Click any service to view detailed health information
  • Real-time Status - Green (UP) / Red (DOWN) indicators
  • Response Data - Full JSON response from health endpoints
  • Historical Runs - View last 10 automated health checks

Status Indicators

  • 🟒 Green Dot - Service is UP
  • πŸ”΄ Red Dot - Service is DOWN or unreachable

Monitoring Services

Supported Health Endpoints

The dashboard supports any service exposing:

  • /actuator/health (Spring Boot Actuator)
  • /health (Generic health endpoint)
  • Custom health endpoints returning JSON

Adding New Services

  1. Edit config.json
  2. Add new service entry with name and URL
  3. Restart dashboard
  4. Service will appear in sidebar

Example:

{
  "VideoService": {
    "name": "Video Call Service",
    "url": "http://localhost:8090/actuator/health"
  }
}

Troubleshooting

Dashboard Not Loading

# Check if pod is running
kubectl get pods -n caritas | grep health-dashboard

# Check logs
kubectl logs -n caritas -l app=health-dashboard

Service Showing as DOWN

  1. Check if service pod is running
  2. Verify service URL in config.json
  3. Test health endpoint manually: curl http://localhost:8081/actuator/health
  4. Check for network/firewall issues

CORS Errors

Dashboard uses backend proxy to avoid CORS issues. If you see CORS errors:

  1. Ensure you're accessing dashboard through /api/health/:key endpoint
  2. Check browser console for specific errors
  3. Verify service allows requests from dashboard origin

Development

File Structure

ORISO-HealthDashboard/
β”œβ”€β”€ package.json          # Node.js dependencies
β”œβ”€β”€ server.js             # Express server
β”œβ”€β”€ config.json           # Service configuration
β”œβ”€β”€ Dockerfile            # Docker image
β”œβ”€β”€ public/
β”‚   └── index.html        # Dashboard UI
└── kubernetes-deployment.yaml

Running Locally

npm install
node server.js
# Open http://localhost:9100

Building Docker Image

docker build -t caritas-health-dashboard:latest .

Environment Variables

  • PORT - Server port (default: 9100)
  • NODE_ENV - Environment (development/production)

Integration with Other Tools

With SignOZ

Health dashboard can be monitored by SignOZ for alerting:

  • Monitor dashboard uptime
  • Track service health metrics
  • Alert on service failures

With Nginx

Configure Nginx to proxy health dashboard:

location /health/ {
    proxy_pass http://health-dashboard.caritas.svc.cluster.local:9001/;
}

Important Notes

  • Memory Storage - Health check history is stored in memory (cleared on restart)
  • 60s Interval - Automated checks run every 60 seconds
  • No Authentication - Dashboard has no built-in auth (secure via Nginx/network)
  • Kubernetes-Aware - Can use Kubernetes service discovery
  • Lightweight - Minimal dependencies, fast startup

Access Information

Health Check Format

Services must return JSON with status field:

{
  "status": "UP" or "DOWN",
  "components": {
    "db": { "status": "UP" },
    "diskSpace": { "status": "UP" }
  }
}

Performance

  • Response Time: < 50ms per service
  • Memory Usage: ~ 50MB
  • CPU Usage: Minimal (< 1%)
  • Concurrent Checks: All services checked in parallel

Status: Production Ready βœ…
Port: 9001
Access: http://91.99.219.182:9001/

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages