Skip to content

Commit cde02af

Browse files
committed
add metrology doc
1 parent 457a775 commit cde02af

2 files changed

Lines changed: 117 additions & 0 deletions

File tree

content/en/docs/customization/metrology.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,120 @@ title: Metrology & Instrumentation
33
description: Monitor and instrument Kowabunga services
44
weight: 2
55
---
6+
7+
Kowabunga comes with bundled support for metrology and instrumentation. No one would ever deploy and maintain a blackbox infrastructure and support it empty handed.
8+
9+
If you're SysAdmin (or DevOps, whatever the name now), and are willing care about monitoring, you'e got 2 options:
10+
11+
- Use you're already existing and in-place monitoring stack and tools.
12+
- Rely on Kowabunga-bundled ones.
13+
14+
In the second option, **Kowabunga** optionnally comes bundled with:
15+
16+
- [Grafana](https://grafana.com/oss/grafana/), [VictoriaMetrics](https://victoriametrics.com/products/open-source/) and [VictoriaLogs](https://victoriametrics.com/products/victorialogs/), hosted on **Kahuna** server, providing logs and metrics TimeSeries database storage and observability dashboards.
17+
- [Grafana Alloy](https://grafana.com/oss/alloy-opentelemetry-collector/) agent, hosted on **Kahuna**, **Kiwi** and **Kaktus** nodes, collecting data and streaming to **Kahuna**.
18+
19+
## DNS Configuration
20+
21+
Let's start by defining two new public endpoints for metrics and logs collection. We'll expose them over HTTPS on **Kahuna** so that all infrastructure nodes will be shipping data to.
22+
23+
In our example, we'll use **metrics.acme.com** and **logs.acme.com** as new receiving endpoint. Note that both endpoints will be filtered by HTTPS Basic Authentication so only genuine infrastructure nodes can push to. We'll also be using **grafana.acme.com** as the monitoring instance. Please make sure to configure your DNS registrar accordingly (manually or through TF or such), so these subdomains match your **Kahuna** public IP address.
24+
25+
## Client-Side Enablement
26+
27+
Next, we'll extend our infrastructure's declarations in Ansible. For that, we'll:
28+
29+
- globally enabled metrology capability.
30+
- enable agent's deployment on all infrastructure instances.
31+
- declare the public metrics and logs receiving endpoints.
32+
- set secure credentials for client/server data shipment and collection.
33+
34+
As to do so, extend your platform's **ansible/inventories/group_vars/all/main.yml** file with the following:
35+
36+
```yaml
37+
kowabunga_metrology_enabled: true
38+
kowabunga_metrology_agent_metrics_enabled: true
39+
kowabunga_metrology_agent_logs_enabled: true
40+
kowabunga_metrology_server_metrics_public_url: "https://metrics.acme.com"
41+
kowabunga_metrology_server_logs_public_url: "https://logs.acme.com"
42+
```
43+
44+
and declare strong robust platform into **ansible/inventories/group_vars/all.sops.yml**:
45+
46+
```yaml
47+
secret_kowabunga_metrology_server_metrics_auth_password: ROBUST_PASSWORD_FOR_METRICS
48+
secret_kowabunga_metrology_server_logs_auth_password: ROBUST_PASSWORD_FOR_LOGS
49+
```
50+
51+
and apply for changes on all **Kiwi** and **Kaktus** instances:
52+
53+
```sh
54+
$ kobra ansible deploy -p kowabunga.cloud.kiwi
55+
$ kobra ansible deploy -p kowabunga.cloud.kaktus
56+
```
57+
58+
Once done, all your private instances should now have a running **Grafana Alloy** agent, collecting the various local metrics (CPU usage, memory, network, disk, libvirt, Ceph ...) and associated logs an pushing them to **Kahuna** remote endpoint.
59+
60+
## Server-Side Enablement
61+
62+
It's now time to handle server-side counter part. Let's enable these into **Kahuna**'s configuration by extending the **ansible/inventories/group_vars/kahuna/main.yml** file:
63+
64+
```yaml
65+
kowabunga_metrology_dashboard_enabled: true
66+
kowabunga_metrology_dashboard_public_url: "https://grafana.kowabunga.cloud"
67+
kowabunga_metrology_server_metrics_enabled: true
68+
kowabunga_metrology_server_metrics_retention_period: 7d
69+
70+
kowabunga_metrology_server_logs_enabled: true
71+
kowabunga_metrology_server_logs_retention_period: 7d
72+
```
73+
74+
and adding a secret for Grafana's **admin** user in **ansible/inventories/group_vars/kahuna.sops.yml**:
75+
76+
```yaml
77+
secret_kowabunga_metrology_dashboard_admin_password: ROBUST_PASSWORD_FOR_GRAFANA_ADMIN
78+
```
79+
80+
Note that in our example, we've limited metrics and logs retention server-side to 7 days. We'll free to define different persistence duration that suits your needs.
81+
82+
Following [Ansible collection documentation](https://ansible.kowabunga.cloud/kowabunga/cloud/metrology_role.html#ansible-collections-kowabunga-cloud-metrology-role), you can also pre-configure addidtional Grafana users for your organization, e.g:
83+
84+
```yaml
85+
kowabunga_metrology_dashboard_extra_users:
86+
- name: John Doe
87+
login: jdoe
88+
email: jdoe@acme.com
89+
password: A_STRONG_ONE
90+
```
91+
92+
Again, apply for changes on all **Kahuna** instance:
93+
94+
```sh
95+
$ kobra ansible deploy -p kowabunga.cloud.kahuna
96+
```
97+
98+
Once done, **Kahuna** will then starts collecting data from all infrastructure node (push, not pull) and **Grafana** will be ready to be consumed.
99+
100+
## Provisioning Grafana dashboards
101+
102+
This stage unfortunately cannot be automated at the moment ;-(
103+
104+
Kowabunga comes bundled with ready-to-be-consumed dashboards. They are maintained in a dedicated [GitHub repository](https://github.com/kowabunga-cloud/grafana-dashboards) and, if you're familiar with Grafana, can't be simply copy/pasted or imported.
105+
106+
Best option however is to take profit of [Grafana v12 Git Sync feature](https://grafana.com/docs/grafana/latest/observability-as-code/provision-resources/git-sync-setup/). It allows you to seamlessly connect your Grafana instance to our (or yours forked one) [GitHub dashboard repository](https://github.com/kowabunga-cloud/grafana-dashboards).
107+
108+
Once configured, Grafana will automatically pull for any changes (so you're always up-to-date) and any edition you'd make would automatically trigger a pull-request on save.
109+
110+
Setup can be performed (manually only) through **Administration / Provisioning** menu, as detailed below:
111+
112+
![Grafana Git Sync Provisioning](/images//grafana-git-sync-provisioning.png)
113+
114+
You'll need to first setup a [GitHub Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) (or PAT) to Kowabunga' repository (or yours, for convenience).
115+
116+
Then simply forward the wizard:
117+
118+
- Repository URL: **https://github.com/kowabunga-cloud/grafana-dashboards**
119+
- Branch name: **master**
120+
- Path: **grafana/**
121+
122+
and wait for synchronization to happen.
180 KB
Loading

0 commit comments

Comments
 (0)