Skip to content

Commit 7948dfd

Browse files
committed
weird-row-server: add tailscale prometheus exporter
1 parent b2fd15d commit 7948dfd

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

hosts/weird-row-server/grafana.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
local.ports.prometheus = 9001;
1212
local.ports.prometheus-node-exporter = 9002;
13+
local.ports.tailscale-exporter = 9005;
1314
local.ports.caddy-metrics = 2019;
1415
local.ports.authelia-metrics = 9004;
1516
local.ports.headscale-metrics = 9003;
@@ -22,6 +23,7 @@
2223
file = secrets/grafana-smtp-password.age;
2324
owner = "grafana";
2425
};
26+
age.secrets.tailscale-exporter-env.file = secrets/tailscale-exporter-env.age;
2527
services.grafana = {
2628
enable = true;
2729

@@ -86,6 +88,11 @@
8688
enable = true;
8789
port = config.local.ports.prometheus-node-exporter.number;
8890
};
91+
exporters.tailscale = {
92+
enable = true;
93+
port = config.local.ports.tailscale-exporter.number;
94+
environmentFile = config.age.secrets.tailscale-exporter-env.path;
95+
};
8996

9097
# TODO: move them to their respective modules
9198
scrapeConfigs = [
@@ -97,6 +104,7 @@
97104
job_name = "node-exporter";
98105
static_configs = [
99106
{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }
107+
100108
];
101109
}
102110
{
@@ -107,6 +115,12 @@
107115
job_name = "authelia";
108116
static_configs = [ { targets = [ "localhost:${config.local.ports.authelia-metrics.string}" ]; } ];
109117
}
118+
{
119+
job_name = "tailscale";
120+
static_configs = [
121+
{ targets = [ "localhost:${toString config.services.prometheus.exporters.tailscale.port}" ]; }
122+
];
123+
}
110124
];
111125
};
112126

hosts/weird-row-server/secrets/default.nix

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@ let
44
deploy = servers ++ users;
55
in
66
{
7-
# Defines `PDS_JWT_SECRET`, `PDS_ADMIN_PASSWORD`, `PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX`, `PDS_EMAIL_SMTP_URL`, `PDS_EMAIL_FROM_ADDRESS`.
8-
"pds-env.age".publicKeys = deploy;
9-
# Defines `LLDAP_JWT_SECRET`, `LLDAP_KEY_SEED`.
10-
"lldap-env.age".publicKeys = deploy;
11-
"lldap-user-pass.age".publicKeys = deploy;
12-
"headscale-oidc-secret.age".publicKeys = deploy;
13-
"grafana-oidc-secret.age".publicKeys = deploy;
14-
"grafana-smtp-password.age".publicKeys = deploy;
15-
"authelia-jwt-secret.age".publicKeys = deploy;
7+
# Defines `TS_AUTHKEY`, `HETZNER_API_TOKEN`
8+
"caddy-env.age".publicKeys = deploy;
169
"authelia-issuer-private-key.age".publicKeys = deploy;
17-
"authelia-storage-key.age".publicKeys = deploy;
10+
"authelia-jwt-secret.age".publicKeys = deploy;
1811
"authelia-ldap-password.age".publicKeys = deploy;
1912
"authelia-smtp-password.age".publicKeys = deploy;
20-
"tuwunel-registration-tokens.age".publicKeys = deploy;
21-
# Defines `SMTP_PASSWORD`
22-
"vaultwarden-env.age".publicKeys = deploy;
23-
"miniflux-oidc-secret.age".publicKeys = deploy;
13+
"authelia-storage-key.age".publicKeys = deploy;
14+
"grafana-oidc-secret.age".publicKeys = deploy;
15+
"grafana-smtp-password.age".publicKeys = deploy;
16+
"headscale-oidc-secret.age".publicKeys = deploy;
2417
# Defines `HYPIXEL_API_KEY`, `PROFILE_UUID`
2518
"hypixel-bank-tracker-main.age".publicKeys = deploy;
2619
"hypixel-bank-tracker-banana.age".publicKeys = deploy;
27-
"caddy-env.age".publicKeys = deploy;
20+
# Defines `LLDAP_JWT_SECRET`, `LLDAP_KEY_SEED`.
21+
"lldap-env.age".publicKeys = deploy;
22+
"lldap-user-pass.age".publicKeys = deploy;
23+
"miniflux-oidc-secret.age".publicKeys = deploy;
24+
# Defines `PDS_JWT_SECRET`, `PDS_ADMIN_PASSWORD`, `PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX`, `PDS_EMAIL_SMTP_URL`, `PDS_EMAIL_FROM_ADDRESS`.
25+
"pds-env.age".publicKeys = deploy;
26+
# Defines `TAILSCALE_TAILNET`, `TAILSCALE_OAUTH_CLIENT_ID`, `TAILSCALE_OAUTH_CLIENT_SECRET`.
27+
"tailscale-exporter-env.age".publicKeys = deploy;
28+
"tuwunel-registration-tokens.age".publicKeys = deploy;
29+
# Defines `SMTP_PASSWORD`
30+
"vaultwarden-env.age".publicKeys = deploy;
2831
}
577 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)