spring-cloud-gateway
spring-cloud-gateway copied to clipboard
First pass on Observability support
How does relate to spring cloud sleuth?
Only indirectly as the new micrometer functionality replaces sleuth
I added the following dependency micrometer-tracing-bridge-brave
along with spring-cloud-starter-gateway
:
Configured the logging.pattern.level=%clr(%5p) %clr([TraceId=%X{traceId:-},SpanId=%X{spanId:-}]){green}
But when I log any message, no traceId/SpanId is completed. Should I do any additional step/configuration ?
Check this doc https://micrometer.io/docs/observation#instrumentation_of_reactive_libraries and if you don't want to do anything manually you have to wait until we patch reactor and boot to support this out of the box
@marcingrzejszczak I added;
Hooks.enableAutomaticContextPropagation();
but traceIds do not appear in the logs. I created a sample project to reproduce. Any help would be much appreciated, thanks in advance.