Skip to content

Commit

Permalink
prometheus: add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
conscious-puppet committed Feb 27, 2024
1 parent 8ddbd8f commit 7d9a4cc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions doc/prometheus.md
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" ];
}];
}];
};
};
}
```
1 change: 1 addition & 0 deletions doc/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ short-title: Services
- [ ] Redis Cluster
- [ ] Zookeeper
- [x] [[grafana]]#
- [X] [[prometheus]]#
- [ ] ...

[gh]: https://github.com/juspay/services-flake

0 comments on commit 7d9a4cc

Please sign in to comment.