Skip to content
Snippets Groups Projects
Commit d32ad1c4 authored by evilimkova's avatar evilimkova
Browse files

Adding prometheus and grafan to docker-compose

parent 9f5f61ac
No related branches found
No related tags found
1 merge request!33M3 observability
Pipeline #
version: '3' version: '3'
volumes:
prometheus_data:
grafana-data:
services: services:
certificate: certificate:
...@@ -27,4 +30,29 @@ services: ...@@ -27,4 +30,29 @@ services:
container_name: mail container_name: mail
image: xpokorn8/sprachschulsystem:mail image: xpokorn8/sprachschulsystem:mail
ports: ports:
- "5003:5003" - "5003:5003"
\ No newline at end of file
prometheus:
image: prom/prometheus:v2.43.0
container_name: prometheus
volumes:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
expose:
- 9090
ports:
- "9090:9090"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
grafana:
image: grafana/grafana:7.5.7
ports:
- "3000:3000"
restart: unless-stopped
volumes:
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- grafana-data:/var/lib/grafana
datasources:
- name: Prometheus
access: proxy
type: prometheus
url: http://host.docker.internal:9090
isDefault: true
\ No newline at end of file
server.port=5001 server.port=5001
management.endpoints.web.exposure.include=health, metrics management.endpoints.web.exposure.include=health,metrics,prometheus
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.health.defaults.enabled=true management.health.defaults.enabled=true
management.endpoint.health.probes.enabled=true management.endpoint.health.probes.enabled=true
......
server.port=5002 server.port=5002
management.endpoints.web.exposure.include=health, metrics management.endpoints.web.exposure.include=health,metrics,prometheus
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.health.defaults.enabled=true management.health.defaults.enabled=true
management.endpoint.health.probes.enabled=true management.endpoint.health.probes.enabled=true
......
server.port=5000 server.port=5000
management.endpoints.web.exposure.include=health, metrics management.endpoints.web.exposure.include=health,metrics,prometheus
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.health.defaults.enabled=true management.health.defaults.enabled=true
management.endpoint.health.probes.enabled=true management.endpoint.health.probes.enabled=true
......
server.port=5003 server.port=5003
management.endpoints.web.exposure.include=health, metrics management.endpoints.web.exposure.include=health,metrics,prometheus
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.health.defaults.enabled=true management.health.defaults.enabled=true
management.endpoint.health.probes.enabled=true management.endpoint.health.probes.enabled=true
......
...@@ -99,6 +99,11 @@ ...@@ -99,6 +99,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
global:
scrape_interval: 1s
external_labels:
monitor: 'my-monitor'
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'module-certificate'
metrics_path: /actuator/prometheus
static_configs:
- targets: ['host.docker.internal:5001']
- job_name: 'module-exercise'
metrics_path: /actuator/prometheus
static_configs:
- targets: ['host.docker.internal:5002']
- job_name: 'module-language-school'
metrics_path: /actuator/prometheus
static_configs:
- targets: ['host.docker.internal:5000']
- job_name: 'module-mail'
metrics_path: /actuator/prometheus
static_configs:
- targets: ['host.docker.internal:5003']
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment