Skip to content

Sample demonstrating use of sleuth tracing with a Spring Webflux application

Notifications You must be signed in to change notification settings

kandyjam/sleuth-webflux-sample

 
 

Repository files navigation

A sample demonstrating Spring Cloud Sleuth 2 with Zipkin

This is a sample set of apps that demonstrates how tracing information carries over from a client app to a service app and then gets aggregated into Zipkin UI

Using Docker

First create the images for all apps using

./gradlew createDockerImage

and then

docker-compose up

The application helper UI to send sample requests via the Client-App to the service app will be available at http://<dockerip>:8080

Zipkin UI will be at http://<dockerip>:9411 Graphana at http://<dockerip>:3000 and Prometheus at http://<dockerip>:3000

Without Docker

Start Zipkin

Start RabbitMQ first

rabbitmq-server

Start Zipkin integrated with RabbitMQ:

curl -sSL https://zipkin.io/quickstart.sh | bash -s

Once Zipkin jar is downloaded, run it this way:

RABBIT_ADDRESSES=localhost java -jar zipkin.jar

Client App

./gradlew -p applications/sample-client-app clean bootRun

Sample Service App

./gradlew -p applications/sample-service-app clean bootRun

Testing

Assuming that httpie is installed

http POST 'http://localhost:8080/passthrough/messages' id="1" payload="one"   delay="1000"

OR with CURL

curl -X "POST" "http://localhost:8080/passthrough/messages" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d $'{
  "id": "1",
  "payload": "one",
  "delay": "1000"
}'

Trace information should get logged into the console and end up in Zipkin UI available at http://localhost:9411

Generating load

A gatling based load can be sent to the app using:

./gradlew -p applications/load-scripts  -DTARGET_URL=http://localhost:8080 -DSIM_USERS=50 gatlingRun

About

Sample demonstrating use of sleuth tracing with a Spring Webflux application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.3%
  • TypeScript 0.3%
  • Kotlin 0.3%
  • HTML 0.1%
  • Scala 0.0%
  • CSS 0.0%