-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Micrometer Tracing Example #110
Conversation
Signed-off-by: Adrian Cole <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notes
@@ -63,6 +63,10 @@ Here are the example projects you can try: | |||
* Trace Instrumentation: [WebFlux Server](https://github.com/spring-cloud/spring-cloud-sleuth/blob/2.2.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/TraceWebFilter.java), [WebFlux Client](https://github.com/spring-cloud/spring-cloud-sleuth/blob/2.2.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/TraceWebClientBeanPostProcessor.java), [Reactor Context](https://github.com/spring-cloud/spring-cloud-sleuth/blob/2.2.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/ScopePassingSpanSubscriber.java), [SLF4J](https://github.com/openzipkin/brave/tree/master/context/slf4j) | |||
* Trace Configuration: [Spring Cloud Sleuth](https://github.com/spring-cloud/spring-cloud-sleuth/tree/2.2.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/autoconfig) [Properties](webflux5-sleuth/src/main/resources/application.properties) | |||
|
|||
* [webflux6-micrometer](webflux6-micrometer) `BRAVE_EXAMPLE=webflux6-micrometer docker-compose up` | |||
* Runtime: Spring 6, Reactor Netty, Spring Boot 3, Micrometer, Log4J 2, JRE 21 | |||
* Trace Configuration: [Spring Boot Actuator](https://github.com/spring-projects/spring-boot/blob/3.2.x/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/TracingProperties.java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normally I add a 'Trace Instrumentation' section with links as you can see above, but this time, I have no idea where they are! Also, I don't see any canonical page on properties in docs, so I'm referencing the java type directly.
DOCKER_PARENT_IMAGE=ghcr.io/openzipkin/java:11.0.22_p7-jre | ||
;; | ||
17 ) | ||
DOCKER_BUILD_IMAGE=ghcr.io/openzipkin/java:21.0.2_p13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to parameterize this as spring boot requires minimal JRE 17.. the first project to require this.
level: | ||
root: INFO | ||
pattern: | ||
# Note: Logs don't appear to have any correlation fields assigned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope log correlation isn't a w3c only thing.. I perused a bunch of github issues and seems people have been steered towards w3c, but I don't know if that's just because maintainers like it more, or if logic hasn't been stitched together to make normal brave work like before (even spring 2.5 can do this). @shakuzen if you know the scoop lemme know!
# Note: There is no property to bind ${brave.traceId128Bit:false} | ||
span-joining-supported: ${brave.supportsJoin:true} | ||
sampling: | ||
# There doesn't seem to be a way to skip tracing /health by property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the exact same project as webflux5-sleuth, except for micrometer. As always, the style is intentionally like other projects here for easy maintenance, even if it isn't how start.spring.io would do it.
This is more glitchy that sleuth.. for example, the log correlation doesn't work, and some properties are missing. It is also rev-locked until the next release of micrometer. That said, it performs the basics, and is a good start!