-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ddbd8f
commit 7d9a4cc
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 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 | ||
|
||
```nix | ||
# In `perSystem.process-compose.<name>` | ||
{ | ||
services.prometheus."pro1".enable = true; | ||
} | ||
``` | ||
|
||
{#tips} | ||
## Tips & Tricks | ||
|
||
{#scrape-configs} | ||
### Adding Scrape Configs | ||
|
||
`scrape_configs`, controls what resources Prometheus monitor. | ||
|
||
Since Prometheus also exposes data about itself as an HTTP endpoint it can scrape and monitor its own health. In the [default example configuration](https://github.com/prometheus/prometheus/blob/3f686cad8bee405229b2532584ef181ce9f6a8b3/documentation/examples/prometheus.yml) there is a single job, called prometheus. | ||
|
||
To add `scrape_configs`, we can use the following config: | ||
|
||
```nix | ||
{ | ||
services.prometheus."pro1" = { | ||
enable = true; | ||
# scrape prometheus | ||
extraConfig = { | ||
scrape_configs = [{ | ||
job_name = "prometheus"; | ||
static_configs = [{ | ||
targets = [ "localhost:9090" ]; | ||
}]; | ||
}]; | ||
}; | ||
}; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters