Skip to content

Commit

Permalink
feat: add tracing to all services
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Jul 14, 2024
1 parent d14c218 commit a9475b2
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
2 changes: 0 additions & 2 deletions api-gateway/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ dependencies {
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.springframework.security:spring-security-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// https://mvnrepository.com/artifact/io.micrometer/micrometer-tracing-bridge-otel
implementation("io.micrometer:micrometer-tracing-bridge-otel:1.3.2")
// https://mvnrepository.com/artifact/io.opentelemetry/opentelemetry-exporter-zipkin
implementation("io.opentelemetry:opentelemetry-exporter-zipkin:1.40.0")


Expand Down
2 changes: 2 additions & 0 deletions photo-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ dependencies {
annotationProcessor("org.projectlombok:lombok:1.18.32")
implementation("com.github.f4b6a3:ulid-creator:5.2.3")
implementation("io.awspring.cloud:spring-cloud-starter-aws:2.4.4")
implementation("io.micrometer:micrometer-tracing-bridge-otel:1.3.2")
implementation("io.opentelemetry:opentelemetry-exporter-zipkin:1.40.0")
}

tasks.withType<Test> {
Expand Down
12 changes: 10 additions & 2 deletions photo-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring:
application:
name: mafoo-photo-service
name: photo-service
r2dbc:
url: ${MYSQL_URL}
username: ${MYSQL_USERNAME}
Expand All @@ -23,4 +23,12 @@ cloud:
static: kr-standard
s3:
endpoint: https://kr.object.ncloudstorage.com
bucket: ${NCP_BUCKET}
bucket: ${NCP_BUCKET}

management:
tracing:
sampling:
probability: 1.0
zipkin:
tracing:
endpoint: http://zipkin/api/v2/spans
2 changes: 2 additions & 0 deletions user-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ dependencies {
runtimeOnly("io.jsonwebtoken:jjwt-jackson:$jjwtVersion")

implementation("io.projectreactor.tools:blockhound:1.0.9.RELEASE")
implementation("io.micrometer:micrometer-tracing-bridge-otel:1.3.2")
implementation("io.opentelemetry:opentelemetry-exporter-zipkin:1.40.0")
}

tasks.withType<Test>().all {
Expand Down
10 changes: 9 additions & 1 deletion user-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring:
application:
name: mafoo-user-service
name: user-service
flyway:
url: ${FLYWAY_URL}
baseline-on-migrate: true
Expand All @@ -26,3 +26,11 @@ app:
expiration:
access-token: 2592000 # 30 days
refresh-token: 2592000 # 30 days

management:
tracing:
sampling:
probability: 1.0
zipkin:
tracing:
endpoint: http://zipkin/api/v2/spans

0 comments on commit a9475b2

Please sign in to comment.