Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9542a62

Browse files
committed
🔨 Update Loki
1 parent71a2b72 commit9542a62

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

‎pom.xml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
<artifactId>spring-boot-starter-test</artifactId>
3232
<scope>test</scope>
3333
</dependency>
34+
<dependency>
35+
<groupId>io.micrometer</groupId>
36+
<artifactId>micrometer-registry-prometheus</artifactId>
37+
<version>${micrometer.version}</version>
38+
</dependency>
3439
</dependencies>
3540

3641
<build>

‎src/main/java/com/devxptech/templatejava/controller/HelloWorldController.java‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
packagecom.devxptech.templatejavaspringboot.controller;
22

3-
43
importorg.springframework.http.HttpStatus;
54
importorg.springframework.http.MediaType;
65
importorg.springframework.http.ResponseEntity;
@@ -16,16 +15,16 @@ public class HelloWorldController {
1615
@GetMapping(path ="/",produces =MediaType.APPLICATION_JSON_VALUE)
1716
publicResponseEntity<?>helloWorld() {
1817

19-
returnnewResponseEntity<>("Funcionou",HttpStatus.OK);
18+
returnnewResponseEntity<>("Hello world for your app template-java",HttpStatus.OK);
2019
}
20+
2121
@GetMapping(path ="/{param}")
2222
publicResponseEntity<?>helloWorldParam(@PathVariableIntegerparam) {
2323

24-
if(param ==1 )
25-
{
26-
returnnewResponseEntity<>("Funcionou",HttpStatus.OK );
27-
}else{
28-
returnnewResponseEntity<>("Diferente de 1 ",HttpStatus.BAD_REQUEST );
24+
if (param ==1) {
25+
returnnewResponseEntity<>("Funcionou",HttpStatus.OK);
26+
}else {
27+
returnnewResponseEntity<>("Diferente de 1 ",HttpStatus.BAD_REQUEST);
2928
}
3029

3130
}

‎src/main/resources/application.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ management:
1515
endpoint:
1616
health:
1717
show-details:always
18+
prometheus:
19+
enabled:true
1820

1921
metrics:
2022
export:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp