Merge remote-tracking branch 'origin/Tache3' into Tache3
# Conflicts: # ansible/playbook.yml
This commit is contained in:
@@ -1,4 +1,40 @@
|
||||
services:
|
||||
#https://dev.to/rafi021/how-to-set-up-a-monitoring-stack-with-prometheus-grafana-and-node-exporter-using-docker-compose-17cc
|
||||
#https://belginux.com/monitoring-docker-grafana-prometheus-cadvisor/
|
||||
#https://github.com/Einsteinish/Docker-Compose-Prometheus-and-Grafana/tree/master
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- ../prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
command:
|
||||
- "--config.file=/etc/prometheus/prometheus.yml"
|
||||
depends_on:
|
||||
- back
|
||||
- db
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
grafana:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: dockerfiles/grafana/Dockerfile
|
||||
container_name: grafana
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- grafana-data:/var/lib/grafana
|
||||
- ../grafana/provisioning:/etc/grafana/provisioning
|
||||
depends_on:
|
||||
- prometheus
|
||||
environment:
|
||||
- GF_SECURITY_ADMIN_USER=tlc
|
||||
- GF_SECURITY_ADMIN_PASSWORD=tlc
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
front:
|
||||
build:
|
||||
context: ..
|
||||
|
||||
@@ -53,11 +53,19 @@
|
||||
port: "{{ http_port }}"
|
||||
proto: tcp
|
||||
|
||||
- name: Create docker project directory
|
||||
file:
|
||||
path: "{{ docker_dir_path }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
# Munin Configuration
|
||||
#https://stackoverflow.com/questions/77941169/ansible-add-line-update-etc-hosts-when-outdated
|
||||
- name: Install Munin Node
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/munin/munin-node.conf
|
||||
regexp: '^allow'
|
||||
line: "allow ^127\\.0\\.0\\.1$"
|
||||
|
||||
- name: Restart munin-node
|
||||
systemd:
|
||||
name: munin-node
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
||||
- name: Create docker compose directory
|
||||
file:
|
||||
|
||||
2
dockerfiles/grafana/Dockerfile
Normal file
2
dockerfiles/grafana/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
||||
FROM grafana/grafana:latest
|
||||
RUN grafana-cli plugins install grafana-munin-datasource
|
||||
11
grafana/provisioning/datasources/datasource.yml
Normal file
11
grafana/provisioning/datasources/datasource.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
orgId: 1
|
||||
url: http://prometheus:9090
|
||||
basicAuth: false
|
||||
isDefault: true
|
||||
editable: true
|
||||
8
prometheus/prometheus.yml
Normal file
8
prometheus/prometheus.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: "backend_quarkus"
|
||||
metrics_path: /q/metrics
|
||||
static_configs:
|
||||
- targets: ["back:8080"]
|
||||
Reference in New Issue
Block a user