Added boilerplate for Prometheus

This commit is contained in:
strNophix 2022-08-27 16:04:27 +02:00
parent 092cbcfdd1
commit 6db423d170
5 changed files with 63 additions and 6 deletions

View File

@ -0,0 +1,6 @@
groups:
- name: DemoAlerts
rules:
- alert: InstanceDown
expr: up{job="services"} < 1
for: 5m

View File

@ -0,0 +1,17 @@
global:
scrape_interval: 30s
scrape_timeout: 10s
rule_files:
- alert.yml
scrape_configs:
- job_name: services
metrics_path: /metrics
static_configs:
- targets:
- 'prometheus:9090'
- job_name: 'file_ds'
file_sd_configs:
- files:
- targets.json

View File

@ -0,0 +1,10 @@
[
{
"targets": [
"api:9091"
],
"labels": {
"job": "5f11-api"
}
}
]

View File

@ -4,8 +4,28 @@ services:
scylla:
image: scylladb/scylla
ports:
- "7000:7000"
- "7001:7001"
- "9042:9042"
- "9160:9160"
- "10000:10000"
- 7000:7000
- 7001:7001
- 9042:9042
- 9160:9160
- 10000:10000
volumes:
- .docker/scylla/scylla.yaml:/etc/scylla/scylla.yaml
prometheus:
image: prom/prometheus:v2.30.3
ports:
- 9090:9090
volumes:
- .docker/prometheus:/etc/prometheus
- prometheus-data:/prometheus
command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml
# api:
# build:
# context: .
# ports:
# - 5111:5111
# depends_on:
# - scylla
volumes:
prometheus-data:

View File

@ -4,4 +4,8 @@ Host: 0.0.0.0
Port: 5111
ScyllaDB:
Hosts:
- "localhost"
- localhost
# Prometheus:
# Host: 0.0.0.0
# Port: 9091
# Path: /metrics