summaryrefslogtreecommitdiff
path: root/systems
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2025-02-15 00:11:43 -0500
committerSeth Flynn <[email protected]>2025-02-15 01:18:39 -0500
commit539f23daf05c81d4239b068254ff61598376da9e (patch)
tree3bb9d2b783a2c3a4e254b0a419caa7c83a60b277 /systems
parenteb1267e54b3ff75c73ddb9c4f67041d21bf82caa (diff)
atlas: collect more metrics for local services
Diffstat (limited to 'systems')
-rw-r--r--systems/atlas/miniflux.nix27
-rw-r--r--systems/atlas/victoria-metrics.nix47
2 files changed, 62 insertions, 12 deletions
diff --git a/systems/atlas/miniflux.nix b/systems/atlas/miniflux.nix
index 5fd22f2..14c9fc5 100644
--- a/systems/atlas/miniflux.nix
+++ b/systems/atlas/miniflux.nix
@@ -1,6 +1,5 @@
{
config,
- lib,
secretsDir,
...
}:
@@ -14,28 +13,32 @@
adminCredentialsFile = config.age.secrets.miniflux.path;
config = {
BASE_URL = "https://miniflux.${config.networking.domain}";
+ LISTEN_ADDR = "localhost:7000";
+ METRICS_COLLECTOR = 1;
};
};
nginx.virtualHosts = {
"miniflux.getchoo.com" = {
locations."/" = {
- proxyPass = "http://unix:${lib.head config.systemd.sockets.miniflux.listenStreams}";
+ proxyPass = "http://${config.services.miniflux.config.LISTEN_ADDR}";
};
};
};
};
- # Create the socket manually to ensure NGINX has permission for the socket's parent directory
- # ...since for some reason Miniflux will not give it the same `0777` permission as the socket itself
- systemd = {
- services.miniflux = {
- requires = [ "miniflux.socket" ];
- };
+ /*
+ # Create the socket manually to ensure NGINX has permission for the socket's parent directory
+ # ...since for some reason Miniflux will not give it the same `0777` permission as the socket itself
+ systemd = {
+ services.miniflux = {
+ requires = [ "miniflux.socket" ];
+ };
- sockets.miniflux = {
- wantedBy = [ "sockets.target" ];
- listenStreams = [ "/run/miniflux.sock" ];
+ sockets.miniflux = {
+ wantedBy = [ "sockets.target" ];
+ listenStreams = [ "/run/miniflux.sock" ];
+ };
};
- };
+ */
}
diff --git a/systems/atlas/victoria-metrics.nix b/systems/atlas/victoria-metrics.nix
index 25f0e57..fba00ae 100644
--- a/systems/atlas/victoria-metrics.nix
+++ b/systems/atlas/victoria-metrics.nix
@@ -1,4 +1,5 @@
{
+ config,
lib,
inputs,
...
@@ -41,10 +42,56 @@ in
prometheusConfig = {
scrape_configs = [
{
+ job_name = "forgejo";
+ metrics_path = "/metrics";
+ static_configs = [
+ {
+ targets = [
+ "http://${config.services.forgejo.settings.server.HTTP_ADDR}:${toString config.services.forgejo.settings.server.HTTP_PORT}"
+ ];
+ labels.type = "forgejo";
+ }
+ ];
+ }
+
+ {
+ job_name = "miniflux";
+ metrics_path = "/metrics";
+ static_configs = [
+ {
+ targets = [ "http://${config.services.miniflux.config.LISTEN_ADDR}" ];
+ labels.type = "miniflux";
+ }
+ ];
+ }
+
+ {
job_name = "node-exporter";
metrics_path = "/metrics";
static_configs = remoteNodes;
}
+
+ {
+ job_name = "victoria-logs";
+ metrics_path = "/metrics";
+ static_configs = [
+ {
+ targets = [ "localhost:9428" ];
+ labels.type = "victoria-logs";
+ }
+ ];
+ }
+
+ {
+ job_name = "victoria-metrics";
+ metrics_path = "/metrics";
+ static_configs = [
+ {
+ targets = [ "localhost${config.services.victoriametrics.listenAddress}" ];
+ labels.type = "victoria-logs";
+ }
+ ];
+ }
];
};
};