-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prometheus_exporter installed and initial docu written
- Loading branch information
Showing
4 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
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
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,30 @@ | ||
# Monitoring | ||
|
||
## Getting started (development mode): Setting up prometheus & grafana | ||
|
||
0. Start prometheus_exporter in the mampf container | ||
`sudo docker-compose exec mampf prometheus_exporter -b 0.0.0.0` | ||
1. Setup prometheus in development | ||
|
||
```sh | ||
cd docker/development | ||
sudo docker run -d \ | ||
-p 9090:9090 \ | ||
--name prometheus -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \ | ||
prom/prometheus | ||
# Add to mampf dev network | ||
sudo docker network connect development_default prometheus | ||
``` | ||
2. setup Grafana: | ||
|
||
```sh | ||
sudo docker run -d \ | ||
-p 2345:2345 \ | ||
--name grafana \ | ||
-e "GF_SERVER_HTTP_PORT=2345" \ | ||
grafana/grafana | ||
``` | ||
3. Now visit localhost:2345 and configure the datasource (`prometheus:9090`) | ||
4. Setup the dashboard, interisting metrics: | ||
- `rate(ruby_collector_sessions_total[5m])` | ||
- `rate(ruby_http_requests_total[5m])` |
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,7 @@ | ||
# in config/initializers/prometheus.rb | ||
if Rails.env != "test" | ||
require 'prometheus_exporter/middleware' | ||
|
||
# This reports stats per request like HTTP status and timings | ||
Rails.application.middleware.unshift PrometheusExporter::Middleware | ||
end |