forked from eth-educators/eth-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eth-educators#1033 from yorickdowne/main
Add grafana-cloud.yml
- Loading branch information
Showing
3 changed files
with
162 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# Custom Prometheus rules. Use prometheus/custom-prom.yml which will be appended to | ||
# /etc/prometheus/prometheus.yml inside the prometheus container. It will be appended after | ||
# the last scrape target that the entrypoint script adds. | ||
# | ||
# You could add additonal scrape targets as well as additional global sections such as remote-write. | ||
# This file is called grafana-cloud.yml as adding a remote write to Grafana Cloud is likely a | ||
# common use case. It properly is a Prometheus without Grafana and the ability to add custom | ||
# content to prometheus.yml | ||
|
||
version: "3.9" | ||
x-logging: &logging | ||
logging: | ||
driver: json-file | ||
options: | ||
max-size: 100m | ||
max-file: "3" | ||
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}' | ||
|
||
services: | ||
prometheus: | ||
restart: "unless-stopped" | ||
build: | ||
context: ./prometheus | ||
image: prometheus:local | ||
volumes: | ||
- prom-data:/prometheus | ||
- ./prometheus/alert_rules.yml:/etc/prometheus/alert_rules.yml | ||
- ./prometheus/custom-prom.yml:/etc/prometheus/custom-prom.yml:ro | ||
- /etc/localtime:/etc/localtime:ro | ||
environment: | ||
- CLIENT=${COMPOSE_FILE} | ||
entrypoint: choose-config.sh | ||
command: ["/bin/prometheus", "--storage.tsdb.path=/prometheus", "--web.console.libraries=/usr/share/prometheus/console_libraries", "--web.console.templates=/usr/share/prometheus/consoles"] | ||
<<: *logging | ||
depends_on: | ||
- node-exporter | ||
- blackbox-exporter | ||
- json-exporter | ||
- cryptowat-exporter | ||
- cadvisor | ||
- ethereum-metrics-exporter | ||
|
||
ethereum-metrics-exporter: | ||
restart: "unless-stopped" | ||
build: | ||
context: ./eth-metrics | ||
image: ethereum-metrics-exporter:local | ||
environment: | ||
- CLIENT=${COMPOSE_FILE} | ||
entrypoint: | ||
- docker-entrypoint.sh | ||
- /ethereum-metrics-exporter | ||
<<: *logging | ||
|
||
node-exporter: | ||
image: quay.io/prometheus/node-exporter:latest | ||
command: | ||
- '--path.rootfs=/host' | ||
- '--path.procfs=/host/proc' | ||
- '--path.sysfs=/host/sys' | ||
# - '--collector.textfile.directory=/etc/node-exporter/' | ||
- '--collector.filesystem.ignored-mount-points=${NODE_EXPORTER_IGNORE_MOUNT_REGEX}' | ||
- '--no-collector.ipvs' | ||
pid: host | ||
restart: unless-stopped | ||
volumes: | ||
- '/:/host:ro,rslave' | ||
- /etc/hostname:/etc/nodename:ro | ||
- /proc:/host/proc:ro | ||
- /sys:/host/sys:ro | ||
- /etc/localtime:/etc/localtime:ro | ||
<<: *logging | ||
|
||
blackbox-exporter: | ||
restart: "unless-stopped" | ||
image: prom/blackbox-exporter:master | ||
volumes: | ||
- ./prometheus/blackbox.yml:/config/blackbox.yml | ||
- /etc/localtime:/etc/localtime:ro | ||
<<: *logging | ||
command: | ||
- --config.file=/config/blackbox.yml | ||
|
||
json-exporter: | ||
restart: "unless-stopped" | ||
image: quay.io/prometheuscommunity/json-exporter | ||
volumes: | ||
- ./prometheus/json.yml:/config/json.yml | ||
- /etc/localtime:/etc/localtime:ro | ||
<<: *logging | ||
command: | ||
- --config.file | ||
- /config/json.yml | ||
|
||
cryptowat-exporter: | ||
restart: "unless-stopped" | ||
image: nbarrientos/cryptowat_exporter | ||
volumes: | ||
- /etc/localtime:/etc/localtime:ro | ||
environment: | ||
- CRYPTOWAT_EXCHANGES=kraken | ||
- CRYPTOWAT_PAIRS=ethusd,ethchf | ||
- CRYPTOWAT_CACHESECONDS=300 | ||
- TZ=Europe/Zurich | ||
<<: *logging | ||
|
||
cadvisor: | ||
image: gcr.io/cadvisor/cadvisor | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock:ro | ||
- /:/rootfs:ro | ||
- /var/run:/var/run | ||
- /sys:/sys:ro | ||
- /var/lib/docker:/var/lib/docker:ro | ||
command: | ||
- --docker_only | ||
- --housekeeping_interval=30s | ||
<<: *logging | ||
|
||
promtail: | ||
image: grafana/promtail:latest | ||
user: root | ||
volumes: | ||
- /etc/machine-id:/etc/machine-id:ro | ||
- ./promtail:/etc/promtail | ||
- promtail-data:/tmp | ||
- /var/lib/docker/containers:/var/lib/docker/containers:ro | ||
command: | ||
- '--config.file=/etc/promtail/promtail.yml' | ||
restart: "unless-stopped" | ||
depends_on: | ||
- loki | ||
<<: *logging | ||
|
||
loki: | ||
restart: "unless-stopped" | ||
image: grafana/loki:latest | ||
volumes: | ||
- loki-data:/tmp | ||
- ./loki:/etc/loki | ||
command: | ||
- '--config.file=/etc/loki/loki.yml' | ||
<<: *logging | ||
|
||
volumes: | ||
prom-data: | ||
loki-data: | ||
promtail-data: |
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