Skip to content

Commit 9ea6127

Browse files
committed
#88 Get Vault metrics
1 parent c7cff4d commit 9ea6127

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

backend/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,8 @@ build/
3737
*.srl
3838
*.jks
3939

40+
# Secrets
41+
*.token.txt
42+
4043
# Java
4144
*.hprof

backend/prometheus/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM prom/prometheus:latest
22

33
COPY ./prometheus.yml /etc/prometheus/prometheus.yml
44

5+
COPY ./vault.token.txt /etc/prometheus/vault.token.txt
6+
57
CMD [ \
68
"--config.file=/etc/prometheus/prometheus.yml", \
79
"--storage.tsdb.retention.size=500MB", \

backend/prometheus/prometheus.yml

+15
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,18 @@ scrape_configs:
7272
- consul-exporter.dating.se.ifmo.ru
7373
type: 'A'
7474
port: 9107
75+
76+
- job_name: vault
77+
metrics_path: /v1/sys/metrics
78+
params:
79+
format: [ 'prometheus' ]
80+
authorization:
81+
credentials_file: /etc/prometheus/vault.token.txt
82+
dns_sd_configs:
83+
- names:
84+
- vault.dating.se.ifmo.ru
85+
type: 'A'
86+
port: 8200
87+
scheme: https
88+
tls_config:
89+
insecure_skip_verify: true

backend/vault/config/vault.hcl

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ listener "tcp" {
1010
tls_min_version = "tls13"
1111
}
1212

13+
telemetry {
14+
prometheus_retention_time = "12h"
15+
}
16+
1317
storage "consul" {
1418
address = "server.dc1.consul:8501"
1519
max_parallel = 32

0 commit comments

Comments
 (0)