Skip to content

Commit 867e8a9

Browse files
committed
Add prometheus features on backend-springboot
1 parent fa140cb commit 867e8a9

File tree

7 files changed

+46
-7
lines changed

7 files changed

+46
-7
lines changed

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"java.compile.nullAnalysis.mode": "disabled",
3+
"java.configuration.updateBuildConfiguration": "disabled"
4+
}

backend-javascript/docker/prometheus.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ scrape_configs:
1313
static_configs:
1414
- targets:
1515
- host.docker.internal:3002
16+
17+
- job_name: 'backend-springboot'
18+
metrics_path: '/prometheus'
19+
static_configs:
20+
- targets:
21+
- host.docker.internal:3003

backend-springboot/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ Application Spring Boot packagée en WAR, compatible Tomcat / Jetty, avec linter
44

55
---
66

7+
## 📊 Updates (Dependency Updates)
8+
9+
Check outdated dependencies and plugins:
10+
11+
```bash
12+
mvn versions:display-dependency-updates
13+
mvn versions:display-plugin-updates
14+
```
15+
16+
---
17+
718
## 🔧 Lint (analyse statique)
819

920
Analyse du style de code Java avec Checkstyle :

backend-springboot/pom.xml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@
5656
<artifactId>spring-boot-starter-test</artifactId>
5757
<scope>test</scope>
5858
</dependency>
59+
60+
61+
<dependency>
62+
<groupId>org.springframework.boot</groupId>
63+
<artifactId>spring-boot-starter-actuator</artifactId>
64+
</dependency>
65+
<dependency>
66+
<groupId>io.micrometer</groupId>
67+
<artifactId>micrometer-registry-prometheus</artifactId>
68+
</dependency>
69+
70+
5971
</dependencies>
6072

6173
<build>
@@ -64,21 +76,21 @@
6476
<groupId>org.springframework.boot</groupId>
6577
<artifactId>spring-boot-maven-plugin</artifactId>
6678
</plugin>
67-
68-
69-
<!-- Plugin JaCoCo -->
79+
80+
81+
<!-- Plugin JaCoCo -->
7082
<plugin>
7183
<groupId>org.jacoco</groupId>
7284
<artifactId>jacoco-maven-plugin</artifactId>
7385
<version>0.8.11</version>
7486
<executions>
75-
<!-- Agent JaCoCo avant les tests -->
87+
<!-- Agent JaCoCo avant les tests -->
7688
<execution>
7789
<goals>
7890
<goal>prepare-agent</goal>
7991
</goals>
8092
</execution>
81-
<!-- Génération du rapport après les tests -->
93+
<!-- Génération du rapport après les tests -->
8294
<execution>
8395
<id>report</id>
8496
<phase>test</phase>

backend-springboot/src/main/resources/application.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ db.client=mock
77

88
# === Application ===
99
spring.application.name=backend-springboot
10-
server.port=3003
10+
server.port=3003
11+
12+
# === prometheus ===
13+
management.endpoints.web.exposure.include=prometheus
14+
management.endpoint.prometheus.enabled=true
15+
management.endpoints.web.base-path=/

backend-springboot/src/main/resources/application.properties.mock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ db.client=mock
77

88
# === Application ===
99
spring.application.name=backend-springboot
10-
server.port=8080
10+
server.port=3003

backend-typescript/.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ REDIS_URL=redis://localhost:6379
5353
PROMETHEUS_ENABLED=true
5454
# PROMETHEUS_MODE=http_requests_total
5555
PROMETHEUS_MODE=all
56+

0 commit comments

Comments
 (0)