Skip to content

Commit 0a9fda8

Browse files
authored
Add integration with Zipkin (#75)
* Add integration with Zipkin * Add Actuator and Zipkin deps
1 parent 19e927a commit 0a9fda8

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
zipkin:
3+
image: 'openzipkin/zipkin:latest'
4+
ports:
5+
- "9411:9411"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Observability configuration for Spring AI with tracing and logging
2+
# This is a concern of the application, not the library and will be removed in future versions
3+
spring:
4+
ai:
5+
chat:
6+
client:
7+
observations:
8+
log-prompt: false # Enable ChatClient prompt logging
9+
observations:
10+
log-prompt: false # Enable ChatModel prompt logging
11+
log-completion: false # Enable ChatModel response logging
12+
include-error-logging: true # Include error details
13+
# Observability and tracing configuration
14+
management:
15+
tracing:
16+
enabled: true
17+
sampling:
18+
probability: 1.0 # Sample 100% of traces (use 0.1 for production)
19+
20+
# Zipkin configuration
21+
zipkin:
22+
tracing:
23+
endpoint: http://localhost:9411/api/v2/spans
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Observability configuration for Spring AI with tracing and logging
2+
# This is a concern of the application, not the library and will be removed in future versions
3+
spring:
4+
ai:
5+
chat:
6+
client:
7+
observations:
8+
log-prompt: false # Enable ChatClient prompt logging
9+
observations:
10+
log-prompt: false # Enable ChatModel prompt logging
11+
log-completion: false # Enable ChatModel response logging
12+
include-error-logging: true # Include error details
13+
# Observability and tracing configuration
14+
management:
15+
tracing:
16+
enabled: true
17+
sampling:
18+
probability: 1.0 # Sample 100% of traces (use 0.1 for production)
19+
20+
# Zipkin configuration
21+
zipkin:
22+
tracing:
23+
endpoint: http://localhost:9411/api/v2/spans

pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@
1919
<module>examples-common</module>
2020
</modules>
2121

22+
<dependencies>
23+
<!-- ================ Observability ================ -->
24+
<dependency>
25+
<groupId>org.springframework.boot</groupId>
26+
<artifactId>spring-boot-starter-actuator</artifactId>
27+
</dependency>
28+
29+
<dependency>
30+
<groupId>io.micrometer</groupId>
31+
<artifactId>micrometer-tracing-bridge-brave</artifactId>
32+
</dependency>
33+
34+
<dependency>
35+
<groupId>io.zipkin.reporter2</groupId>
36+
<artifactId>zipkin-reporter-brave</artifactId>
37+
</dependency>
38+
<!-- ================ Observability ================ -->
39+
</dependencies>
40+
2241
<repositories>
2342
<repository>
2443
<id>embabel-releases</id>

0 commit comments

Comments
 (0)