Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start working on Grafana implementation #5

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4fc4535
Start working on Grafana implementation
jaw12346 Mar 15, 2022
3b818ba
Fixed prometheus-monitoring container issues
jaw12346 Mar 18, 2022
0d54d44
Attempt to fix restarting issue
jaw12346 Mar 22, 2022
fb843b0
Attempt to fix restarting issue
jaw12346 Mar 22, 2022
be1e160
Update config to latest
jaw12346 Mar 25, 2022
22dfc27
Attempt to fix monitoring_prometheus
jaw12346 Mar 25, 2022
036c3fb
Attempt to fix prometheus_monitoring
jaw12346 Mar 25, 2022
e345e61
Attempt to fix prometheus_monitoring #2
jaw12346 Mar 25, 2022
e52dd21
Attempt to fix bunkerized nginx
jaw12346 Mar 25, 2022
75cbd43
Attempt to remove ssl_certificate requirement
jaw12346 Mar 25, 2022
7b1d1e4
Attempt to fix pgadmin (certfile doesn't exist)
jaw12346 Mar 25, 2022
2c0db41
Attempt to fix ssl_certificate issue in bunkerized nginx
jaw12346 Mar 25, 2022
eb596ef
Remove automatic letsencrypt, introduce self-signed ssl cert
jaw12346 Mar 25, 2022
21c8d69
Resolve duplicate port usage issue
jaw12346 Mar 25, 2022
aa572c3
Retry port fix
jaw12346 Mar 25, 2022
ea43b6d
Try to fix "Exception: can't download data at https://api.bunkerity.c…
jaw12346 Mar 29, 2022
35e12d0
Attempt to fix issue as previous commit
jaw12346 Mar 29, 2022
ad80f63
Merge conflict fix
jaw12346 Mar 29, 2022
c7bf064
Merge conflict fix part 2
jaw12346 Mar 29, 2022
ac8baf9
Recreate yml file
jaw12346 Mar 29, 2022
15f66ce
Try to fix port access
jaw12346 Mar 29, 2022
189b216
Expose grafana port
jaw12346 Mar 29, 2022
bc2aa11
Add ports (didn't realize I needed this)
jaw12346 Mar 29, 2022
1cd5f2f
Duplicate port fix
jaw12346 Mar 29, 2022
284e4d4
Remove duplicate grafana, expose port 4000
jaw12346 Apr 1, 2022
83d46e3
Removed deprecated code, changed grafana password to be an environmen…
jaw12346 Apr 1, 2022
5b20519
Add prometheus jobs
jaw12346 Apr 5, 2022
263281c
Change prometheus targets to localhost
jaw12346 Apr 5, 2022
597bad6
Revert "Change prometheus targets to localhost"
jaw12346 Apr 5, 2022
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
4 changes: 4 additions & 0 deletions ops-compose-stack/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.env
*.crt
*.key
/data/prometheus/data/
/data/grafana/
46 changes: 46 additions & 0 deletions ops-compose-stack/data/prometheus/config/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
global:
scrape_interval: 120s # By default, scrape targets every 15 seconds.
evaluation_interval: 120s # By default, scrape targets every 15 seconds.
# scrape_timeout is set to the global default (10s).

# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'YACS'

# Load and evaluate rules in this file every 'evaluation_interval' seconds.
rule_files:
# - "alert.rules"
# - "first.rules"
# - "second.rules"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'

# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s

# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.

static_configs:
- targets: ['monitoring_prometheus:9090']

- job_name: 'yacs_web'
scrape_interval: 5s
static_configs:
- targets: ['yacs_web:8080', 'yacs_web:8443']

- job_name: 'yacs_db'
scrape_interval: 5s
static_configs:
- targets: ['yacs_db:5432']

alerting:
alertmanagers:
- static_configs:
- targets:
- alertmanager:9093
135 changes: 58 additions & 77 deletions ops-compose-stack/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,19 @@ volumes:
ackee-storage:

services:

pgadmin:
restart: unless-stopped
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=${YX_ADMIN_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${YX_PG_PASS}
- PGADMIN_DEFAULT_EMAIL=[email protected]
- PGADMIN_DEFAULT_PASSWORD=${GRAFANA_PASSWORD}
- PGADMIN_ENABLE_TLS=True
volumes:
- ../ssl/cert.pem:/certs/server.cert
- ../ssl/privkey.pem:/certs/server.key
ports:
- "${YX_PG_PORT:-7001}:443"

grafana:
restart: unless-stopped
image: grafana/grafana
volumes:
- grafana-storage:/var/lib/grafana
- ${YX_SSL_CERT_LOCATION}:/certs/server.cert
- ${YX_SSL_KEY_LOCATION}:/certs/server.key
environment:
- GF_SERVER_PROTOCOL=https
- GF_SERVER_ENABLE_GZIP=${YX_GF_GZIP:-true}
- GF_SERVER_CERT_FILE=/certs/server.cert
- GF_SERVER_CERT_KEY=/certs/server.key
ports:
- "${YX_GF_PORT:-7002}:3000"

bunker_dozzle:
image: bunkerity/bunkerized-nginx
restart: always
volumes:
- ${YX_SSL_CERT_LOCATION}:/certs/server.cert
- ${YX_SSL_KEY_LOCATION}:/certs/server.key
environment:
- USE_REVERSE_PROXY=yes
- REVERSE_PROXY_URL=/
- REVERSE_PROXY_HOST=http://dozzle:8080
- USE_CUSTOM_HTTPS=yes
- CUSTOM_HTTPS_CERT=/certs/server.cert
- CUSTOM_HTTPS_KEY=/certs/server.key
- USE_AUTH_BASIC=yes
- USE_DNSBL=no
- USE_FAILBAN=no
- LIMIT_REQ=no
- USE_CLAMAV_SCAN=no
- USE_CLAMAV_UPLOAD=no
- USE_MODSECURITY=no
- USE_MODSECURITY_CRS=no
- BLOCK_USER_AGENT=no
- AUTH_BASIC_USER=${YX_BNK_DL_USER:-bnk_user}
- AUTH_BASIC_PASSWORD=${YX_BNK_DL_PASS:-bnk_pass}
ports:
- "${YX_BNK_DL_PORT:-7003}:8443"

dozzle:
container_name: dozzle
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock


ackee:
image: electerious/ackee
container_name: ackee
Expand All @@ -81,34 +32,64 @@ services:
- ACKEE_PASSWORD=${YX_ACKEE_PASS:-ackee_pass}
depends_on:
- ackee_mongo

bunker_ackee:
image: bunkerity/bunkerized-nginx
restart: always
volumes:
- ${YX_SSL_CERT_LOCATION}:/certs/server.cert
- ${YX_SSL_KEY_LOCATION}:/certs/server.key
environment:
- USE_REVERSE_PROXY=yes
- REVERSE_PROXY_URL=/
- REVERSE_PROXY_HOST=http://ackee:3000
- USE_CUSTOM_HTTPS=yes
- CUSTOM_HTTPS_CERT=/certs/server.cert
- CUSTOM_HTTPS_KEY=/certs/server.key
- USE_DNSBL=no
- USE_FAILBAN=no
- LIMIT_REQ=no
- USE_CLAMAV_SCAN=no
- USE_CLAMAV_UPLOAD=no
- USE_MODSECURITY=no
- USE_MODSECURITY_CRS=no
- BLOCK_USER_AGENT=no
ports:
- "${YX_BNK_ACKEE_PORT:-7004}:8443"


ackee_mongo:
image: mongo
container_name: ackee_mongo
restart: always
volumes:
- ackee-storage:/data/db

prometheus:
image: prom/prometheus:latest
user: root
container_name: monitoring_prometheus
restart: unless-stopped
volumes:
- ./data/prometheus/config/:/etc/prometheus/
- ./data/prometheus/data/:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
expose:
- 9090
ports:
- 9090:9090
links:
- cadvisor:cadvisor
- node-exporter:node-exporter

node-exporter:
image: prom/node-exporter:latest
container_name: monitoring_node_exporter
restart: unless-stopped
expose:
- 9100

cadvisor:
image: google/cadvisor:latest
container_name: monitoring_cadvisor
restart: unless-stopped
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- 9999:8080

grafana:
image: grafana/grafana:latest
container_name: monitoring_grafana
restart: unless-stopped
links:
- prometheus:prometheus
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_DOMAIN=yacs.cs.rpi.edu
- GF_SMTP_ENABLED=false
expose:
- 4000
ports:
- 4000:4000