Skip to content
Snippets Groups Projects
Commit 82508a54 authored by Tomáš Marek's avatar Tomáš Marek
Browse files

does not work

parent 0608c97d
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -61,7 +61,7 @@ WARNING: when putting components or drivers, services component and driver need ...@@ -61,7 +61,7 @@ WARNING: when putting components or drivers, services component and driver need
##### Run component using Docker: ##### Run component using Docker:
Create the image: Create the image:
`> docker build --no-cache -t pa165-formula-one-team-car` `> docker build --no-cache -t pa165-formula-one-team-car .`
Run the image: Run the image:
...@@ -77,7 +77,7 @@ Runs on port 8084. ...@@ -77,7 +77,7 @@ Runs on port 8084.
#### Run component using Docker: #### Run component using Docker:
Create the image: Create the image:
`> docker build --no-cache -t pa165-formula-one-team-component` `> docker build --no-cache -t pa165-formula-one-team-component .`
Run the image: Run the image:
...@@ -94,7 +94,7 @@ Runs on port 8083. ...@@ -94,7 +94,7 @@ Runs on port 8083.
#### Run component using Docker: #### Run component using Docker:
Create the image: Create the image:
`> docker build --no-cache -t pa165-formula-one-team-driver` `> docker build --no-cache -t pa165-formula-one-team-driver .`
Run the image: Run the image:
...@@ -119,7 +119,7 @@ Runs on port 8081. ...@@ -119,7 +119,7 @@ Runs on port 8081.
#### Run component using Docker: #### Run component using Docker:
Create the image: Create the image:
`> docker build --no-cache -t pa165-formula-one-team-race` `> docker build --no-cache -t pa165-formula-one-team-race .`
Run the image: Run the image:
......
...@@ -59,6 +59,20 @@ ...@@ -59,6 +59,20 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies> </dependencies>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
......
...@@ -24,9 +24,16 @@ spring: ...@@ -24,9 +24,16 @@ spring:
management: management:
endpoints: endpoints:
web: web:
base-path: /actuator
exposure: exposure:
include: "health,metrics" include: [ "health", "metrics", "prometheus" ]
endpoint: endpoint:
health:
show-details: always
probes:
enabled: true
metrics:
enabled: true
prometheus: prometheus:
enabled: true enabled: true
metrics: metrics:
......
...@@ -54,6 +54,15 @@ ...@@ -54,6 +54,15 @@
<version>4.12</version> <version>4.12</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -24,9 +24,16 @@ spring: ...@@ -24,9 +24,16 @@ spring:
management: management:
endpoints: endpoints:
web: web:
base-path: /actuator
exposure: exposure:
include: "health,metrics" include: [ "health", "metrics", "prometheus" ]
endpoint: endpoint:
health:
show-details: always
probes:
enabled: true
metrics:
enabled: true
prometheus: prometheus:
enabled: true enabled: true
metrics: metrics:
......
--- ---
version: '3' version: '3'
services: services:
race: race:
image: pa165-formula-one-team-race image: pa165-formula-one-team-race
ports: ports:
- "8081:8081" - "8081:8081"
car: car:
image: pa165-formula-one-team-car image: pa165-formula-one-team-car
ports: ports:
- "8082:8082" - "8082:8082"
driver: driver:
image: pa165-formula-one-team-driver image: pa165-formula-one-team-driver
ports: ports:
- "8083:8083" - "8083:8083"
component: component:
image: pa165-formula-one-team-component image: pa165-formula-one-team-component
ports: ports:
- "8084:8084" - "8084:8084"
\ No newline at end of file
prometheus:
ports:
- "9090:9090"
volumes:
- C:\Users\tomas\Documents\PA165\pa165-formula-one-team\prometheus.yml:/etc/prometheus/prometheus.yml
image: prom/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
#
# grafana:
# image: grafana/grafana-oss
# user: "$UID:$GID"
# network_mode: host
# container_name: grafana-container
# depends_on:
# - prometheus
# ports:
# - "3000:3000"
# volumes:
# - ./grafana/:/var/lib/grafana
# environment:
# - GF_SECURITY_ADMIN_PASSWORD=admin
# - GF_SERVER_DOMAIN=localhost
\ No newline at end of file
...@@ -57,6 +57,15 @@ ...@@ -57,6 +57,15 @@
<version>4.12</version> <version>4.12</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -24,9 +24,16 @@ spring: ...@@ -24,9 +24,16 @@ spring:
management: management:
endpoints: endpoints:
web: web:
base-path: /actuator
exposure: exposure:
include: "health,metrics" include: [ "health", "metrics", "prometheus" ]
endpoint: endpoint:
health:
show-details: always
probes:
enabled: true
metrics:
enabled: true
prometheus: prometheus:
enabled: true enabled: true
metrics: metrics:
......
global:
scrape_interval: 2s
scrape_configs:
- job_name: 'race-service-prometheus'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['host.docker.internal:8081']
- job_name: 'race-service-metrics'
metrics_path: '/actuator/metrics'
static_configs:
- targets: [ 'host.docker.internal:8081' ]
- job_name: 'race-service-health'
metrics_path: '/actuator/health'
static_configs:
- targets: [ 'host.docker.internal:8081' ]
- job_name: 'car-service-prometheus'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['host.docker.internal:8082']
- job_name: 'car-service-metrics'
metrics_path: '/actuator/metrics'
static_configs:
- targets: [ 'host.docker.internal:8082' ]
- job_name: 'car-service-health'
metrics_path: '/actuator/health'
static_configs:
- targets: [ 'host.docker.internal:8082' ]
- job_name: 'driver-service-prometheus'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['host.docker.internal:8083']
- job_name: 'driver-service-metrics'
metrics_path: '/actuator/metrics'
static_configs:
- targets: [ 'host.docker.internal:8083' ]
- job_name: 'driver-service-health'
metrics_path: '/actuator/health'
static_configs:
- targets: [ 'host.docker.internal:8083' ]
- job_name: 'component-service-prometheus'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['host.docker.internal:8084']
- job_name: 'component-service-metrics'
metrics_path: '/actuator/metrics'
static_configs:
- targets: [ 'host.docker.internal:8084' ]
- job_name: 'component-service-health'
metrics_path: '/actuator/health'
static_configs:
- targets: [ 'host.docker.internal:8084' ]
\ No newline at end of file
...@@ -53,6 +53,11 @@ ...@@ -53,6 +53,11 @@
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -29,9 +29,16 @@ spring: ...@@ -29,9 +29,16 @@ spring:
management: management:
endpoints: endpoints:
web: web:
base-path: /actuator
exposure: exposure:
include: "health,metrics" include: [ "health", "metrics", "prometheus" ]
endpoint: endpoint:
health:
show-details: always
probes:
enabled: true
metrics:
enabled: true
prometheus: prometheus:
enabled: true enabled: true
metrics: metrics:
......
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