Skip to content

Commit 948c0d4

Browse files
add zipkin
1 parent 757437b commit 948c0d4

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ dependencies {
100100
implementation 'org.springdoc:springdoc-openapi-starter-common:2.6.0'
101101
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
102102

103+
// zipkin
104+
implementation 'io.micrometer:micrometer-tracing-bridge-otel'
105+
implementation 'io.opentelemetry:opentelemetry-exporter-zipkin'
106+
implementation 'io.zipkin.reporter2:zipkin-sender-urlconnection'
107+
103108
}
104109
liquibase {
105110
activities {

src/main/resources/application.properties

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ server.port=8082
33
spring.application.name=SoftenoJpaPostgresApp
44

55
### custom: external services
6-
76
com.softeno.external.url=http://localhost:4500/sample
87
#com.softeno.external.url=http://localhost:8080/sample
98
#com.softeno.external.url=http://localhost:8080/sample-secured
@@ -14,7 +13,6 @@ com.softeno.kafka.rx=sample_topic_2
1413
com.softeno.kafka.keycloak=keycloak-events
1514

1615
### jpa, hibernate & liquibase
17-
1816
spring.datasource.url=jdbc:postgresql://localhost:5432/application
1917
spring.datasource.username=admin
2018
spring.datasource.password=admin
@@ -44,7 +42,6 @@ logging.level.org.springframework.jdbc.core.JdbcTemplate=DEBUG
4442
logging.level.org.springframework.jdbc.core.StatementCreatorUtils=TRACE
4543

4644
### keycloak realm config: http://localhost:8090/realms/master/.well-known/openid-configuration
47-
4845
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8090/realms/master
4946
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://localhost:8090/realms/master/protocol/openid-connect/certs
5047

@@ -58,27 +55,38 @@ spring.security.oauth2.client.provider.keycloak.user-info-uri=http://localhost:8
5855
spring.security.oauth2.client.provider.keycloak.jwk-set-uri=http://localhost:8090/realms/master/protocol/openid-connect/certs
5956

6057
# kafka
61-
6258
spring.kafka.consumer.properties.spring.json.use.type.headers=false
6359
spring.kafka.consumer.properties.spring.json.value.default.type=com.fasterxml.jackson.databind.JsonNode
6460

6561
# metrics, prometheus & actuator
66-
6762
management.endpoints.web.base-path=/actuator
6863
management.endpoints.web.exposure.include=*
6964
management.endpoint.health.show-details=always
7065
management.endpoint.metrics.enabled=true
7166
management.endpoint.prometheus.enabled=true
7267

7368
# swagger
74-
7569
springdoc.api-docs.enabled=true
7670
springdoc.api-docs.path=/v3/api-docs
7771
springdoc.swagger-ui.path=/swagger-ui.html
7872

7973
# resilience4j
80-
8174
resilience4j.circuitbreaker.metrics.enabled=true
8275
resilience4j.retry.metrics.enabled=true
8376
resilience4j.ratelimiter.metrics.enabled=true
8477

78+
## observation & zipkin
79+
management.tracing.enabled=true
80+
management.zipkin.tracing.endpoint=http://localhost:9411/api/v2/spans
81+
management.tracing.sampling.probability=1.0
82+
management.tracing.propagation.consume=b3
83+
management.tracing.propagation.produce=b3
84+
management.tracing.propagation.type=b3
85+
86+
spring.kafka.template.observation-enabled=true
87+
spring.kafka.listener.observation-enabled=true
88+
management.tracing.baggage.correlation.enabled=true
89+
management.tracing.baggage.enabled=true
90+
management.tracing.baggage.correlation.fields=spanId,traceId
91+
92+
management.otlp.metrics.export.enabled=true

0 commit comments

Comments
 (0)