Skip to content

Commit 950d2b8

Browse files
committed
using sprinboot actuator, loki logback appender and springboot tempo integration for observability.
1 parent c6b7e67 commit 950d2b8

File tree

3 files changed

+38
-29
lines changed

3 files changed

+38
-29
lines changed

src/Services/Ordering/orderapi/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ RUN mvn -f /src/Services/Ordering/orderapi/pom.xml -s /src/settings.xml package
4141
FROM base AS final
4242
WORKDIR /app
4343
COPY --from=build /src/Services/Ordering/orderapi/target/order-api.jar ./order-api.jar
44-
COPY --from=build /src/Services/Ordering/orderapi/target/opentelemetry-javaagent.jar ./opentelemetry-javaagent.jar
44+
# COPY --from=build /src/Services/Ordering/orderapi/target/opentelemetry-javaagent.jar ./opentelemetry-javaagent.jar
4545

4646

47-
ENTRYPOINT ["java", "-javaagent:./opentelemetry-javaagent.jar", "-Dspring.profiles.active=dev", "-jar", "order-api.jar"]
47+
ENTRYPOINT ["java", "-Dspring.profiles.active=dev", "-jar", "order-api.jar"]

src/Services/Ordering/orderapi/pom.xml

+2-25
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
<java.version>17</java.version>
1919
</properties>
2020
<dependencies>
21-
<dependency>
22-
<groupId>org.springframework.boot</groupId>
23-
<artifactId>spring-boot-starter-actuator</artifactId>
24-
</dependency>
21+
2522
<dependency>
2623
<groupId>org.springframework.boot</groupId>
2724
<artifactId>spring-boot-starter-web</artifactId>
@@ -45,33 +42,18 @@
4542
<version>0.0.1-SNAPSHOT</version>
4643
</dependency>
4744

48-
<dependency>
49-
<groupId>io.opentelemetry.javaagent</groupId>
50-
<artifactId>opentelemetry-javaagent</artifactId>
51-
</dependency>
52-
5345
<dependency>
5446
<groupId>com.eshoponcontainers.eventbus</groupId>
5547
<artifactId>eventbus-rabbitmq</artifactId>
5648
<version>0.0.1-SNAPSHOT</version>
5749
</dependency>
5850

59-
<dependency>
60-
<groupId>com.eshoponcontainers.eventbus</groupId>
61-
<artifactId>eventbus</artifactId>
62-
<version>0.0.1-SNAPSHOT</version>
63-
</dependency>
64-
6551
<dependency>
6652
<groupId>com.eshoponcontainers</groupId>
6753
<artifactId>ordering-infrastructure</artifactId>
6854
<version>1.0-SNAPSHOT</version>
6955
</dependency>
70-
<dependency>
71-
<groupId>org.projectlombok</groupId>
72-
<artifactId>lombok</artifactId>
73-
<optional>true</optional>
74-
</dependency>
56+
7557

7658
<dependency>
7759
<groupId>org.springdoc</groupId>
@@ -89,11 +71,6 @@
8971
<version>2.6.8</version>
9072
</dependency>
9173

92-
<dependency>
93-
<groupId>org.springframework.boot</groupId>
94-
<artifactId>spring-boot-starter-test</artifactId>
95-
<scope>test</scope>
96-
</dependency>
9774
</dependencies>
9875

9976
<build>

src/Services/Ordering/orderapi/src/main/resources/application.yml

+34-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,43 @@
1-
spring.profiles.active: dev
2-
springdoc.swagger-ui.path: /swagger-ui-custom.html
1+
spring:
2+
application:
3+
name: ordering-api
4+
profiles:
5+
active:
6+
- dev
37

48
logging:
59
level:
610
org.springframework.security.oauth2.jwt: DEBUG
711
org.hibernate.type: TRACE
812

13+
#enable management endpoints
14+
management:
15+
metrics:
16+
distribution:
17+
percentiles-histogram:
18+
http:
19+
server:
20+
requests: true
21+
tracing:
22+
sampling:
23+
probability: 1.0
24+
25+
endpoints:
26+
web:
27+
exposure:
28+
include: "*"
29+
endpoint:
30+
health:
31+
show-details: always
32+
33+
prometheus:
34+
metrics:
35+
export:
36+
enabled: true
37+
38+
zipkin:
39+
tracing:
40+
endpoint: http://tempo:9411/api/v2/spans
941

1042
spring.datasource.hikari:
1143
maximum-pool-size: 10

0 commit comments

Comments
 (0)