Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.18 KB

prometheus.md

File metadata and controls

41 lines (32 loc) · 1.18 KB

Prometheus

Prometheus is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts when specified conditions are observed.

Getting Started

# In `perSystem.process-compose.<name>`
{
  services.prometheus."pro1".enable = true;
}

{#tips}

Tips & Tricks

{#scrape-configs}

Adding Scrape Configs

scrape_configs controls what resources Prometheus monitors.

Since Prometheus also exposes data about itself as an HTTP endpoint it can scrape and monitor its own health. In the default example configuration there is a single job, called prometheus. We can add it to scrape_configs using the following config:

{
  services.prometheus."pro1" = {
    enable = true;
    # scrape prometheus
    extraConfig = {
      scrape_configs = [{
        job_name = "prometheus";
        static_configs = [{
          targets = [ "localhost:9090" ];
        }];
      }];
    };
  };
}