Skip to content

Commit 05e4218

Browse files
committed
Updated screenshots with latest version of Zipkin, polished samples
1 parent b83f62d commit 05e4218

10 files changed

+33
-14
lines changed

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![Build status](https://github.com/gavlyukovskiy/spring-boot-data-source-decorator/workflows/Build/badge.svg)
44
[![Latest release](https://img.shields.io/badge/dynamic/xml.svg?label=Maven%20Central&color=green&query=%2F%2Fmetadata%2Fversioning%2Flatest&url=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Fgithub%2Fgavlyukovskiy%2Fdatasource-decorator-spring-boot-autoconfigure%2Fmaven-metadata.xml)](https://mvnrepository.com/artifact/com.github.gavlyukovskiy/datasource-decorator-spring-boot-autoconfigure/)
55

6-
Spring Boot auto-configuration for integration with
6+
[Spring Boot](https://github.com/spring-projects/spring-boot) auto-configuration for integration with
77
* [P6Spy](https://github.com/p6spy/p6spy) - adds ability to intercept and log sql queries, including interception of a most `Connection`, `Statement` and `ResultSet` methods invocations
88
* [Datasource Proxy](https://github.com/ttddyy/datasource-proxy) - adds ability to intercept all queries and `Connection`, `Statement` and `ResultSet` method calls
99
* [FlexyPool](https://github.com/vladmihalcea/flexy-pool) - adds connection pool metrics (jmx, codahale, dropwizard) and flexible strategies for adjusting pool size on demand
@@ -254,7 +254,7 @@ decorator.datasource.flexy-pool.threshold.connection.lease=1000
254254

255255
#### Spring Cloud Sleuth
256256

257-
P6Spy or Datasource Proxy allows to create spans on various jdbc events:
257+
P6Spy and Datasource Proxy allow to create spans on various jdbc events:
258258
* `jdbc:/<dataSource>/connection` - opening connection including events for commits and rollbacks
259259
* `jdbc:/<dataSource>/query` - executing query including sql text and number of affected rows in the tags
260260
* `jdbc:/<dataSource>/fetch` - fetching result set data including number of rows in the tags
@@ -263,20 +263,32 @@ You can configure the tracing with the following properties:
263263
```properties
264264
# Creates span for every connection and query. Works only with p6spy or datasource-proxy.
265265
decorator.datasource.sleuth.enabled=true
266-
# Specify traces that will be created in zipkin
266+
# Specify traces that will be created in tracing system (see screenshots)
267267
decorator.datasource.sleuth.include=connection, query, fetch
268268
```
269+
##### ~~Pizza~~ Demo time
270+
All screenshots were taken using [Spring PetClinic](https://github.com/spring-petclinic/spring-petclinic-rest) with [Zipkin](https://github.com/openzipkin/zipkin) backend, but other tracing systems are supported through Spring Cloud Sleuth/Brave.
269271

270-
Example request:
271-
![Zipkin traces](images/zipkin.png)
272+
Request span with jdbc tracing:
273+
![Request trace with jdbc screenshot](images/zipkin.png)
272274

273-
Details of connection span:
274-
![Connection span details](images/connection-span.png)
275+
Connection:
276+
![Connection screenshot](images/connection-span.png)
275277

276-
Details of query span:
277-
![Query span details](images/query-span.png)
278+
Connection that was rolled back:
279+
![Connection that was rolled back screenshot](images/connection-span-rollback.png)
278280

279-
![Error query span details](images/query-span-error.png)
281+
Connection that was closed on database side:
282+
![Connection that was closed on database side screenshot](images/connection-span-error.png)
283+
284+
Query:
285+
![Query screenshot](images/query-span.png)
286+
287+
Query with error:
288+
![Query with error screenshot](images/query-span-error.png)
289+
290+
Fetch:
291+
![Fetch screenshot](images/fetch-span.png)
280292

281293
#### Custom Decorators
282294

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ subprojects {
161161
}
162162

163163
if (project.name.contains("sample")) {
164-
tasks.build {
164+
tasks.compileJava {
165165
dependsOn(":datasource-decorator-spring-boot-autoconfigure:publishToMavenLocal")
166166
dependsOn(":datasource-proxy-spring-boot-starter:publishToMavenLocal")
167167
dependsOn(":flexy-pool-spring-boot-starter:publishToMavenLocal")

images/connection-span-error.png

122 KB
Loading
102 KB
Loading

images/connection-span.png

-33.7 KB
Loading

images/fetch-span.png

169 KB
Loading

images/query-span-error.png

-55.7 KB
Loading

images/query-span.png

-4.31 KB
Loading

images/zipkin.png

-214 KB
Loading

samples/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,24 @@ Run sample application on port 8081 with next endpoints:
1313
./gradlew :samples:p6spy-sample:bootRun
1414
```
1515

16-
add `--args='--spring.profiles.active=zipkin'` if you have [Zipkin](https://github.com/openzipkin/zipkin) running on port 9411 (e.g via `docker run -p 9411:9411 openzipkin/zipkin`)
16+
or with [Zipkin](https://github.com/openzipkin/zipkin):
17+
```
18+
docker run -p 9411:9411 openzipkin/zipkin
19+
./gradlew :samples:p6spy-sample:bootRun --args='--spring.profiles.active=zipkin'
20+
```
1721

1822
**Datasource Proxy**
1923
```
2024
./gradlew :samples:datasource-proxy-sample:bootRun
2125
```
2226

23-
add `--args='--spring.profiles.active=zipkin'` if you have [Zipkin](https://github.com/openzipkin/zipkin) running on port 9411
27+
or with [Zipkin](https://github.com/openzipkin/zipkin):
28+
```
29+
docker run -p 9411:9411 openzipkin/zipkin
30+
./gradlew :samples:datasource-proxy-sample:bootRun --args='--spring.profiles.active=zipkin'
31+
```
2432

2533
**FlexyPool**
2634
```
2735
./gradlew :samples:flexy-pool-sample:bootRun
2836
```
29-

0 commit comments

Comments
 (0)