# aditisingh0562/system-health architecture

> Architecture diagram of the GitHub repository aditisingh0562/system-health, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aditisingh0562/system-health
- Repository: https://github.com/aditisingh0562/system-health

## Overview

This repository is a real-machine monitoring stack: a Spring service collects OS metrics, Prometheus scrapes and serves them, Grafana visualizes them, and an MCP server exposes conversational queries. The README documents the main data flow and capabilities; Java implementation details were not sampled, so internal call relationships are limited to those it describes.

Main entry points: [`system-health-service/src/main/java/com/example/systemhealth/SystemHealthController.java`](https://github.com/aditisingh0562/system-health/blob/main/system-health-service/src/main/java/com/example/systemhealth/SystemHealthController.java) (Health API), [`system-health-service/src/main/java/com/example/systemhealth/SystemMetricsService.java`](https://github.com/aditisingh0562/system-health/blob/main/system-health-service/src/main/java/com/example/systemhealth/SystemMetricsService.java) (Metrics service), [`prometheus/prometheus.yml`](https://github.com/aditisingh0562/system-health/blob/main/prometheus/prometheus.yml) (Prometheus), [`grafana/provisioning/datasources/datasource.yml`](https://github.com/aditisingh0562/system-health/blob/main/grafana/provisioning/datasources/datasource.yml) (Grafana)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Metric collection"]
  node_metrics["Metrics service"]
  node_oshi["OSHI readings"]
  node_micrometer["Micrometer gauges"]
end

subgraph group_monitoring["Metrics and dashboards"]
  node_promconfig["Scrape configuration<br/>[prometheus.yml]"]
  node_prometheus[("Prometheus<br/>[prometheus.yml]")]
  node_grafana["Grafana<br/>[datasource.yml]"]
  node_dashboard["Health dashboard"]
  node_dashboardconfig["Dashboard provisioning<br/>[dashboard.yml]"]
end

subgraph group_assistant["Conversational queries"]
  node_mcp["MCP tools<br/>[server.py]"]
end

subgraph group_operations["Service operations"]
  node_controller["Health API"]
  node_appconfig["Service configuration<br/>[application.yml]"]
end

node_operator(("Operator"))
node_host["Machine OS"]
node_mcpclient(("MCP client"))

node_operator -->|"requests health"| node_controller
node_operator -->|"starts stress test"| node_controller
node_metrics -->|"reads metrics"| node_host
node_metrics -->|"uses OSHI"| node_oshi
node_metrics -->|"registers gauges"| node_micrometer
node_controller -.->|"exposes readings"| node_metrics
node_appconfig -.->|"configures service"| node_controller
node_promconfig -->|"configures scraping"| node_prometheus
node_prometheus -->|"scrapes metrics"| node_controller
node_grafana -->|"queries metrics"| node_prometheus
node_dashboardconfig -->|"provisions dashboard"| node_dashboard
node_dashboard -->|"visualizes metrics"| node_grafana
node_mcpclient -->|"invokes tools"| node_mcp
node_mcp -->|"queries API"| node_prometheus

click node_controller "https://github.com/aditisingh0562/system-health/blob/main/system-health-service/src/main/java/com/example/systemhealth/SystemHealthController.java"
click node_metrics "https://github.com/aditisingh0562/system-health/blob/main/system-health-service/src/main/java/com/example/systemhealth/SystemMetricsService.java"
click node_appconfig "https://github.com/aditisingh0562/system-health/blob/main/system-health-service/src/main/resources/application.yml"
click node_promconfig "https://github.com/aditisingh0562/system-health/blob/main/prometheus/prometheus.yml"
click node_prometheus "https://github.com/aditisingh0562/system-health/blob/main/prometheus/prometheus.yml"
click node_grafana "https://github.com/aditisingh0562/system-health/blob/main/grafana/provisioning/datasources/datasource.yml"
click node_dashboard "https://github.com/aditisingh0562/system-health/blob/main/grafana/provisioning/dashboards/system-health-dashboard.json"
click node_dashboardconfig "https://github.com/aditisingh0562/system-health/blob/main/grafana/provisioning/dashboards/dashboard.yml"
click node_mcp "https://github.com/aditisingh0562/system-health/blob/main/mcp-server/server.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_metrics,node_oshi,node_micrometer,node_mcpclient toneBlue
class node_promconfig,node_prometheus,node_grafana,node_dashboard,node_dashboardconfig toneAmber
class node_mcp toneMint
class node_controller,node_appconfig toneRose
class node_operator,node_host toneIndigo
```

## Components

### Metric collection

- [Metrics service](https://github.com/aditisingh0562/system-health/blob/main/system-health-service/src/main/java/com/example/systemhealth/SystemMetricsService.java): `system-health-service/src/main/java/com/example/systemhealth/SystemMetricsService.java`
- **OSHI readings**
- **Micrometer gauges**

### Metrics and dashboards

- [Scrape configuration](https://github.com/aditisingh0562/system-health/blob/main/prometheus/prometheus.yml): `prometheus/prometheus.yml`
- [Prometheus](https://github.com/aditisingh0562/system-health/blob/main/prometheus/prometheus.yml): `prometheus/prometheus.yml`
- [Grafana](https://github.com/aditisingh0562/system-health/blob/main/grafana/provisioning/datasources/datasource.yml): `grafana/provisioning/datasources/datasource.yml`
- [Health dashboard](https://github.com/aditisingh0562/system-health/blob/main/grafana/provisioning/dashboards/system-health-dashboard.json): `grafana/provisioning/dashboards/system-health-dashboard.json`
- [Dashboard provisioning](https://github.com/aditisingh0562/system-health/blob/main/grafana/provisioning/dashboards/dashboard.yml): `grafana/provisioning/dashboards/dashboard.yml`

### Conversational queries

- [MCP tools](https://github.com/aditisingh0562/system-health/blob/main/mcp-server/server.py): `mcp-server/server.py`

### Service operations

- [Health API](https://github.com/aditisingh0562/system-health/blob/main/system-health-service/src/main/java/com/example/systemhealth/SystemHealthController.java): `system-health-service/src/main/java/com/example/systemhealth/SystemHealthController.java`
- [Service configuration](https://github.com/aditisingh0562/system-health/blob/main/system-health-service/src/main/resources/application.yml): `system-health-service/src/main/resources/application.yml`

### Other components

- **Operator**
- **Machine OS**
- **MCP client**

## Connections

- Operator → Health API: requests health (evidence: `README.md`)
- Operator → Health API: starts stress test (evidence: `README.md`)
- Metrics service → Machine OS: reads metrics (evidence: `README.md`)
- Metrics service → OSHI readings: uses OSHI (evidence: `README.md`)
- Metrics service → Micrometer gauges: registers gauges (evidence: `README.md`)
- Health API → Metrics service: exposes readings
- Service configuration → Health API: configures service
- Scrape configuration → Prometheus: configures scraping (evidence: `README.md`)
- Prometheus → Health API: scrapes metrics (evidence: `README.md`)
- Grafana → Prometheus: queries metrics (evidence: `README.md`)
- Dashboard provisioning → Health dashboard: provisions dashboard (evidence: `README.md`)
- Health dashboard → Grafana: visualizes metrics (evidence: `README.md`)
- MCP client → MCP tools: invokes tools (evidence: `README.md`)
- MCP tools → Prometheus: queries API (evidence: `mcp-server/server.py`)
