Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ build/
*.srl
*.jks

# Secrets
*.token.txt

# Java
*.hprof
6 changes: 6 additions & 0 deletions backend/haproxy/config/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ defaults

default-server check inter 10s fall 2 rise 1

frontend prometheus
bind :8405
mode http
http-request use-service prometheus-exporter if { path /metrics }
no log

frontend internal
bind :8445 ssl crt /usr/local/etc/haproxy/itmo-dating-backend.pem
bind :8446 ssl crt /usr/local/etc/haproxy/itmo-dating-backend.pem
Expand Down
2 changes: 2 additions & 0 deletions backend/prometheus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM prom/prometheus:latest

COPY ./prometheus.yml /etc/prometheus/prometheus.yml

COPY ./vault.token.txt /etc/prometheus/vault.token.txt

CMD [ \
"--config.file=/etc/prometheus/prometheus.yml", \
"--storage.tsdb.retention.size=500MB", \
Expand Down
43 changes: 43 additions & 0 deletions backend/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,46 @@ scrape_configs:
- database-primary-exporter.dating.se.ifmo.ru
type: 'A'
port: 9187

- job_name: consul
dns_sd_configs:
- names:
- consul-exporter.dating.se.ifmo.ru
type: 'A'
port: 9107

- job_name: vault
metrics_path: /v1/sys/metrics
params:
format: [ 'prometheus' ]
authorization:
credentials_file: /etc/prometheus/vault.token.txt
dns_sd_configs:
- names:
- vault.dating.se.ifmo.ru
type: 'A'
port: 8200
scheme: https
tls_config:
insecure_skip_verify: true

- job_name: haproxy
dns_sd_configs:
- names:
- haproxy.dating.se.ifmo.ru
type: 'A'
port: 8405

- job_name: prometheus
dns_sd_configs:
- names:
- prometheus.dating.se.ifmo.ru
type: 'A'
port: 9090

- job_name: grafana
dns_sd_configs:
- names:
- grafana.dating.se.ifmo.ru
type: 'A'
port: 3000
4 changes: 4 additions & 0 deletions backend/vault/config/vault.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ listener "tcp" {
tls_min_version = "tls13"
}

telemetry {
prometheus_retention_time = "12h"
}

storage "consul" {
address = "server.dc1.consul:8501"
max_parallel = 32
Expand Down
8 changes: 8 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ services:
- consul-data:/opt/consul/data
tty: true
hostname: server.dc1.consul
consul-exporter:
image: prom/consul-exporter
command: --consul.server=server.dc1.consul:8500
tty: true
hostname: consul-exporter.dating.se.ifmo.ru
depends_on:
consul:
condition: service_started
vault:
image: ghcr.io/secs-dev/itmo-dating-vault:latest
build:
Expand Down
Loading