Skip to content

shakuzen/spring-boot-3-tracing-coroutine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot 3 Micrometer Tracing with Kotlin Coroutines

Description

This project is an attempt of using Micrometer Tracing combined with the following technologies:

This might also be useful for those migrating Spring Boot 2 & Spring Sleuth to Spring Boot 3 which has breaking changes about tracing.

The aim is to manage to have standard baggage (traceId and spanId) and custom baggage (myBaggageFilter and myBaggageController) logged in every single log of the application.

Below are a list of issues related to this mechanism not working properly:

How to test the application

Run ./gradlew bootRun then call the local server depending on the behavior you want to test:

Simple

This will test the following behavior:

  1. Write a log in the controller
  2. Make a webClient call

curl --location 'http://localhost:8080/simple' --header 'Authorization: Basic dXNlcjp1c2Vy'

Suspend

This will test the following behavior:

  1. Simulate some delay inside the coroutine so that kotlin suspends the function then resume it
  2. Write a log in the controller
  3. Make a webClient call

curl --location 'http://localhost:8080/suspend' --header 'Authorization: Basic dXNlcjp1c2Vy'

Coroutine

This will test the following behavior:

  1. Start a new coroutine
  2. Write a log in the controller
  3. Make a webClient call

curl --location 'http://localhost:8080/coroutine' --header 'Authorization: Basic dXNlcjp1c2Vy'

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%