Skip to content

Commit

Permalink
Merge pull request #60 from JavatoDev-com/57-zipkin-setup-for-distrbu…
Browse files Browse the repository at this point in the history
…ted-tracing

57 zipkin setup for distrbuted tracing
  • Loading branch information
chinthaka-dinadasa authored May 16, 2024
2 parents b45b726 + 06c716d commit b930cea
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 6 deletions.
8 changes: 7 additions & 1 deletion core-banking-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ ext {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'

//SPRING BOOT - TRACING
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
implementation 'io.github.openfeign:feign-micrometer'


//SPRING CLOUD CONFIG
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
Expand Down
86 changes: 86 additions & 0 deletions docker-compose/docker-compose-support-apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
version: '3.6'

services:

zipkin:
image: openzipkin/zipkin:3
ports:
- 9411:9411
networks:
javatodev_ib_network:
ipv4_address: 172.25.0.12

keycloak_web:
image: quay.io/keycloak/keycloak:23.0.7
container_name: keycloak_web
environment:
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://keycloakdb:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: password
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: password
command: ["start-dev", "--import-realm"]
depends_on:
- keycloakdb
ports:
- 8080:8080
volumes:
- ./keycloak:/opt/keycloak/data/import
networks:
javatodev_ib_network:
ipv4_address: 172.25.0.11

keycloakdb:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
networks:
javatodev_ib_network:
ipv4_address: 172.25.0.10

mysql_core_db:
build: mysql
container_name: mysql_javatodev_app
environment:
MYSQL_ROOT_PASSWORD: woVERANKliGharym
ports:
- 3306:3306
volumes:
- mysqldata:/var/lib/mysql
networks:
javatodev_ib_network:
ipv4_address: 172.25.0.9

internet-banking-config-server:
image: javatodev/internet-banking-config-server
ports:
- 8090:8090
networks:
javatodev_ib_network:
ipv4_address: 172.25.0.8

internet-banking-service-registry:
image: javatodev/internet-banking-service-registry
ports:
- 8081:8081
networks:
javatodev_ib_network:
ipv4_address: 172.25.0.7

volumes:
postgres_data:
mysqldata:

networks:
javatodev_ib_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.25.0.0/16
gateway: 172.25.0.1
9 changes: 9 additions & 0 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
version: '3.6'

services:

zipkin:
image: openzipkin/zipkin:3
ports:
- 9411:9411
networks:
javatodev_ib_network:
ipv4_address: 172.25.0.12

keycloak_web:
image: quay.io/keycloak/keycloak:23.0.7
container_name: keycloak_web
Expand Down
7 changes: 6 additions & 1 deletion internet-banking-api-gateway/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ ext {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'

//SPRING BOOT - TRACING
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
implementation 'io.github.openfeign:feign-micrometer'

//SPRING CLOUD CONFIG
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
Expand Down
7 changes: 6 additions & 1 deletion internet-banking-fund-transfer-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@ ext {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'

//SPRING BOOT - TRACING
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
implementation 'io.github.openfeign:feign-micrometer'

//SPRING CLOUD CONFIG
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
Expand Down
7 changes: 6 additions & 1 deletion internet-banking-user-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ ext {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'

//SPRING BOOT - TRACING
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
implementation 'io.github.openfeign:feign-micrometer'

//Open feign
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'io.github.openfeign:feign-okhttp:13.2.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.javatodev.finance.model.dto;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class User extends AuditAware {
private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
@RequiredArgsConstructor
public class KeycloakUserService {

private static final Logger log = LoggerFactory.getLogger(KeycloakUserService.class);
private final KeycloakManager keyCloakManager;

public Integer createUser(UserRepresentation userRepresentation) {
Expand Down
8 changes: 7 additions & 1 deletion internet-banking-utility-payment-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ ext {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'

//SPRING BOOT - TRACING
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
implementation 'io.github.openfeign:feign-micrometer'

//SPRING CLOUD CONFIG
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
Expand Down

0 comments on commit b930cea

Please sign in to comment.