tasks:grafana_agent_setup_for_lab_nodes_monitoring
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| tasks:grafana_agent_setup_for_lab_nodes_monitoring [2026/04/16 12:07] – created akraitman | tasks:grafana_agent_setup_for_lab_nodes_monitoring [2026/05/03 14:31] (current) – akraitman | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | --- | + | |
| **Grafana Agent Setup for Lab Nodes Monitoring** | **Grafana Agent Setup for Lab Nodes Monitoring** | ||
| - | ### Overview | + | ** Overview |
| - | The `grafana_agent` Ansible role deploys **Grafana Agent** (static mode) on Lab Nodes to collect system metrics and forward them to a central **Mimir** instance. | + | The grafana_agent Ansible role deploys **Grafana Agent** (static mode) on Lab Nodes to collect system metrics and forward them to a central **Mimir** instance. |
| This setup replaces or coexists with the previous Prometheus + node_exporter approach, providing a lightweight agent that pushes metrics into Mimir for long-term storage and Grafana dashboards. | This setup replaces or coexists with the previous Prometheus + node_exporter approach, providing a lightweight agent that pushes metrics into Mimir for long-term storage and Grafana dashboards. | ||
| - | ### Architecture & Data Flow | + | ** Architecture & Data Flow ** |
| - | ``` | + | |
| - | [ Lab Nodes ] | + | |
| │ | │ | ||
| ▼ | ▼ | ||
| - | node_exporter (on every node) | + | node_exporter (on every lab node) |
| │ | │ | ||
| ▼ | ▼ | ||
| - | Grafana Agent (on every node) | + | Grafana Agent (on every lab node) |
| │ | │ | ||
| ▼ (remote_write over HTTPS) | ▼ (remote_write over HTTPS) | ||
| Line 26: | Line 26: | ||
| ▼ | ▼ | ||
| | | ||
| - | ``` | + | |
| **Components explained: | **Components explained: | ||
| 1. **node_exporter** | 1. **node_exporter** | ||
| - | - Installed on every host (`prometheus-node-exporter` on Debian/ | + | - Installed on every host (prometheus-node-exporter on Debian/ |
| - | - Exposes standard host metrics (CPU, memory, disk, network, etc.) on `http:// | + | - Exposes standard host metrics (CPU, memory, disk, network, etc.) on http:// |
| 2. **Grafana Agent** | 2. **Grafana Agent** | ||
| - Lightweight Prometheus-compatible agent | - Lightweight Prometheus-compatible agent | ||
| - | - Scrapes | + | - Scrapes node_exporter locally from localhost: |
| - Relabels the instance using the host’s FQDN | - Relabels the instance using the host’s FQDN | ||
| - | - Forwards all collected metrics to the central Mimir using the `remote_write` protocol | + | - Forwards all collected metrics to the central Mimir using the remote_write protocol |
| 3. **Mimir** | 3. **Mimir** | ||
| Line 44: | Line 44: | ||
| - Accepts metrics via the remote_write protocol with basic authentication | - Accepts metrics via the remote_write protocol with basic authentication | ||
| - | ### Configuration Details | + | ** Configuration Details |
| - | **Grafana Agent config** (`/ | + | **Grafana Agent config** (/ |
| - | - Global scrape interval: | + | - Global scrape interval: 60s (configurable via scrape_interval_global) |
| - | - Scrapes the `node` job from `localhost: | + | - Scrapes the node job from localhost: |
| - Applies relabeling: | - Applies relabeling: | ||
| - | - `instance`: `< | + | - instance: < |
| - | - `nodename`: `< | + | - nodename: < |
| - | - Forwards metrics to Mimir with basic auth credentials stored in the secrets repository | + | - Forwards metrics to Mimir with basic auth credentials stored in the secrets repository(in mimir_password.yml): |
| - | + | ||
| - | **Secrets required** | + | |
| - | + | ||
| - | - `mimir_username` | + | |
| - | - `mimir_password` | + | |
| - | - Grafana repository URLs (`grafana_apt_repo_key_url`, | + | |
| - | - `agent_mimir_url` | + | |
| - | + | ||
| - | ### Mimir Endpoint | + | |
| - | `https:// | + | ** Mimir Endpoints ** |
| + | Internal | ||
| + | | ||
| + | |||
| + | External | ||
| + | https:// | ||
| - | --- | ||
tasks/grafana_agent_setup_for_lab_nodes_monitoring.1776341224.txt.gz · Last modified: by akraitman
