Skip to content

Commit 2a2c9ad

Browse files
committed
Add metrics service backed by Prometheus
- This is the first step towards adding some observability into the backend server - For now, the Prometheus service just monitors itself, scraping metrics at the default rate of once per minute - v2.53 is the current LTS build, which will be supported until 2025-07-31 - https://prometheus.io/docs/introduction/release-cycle/ - Ad-hoc queries can be run against the dev service via the web UI at http://localhost:9090 or against the remote host by creating an ssh tunnel and then hitting the same website - `ssh -L 9090:localhost:9090 org -N` - https://prometheus.io - https://prometheus.io/docs/prometheus/latest/installation/#using-docker - https://prometheus.io/docs/prometheus/latest/getting_started/ - https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config
1 parent 703cbb2 commit 2a2c9ad

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

ARCHITECTURE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Certbot sevice for renewing Let's Encrypt TLS certificates.
3737

3838
For load testing the server using the Apache JMeter application and CLI.
3939

40+
### `metrics`
41+
42+
[Prometheus](https://prometheus.io/) service for collecting metrics, running ad-hoc queries, and managing alerts.
43+
4044
### `site`
4145

4246
The root of the Ruby on Rails site service. It serves the static website at <https://getorganize.app>. It follows [Rails conventions](https://github.com/jwipeout/rails-directory-structure-guide) for its subdirectory structure.

compose.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ services:
3232
restart: always
3333
volumes:
3434
- db-data:/var/lib/postgresql:rw
35+
metrics:
36+
build:
37+
context: metrics
38+
image: localhost:5001/organize-metrics
39+
ports:
40+
- "127.0.0.1:9090:9090"
41+
restart: always
42+
volumes:
43+
- metrics-data:/prometheus:rw
3544
site:
3645
build:
3746
context: site
@@ -64,4 +73,5 @@ volumes:
6473
cert-conf:
6574
cert-www:
6675
db-data:
76+
metrics-data:
6777
site-storage:

metrics/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM prom/prometheus:v2.53.2
2+
3+
COPY prometheus.yml /etc/prometheus/prometheus.yml

metrics/prometheus.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
scrape_configs:
2+
- job_name: prometheus
3+
static_configs:
4+
- targets: ['localhost:9090']

0 commit comments

Comments
 (0)