# 45drives/monitoring-stack architecture

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

- Interactive diagram: https://gitdiagram.com/45drives/monitoring-stack
- Repository: https://github.com/45drives/monitoring-stack

## Overview

This Ansible repository deploys a monitoring stack: an operator runs the deployment playbook against inventory groups, installing metrics services and exporters on their respective hosts. Exporters provide monitoring data; Prometheus collects and stores metrics, Grafana displays them, and Alertmanager sends configured notifications. The README documents these product relationships, but no source excerpts were provided, so internal task-level orchestration and undocumented connections are omitted.

Main entry points: [`hosts.sample`](https://github.com/45drives/monitoring-stack/blob/master/hosts.sample) (Host Inventory), [`roles/prometheus`](https://github.com/45drives/monitoring-stack/tree/master/roles/prometheus) (Prometheus), [`deploy-monitoring.yml`](https://github.com/45drives/monitoring-stack/blob/master/deploy-monitoring.yml) (Deploy Playbook), [`roles/node-exporter`](https://github.com/45drives/monitoring-stack/tree/master/roles/node-exporter) (Node Exporter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Deployment"]
  node_deploy["Deploy Playbook"]
  node_purge["Purge Playbook"]
  node_container_engine["Container Engine<br/>[main.yml]"]
end

subgraph group_exporters["Exporters"]
  node_node_exporter["Node Exporter"]
  node_znapzend_exporter["ZnapZend Exporter"]
  node_zfs_exporter["ZFS Exporter"]
end

subgraph group_metrics["Metrics Stack"]
  node_prometheus[("Prometheus")]
  node_alertmanager["Alertmanager"]
  node_grafana["Grafana"]
end

subgraph group_configuration["Configuration"]
  node_inventory["Host Inventory<br/>[hosts.sample]"]
  node_host_settings["Group Settings"]
end

node_operator(("Operator"))
node_email(("Email Recipient"))

node_operator -->|"runs"| node_deploy
node_operator -->|"runs"| node_purge
node_deploy -->|"targets hosts"| node_inventory
node_deploy -->|"deploys containers"| node_container_engine
node_inventory -->|"configures groups"| node_host_settings
node_inventory -->|"assigns exporters"| node_node_exporter
node_inventory -->|"assigns exporters"| node_znapzend_exporter
node_inventory -->|"assigns metrics"| node_prometheus
node_inventory -->|"assigns metrics"| node_alertmanager
node_inventory -->|"assigns metrics"| node_grafana
node_node_exporter -->|"serves metrics"| node_prometheus
node_znapzend_exporter -->|"serves metrics"| node_prometheus
node_prometheus -->|"provides metrics"| node_grafana
node_prometheus -->|"provides alert data"| node_alertmanager
node_alertmanager -->|"sends alerts"| node_email

click node_deploy "https://github.com/45drives/monitoring-stack/blob/master/deploy-monitoring.yml"
click node_purge "https://github.com/45drives/monitoring-stack/blob/master/purge-monitoring.yml"
click node_container_engine "https://github.com/45drives/monitoring-stack/blob/master/roles/container-engine/tasks/main.yml"
click node_inventory "https://github.com/45drives/monitoring-stack/blob/master/hosts.sample"
click node_host_settings "https://github.com/45drives/monitoring-stack/tree/master/group_vars"
click node_node_exporter "https://github.com/45drives/monitoring-stack/tree/master/roles/node-exporter"
click node_znapzend_exporter "https://github.com/45drives/monitoring-stack/tree/master/roles/znapzend-exporter"
click node_zfs_exporter "https://github.com/45drives/monitoring-stack/tree/master/roles/zfs-exporter"
click node_prometheus "https://github.com/45drives/monitoring-stack/tree/master/roles/prometheus"
click node_alertmanager "https://github.com/45drives/monitoring-stack/tree/master/roles/prometheus"
click node_grafana "https://github.com/45drives/monitoring-stack/tree/master/roles/grafana"

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_deploy,node_purge,node_container_engine toneBlue
class node_node_exporter,node_znapzend_exporter,node_zfs_exporter toneAmber
class node_prometheus,node_alertmanager,node_grafana toneMint
class node_inventory,node_host_settings toneRose
class node_operator,node_email toneIndigo
```

## Components

### Deployment

- [Deploy Playbook](https://github.com/45drives/monitoring-stack/blob/master/deploy-monitoring.yml): `deploy-monitoring.yml`
- [Purge Playbook](https://github.com/45drives/monitoring-stack/blob/master/purge-monitoring.yml): `purge-monitoring.yml`
- [Container Engine](https://github.com/45drives/monitoring-stack/blob/master/roles/container-engine/tasks/main.yml): `roles/container-engine/tasks/main.yml`

### Exporters

- [Node Exporter](https://github.com/45drives/monitoring-stack/tree/master/roles/node-exporter): `roles/node-exporter`
- [ZnapZend Exporter](https://github.com/45drives/monitoring-stack/tree/master/roles/znapzend-exporter): `roles/znapzend-exporter`
- [ZFS Exporter](https://github.com/45drives/monitoring-stack/tree/master/roles/zfs-exporter): `roles/zfs-exporter`

### Metrics Stack

- [Prometheus](https://github.com/45drives/monitoring-stack/tree/master/roles/prometheus): `roles/prometheus`
- [Alertmanager](https://github.com/45drives/monitoring-stack/tree/master/roles/prometheus): `roles/prometheus`
- [Grafana](https://github.com/45drives/monitoring-stack/tree/master/roles/grafana): `roles/grafana`

### Configuration

- [Host Inventory](https://github.com/45drives/monitoring-stack/blob/master/hosts.sample): `hosts.sample`
- [Group Settings](https://github.com/45drives/monitoring-stack/tree/master/group_vars): `group_vars`

### Other components

- **Operator**
- **Email Recipient**

## Connections

- Operator → Deploy Playbook: runs (evidence: `Readme.md`)
- Operator → Purge Playbook: runs (evidence: `Readme.md`)
- Deploy Playbook → Host Inventory: targets hosts (evidence: `Readme.md`)
- Deploy Playbook → Container Engine: deploys containers (evidence: `Readme.md`)
- Host Inventory → Group Settings: configures groups (evidence: `Readme.md`)
- Host Inventory → Node Exporter: assigns exporters (evidence: `Readme.md`)
- Host Inventory → ZnapZend Exporter: assigns exporters (evidence: `Readme.md`)
- Host Inventory → Prometheus: assigns metrics (evidence: `Readme.md`)
- Host Inventory → Alertmanager: assigns metrics (evidence: `Readme.md`)
- Host Inventory → Grafana: assigns metrics (evidence: `Readme.md`)
- Node Exporter → Prometheus: serves metrics (evidence: `Readme.md`)
- ZnapZend Exporter → Prometheus: serves metrics (evidence: `Readme.md`)
- Prometheus → Grafana: provides metrics (evidence: `Readme.md`)
- Prometheus → Alertmanager: provides alert data (evidence: `Readme.md`)
- Alertmanager → Email Recipient: sends alerts (evidence: `Readme.md`)
