diff --git a/dockercompose/docker-compose.yml b/dockercompose/docker-compose.yml index 981c221..466b8ff 100644 --- a/dockercompose/docker-compose.yml +++ b/dockercompose/docker-compose.yml @@ -1,4 +1,35 @@ 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" + networks: + - app-network + + grafana: + image: grafana/grafana:latest + 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: .. diff --git a/grafana/provisioning/datasources/datasource.yml b/grafana/provisioning/datasources/datasource.yml new file mode 100644 index 0000000..bb37f13 --- /dev/null +++ b/grafana/provisioning/datasources/datasource.yml @@ -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 \ No newline at end of file diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml new file mode 100644 index 0000000..6486a38 --- /dev/null +++ b/prometheus/prometheus.yml @@ -0,0 +1,8 @@ +global: + scrape_interval: 15s + +scrape_configs: + - job_name: "backend_quarkus" + metrics_path: /q/metrics + static_configs: + - targets: ["back:8080"]