Skip to content

Instantly share code, notes, and snippets.

@LnL7
Last active May 27, 2020 17:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LnL7/1b22c1b5d69a9975053f10df17ffe371 to your computer and use it in GitHub Desktop.
Save LnL7/1b22c1b5d69a9975053f10df17ffe371 to your computer and use it in GitHub Desktop.
{
services.nginx.virtualHosts."hostname".locations."/prometheus".proxyPass = "http://127.0.0.1:9090";
services.prometheus.enable = true;
services.prometheus.stateDir = "prometheus2";
services.prometheus.extraFlags = [ "--web.external-url=http://hostname/prometheus/" "--storage.tsdb.retention.time=3d" ];
services.prometheus.scrapeConfigs = [
{
job_name = "node";
static_configs = [{ targets = ["hostname:9100"]; labels.distro = "nixos"; }];
}
];
services.prometheus.exporters.node.enable = true;
services.prometheus.exporters.node.enabledCollectors = [ "systemd" ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment