mirror of
				https://github.com/Stunkymonkey/nixos.git
				synced 2025-11-04 11:36:57 +01:00 
			
		
		
		
	system/docker: enable monitoring
This commit is contained in:
		
							parent
							
								
									dc7c6bce75
								
							
						
					
					
						commit
						f8bb1d0886
					
				
					 2 changed files with 35 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -18,5 +18,33 @@ in
 | 
			
		|||
      enable = true;
 | 
			
		||||
      autoPrune.enable = true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    services.cadvisor.enable = config.services.prometheus.enable;
 | 
			
		||||
 | 
			
		||||
    services.prometheus = {
 | 
			
		||||
      scrapeConfigs = [
 | 
			
		||||
        {
 | 
			
		||||
          job_name = "docker";
 | 
			
		||||
          static_configs = [
 | 
			
		||||
            {
 | 
			
		||||
              targets = [ "127.0.0.1:${toString config.services.cadvisor.port}" ];
 | 
			
		||||
              labels = {
 | 
			
		||||
                instance = config.networking.hostName;
 | 
			
		||||
              };
 | 
			
		||||
            }
 | 
			
		||||
          ];
 | 
			
		||||
        }
 | 
			
		||||
      ];
 | 
			
		||||
    };
 | 
			
		||||
    # dashboard untested
 | 
			
		||||
    services.grafana.provision = {
 | 
			
		||||
      dashboards.settings.providers = [
 | 
			
		||||
        {
 | 
			
		||||
          name = "Docker";
 | 
			
		||||
          options.path = pkgs.grafana-dashboards.cadvisor;
 | 
			
		||||
          disableDeletion = true;
 | 
			
		||||
        }
 | 
			
		||||
      ];
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,6 +67,13 @@ in
 | 
			
		|||
    src = ./navidrome.json; # sadly data source is not detected
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  cadvisor = buildGrafanaDashboard {
 | 
			
		||||
    id = 10619;
 | 
			
		||||
    pname = "cadvisor";
 | 
			
		||||
    version = "1";
 | 
			
		||||
    hash = "sha256-T1HqWbwt+i/Wa+Y2B7hclaCijGxZF5QI38aPcXjk9y0=";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  loki = (buildGrafanaDashboard {
 | 
			
		||||
    id = 13407;
 | 
			
		||||
    pname = "loki";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue