Skip to content

Commit dce531f

Browse files
authored
Merge pull request #2 from y3v63n/monitoring/observability-address
monitoring: reach the observability VM by its tailnet address
2 parents 56ecc77 + c9e4ff0 commit dce531f

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ jobs:
7373
DISCORD_CLIENT_SECRET: ${{ secrets.DISCORD_CLIENT_SECRET }}
7474
X_CLIENT_ID: ${{ vars.X_CLIENT_ID }}
7575
X_CLIENT_SECRET: ${{ secrets.X_CLIENT_SECRET }}
76+
# Tailnet address of the observability VM the monitoring agent
77+
# pushes to (not sensitive, but kept out of the public repo).
78+
OBSERVABILITY_HOST: ${{ vars.OBSERVABILITY_HOST }}

‎ansible/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Push to `main` (or run the workflow manually) triggers the deploy. The runner:
7272
| `DEPLOY_HOST` | Tailnet hostname of the server (defaults to `dashtec-host`) |
7373
| `DISCORD_CLIENT_ID` | Discord OAuth client ID — shared across networks (optional) |
7474
| `X_CLIENT_ID` | X OAuth client ID — shared across networks (optional) |
75+
| `OBSERVABILITY_HOST` | Tailnet address of the Foundation observability VM the monitoring agent pushes to (without it the deploy skips the agent) |
7576

7677
The OAuth client IDs are public, so they're variables rather than secrets; pair
7778
each with its corresponding `*_CLIENT_SECRET`.

‎ansible/group_vars/all/vars.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ x_client_secret: "{{ lookup('env', 'X_CLIENT_SECRET') }}"
4949
alloy_image: "grafana/alloy:v1.16.0"
5050
node_exporter_image: "prom/node-exporter:v1.9.1"
5151
node_exporter_listen: "127.0.0.1:9100"
52-
observability_metrics_url: "http://aztec-observability-fsn1:9090/api/v1/write"
53-
observability_logs_url: "http://aztec-observability-fsn1:3100/loki/api/v1/push"
52+
# Tailnet address of the Foundation observability VM, from the
53+
# OBSERVABILITY_HOST repo variable (kept out of this public repo, like
54+
# DEPLOY_HOST). An address, not the VM's name: this host joins the tailnet
55+
# with --accept-dns=false (terraform/templates/user_data.sh.tftpl), so tailnet
56+
# names do not resolve here.
57+
observability_host: "{{ lookup('env', 'OBSERVABILITY_HOST') }}"
58+
observability_metrics_url: "http://{{ observability_host }}:9090/api/v1/write"
59+
observability_logs_url: "http://{{ observability_host }}:3100/loki/api/v1/push"
5460

5561
# Scrape addresses for the two Ponder /metrics endpoints. These must track
5662
# the compose port mappings (${PONDER_PORT:-42069} / ${PONDER_TESTNET_PORT:-42070})

‎ansible/site.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,19 @@
55
- name: Configure and deploy dashtec
66
hosts: dashtec
77
become: true
8+
pre_tasks:
9+
# Monitoring must never block an app deploy: without the address the
10+
# agent is skipped (and the DashtecSilent alert reports the gap).
11+
- name: Warn when the monitoring agent is not configured
12+
ansible.builtin.debug:
13+
msg: >-
14+
OBSERVABILITY_HOST is not set: skipping the monitoring agent. Set
15+
the repo variable to the observability VM's tailnet address.
16+
when: observability_host | length == 0
817
roles:
918
- docker # Docker Engine + compose plugin + git
10-
- alloy # host metrics + container logs + Ponder /metrics -> observability VM
19+
- role: alloy # host metrics + container logs + Ponder /metrics -> observability VM
20+
when: observability_host | length > 0
1121
- repo # clone/update /opt/dashtec
1222
- config # config.json secrets -> root .env (secrets from env)
1323
- aztec_node # start our own Aztec node, discover V5 contract addresses

0 commit comments

Comments
 (0)