monitoring: use nats exporter instead of direct scrape
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled

NATS HTTP monitoring endpoint serves JSON, not Prometheus format.
Use the prometheus-nats-exporter which queries the NATS endpoint
and exposes proper Prometheus metrics.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 22:22:04 +01:00
parent 5be1f43c24
commit 8b0a4ea33a

View File

@@ -2,9 +2,14 @@
{ {
homelab.monitoring.scrapeTargets = [{ homelab.monitoring.scrapeTargets = [{
job_name = "nats"; job_name = "nats";
port = 8222; port = 7777;
}]; }];
services.prometheus.exporters.nats = {
enable = true;
url = "http://localhost:8222";
};
services.nats = { services.nats = {
enable = true; enable = true;
jetstream = true; jetstream = true;