From 1bc63bbe2a68e2cf191a4ce54449a45ffe7281bf Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 16 Apr 2020 16:39:17 +0200 Subject: [PATCH 1/2] Add observability support with wavefront --- pom.xml | 31 +++++++++++++++++++++++ src/main/resources/application.properties | 3 +++ 2 files changed, 34 insertions(+) diff --git a/pom.xml b/pom.xml index 4941843..befe217 100644 --- a/pom.xml +++ b/pom.xml @@ -30,6 +30,8 @@ 0.8.5 0.0.4.RELEASE 0.0.25 + 2020.0.0 + 2.1.0-RC1 @@ -114,6 +116,16 @@ + + + com.wavefront + wavefront-spring-boot-starter + + + org.springframework.cloud + spring-cloud-starter-sleuth + + org.springframework.boot spring-boot-devtools @@ -121,6 +133,25 @@ + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + com.wavefront + wavefront-spring-boot-bom + ${wavefront.version} + pom + import + + + + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 4d4784e..9d994f8 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -23,3 +23,6 @@ logging.level.org.springframework=INFO # Maximum time static resources should be cached spring.resources.cache.cachecontrol.max-age=12h + +spring.application.name=spring-petclinic +wavefront.application.name=spring-demos From bf0452d6f2df564c6bb1cafecd0f6893473de3c5 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 5 May 2020 16:26:01 +0200 Subject: [PATCH 2/2] Add datasource instrumentation --- pom.xml | 4 ++++ src/main/resources/application-mysql.properties | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index befe217..f6fe594 100644 --- a/pom.xml +++ b/pom.xml @@ -125,6 +125,10 @@ org.springframework.cloud spring-cloud-starter-sleuth + + io.zipkin.brave + brave-instrumentation-mysql8 + org.springframework.boot diff --git a/src/main/resources/application-mysql.properties b/src/main/resources/application-mysql.properties index d388c9e..f572459 100644 --- a/src/main/resources/application-mysql.properties +++ b/src/main/resources/application-mysql.properties @@ -1,6 +1,6 @@ # database init, supports mysql too database=mysql -spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/petclinic} +spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/petclinic?serverTimezone=UTC&queryInterceptors=brave.mysql8.TracingQueryInterceptor&exceptionInterceptors=brave.mysql8.TracingExceptionInterceptor} spring.datasource.username=${MYSQL_USER:petclinic} spring.datasource.password=${MYSQL_PASS:petclinic} # SQL is written to be idempotent so this is safe