spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

First pass on Observability support

Open marcingrzejszczak opened this issue 2 years ago • 2 comments

marcingrzejszczak avatar Aug 26 '22 15:08 marcingrzejszczak

How does relate to spring cloud sleuth?

tony-clarke-amdocs avatar Aug 26 '22 15:08 tony-clarke-amdocs

Only indirectly as the new micrometer functionality replaces sleuth

spencergibb avatar Aug 26 '22 16:08 spencergibb

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 ?

proteintogo avatar Jan 26 '23 10:01 proteintogo

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 avatar Jan 26 '23 13:01 marcingrzejszczak

@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.

taxone avatar May 04 '23 08:05 taxone