You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Important note: This issue is only about client calls, because even though this is also useful for server logs, there is currently an issue for server logs here
Currently, in order to have the MDC logged inside Spring WebClient request/response logs, when using logbook-logstash, it is necessary to wrap the LogbookClientHandler with a custom ChannelDuplexHandler
This change would make it easier to configure context propagation when using Logbook Netty with Spring Webflux.
Logging MDC context in logstash logs is particularly useful when combined with tool like Datadog, which natively parses JSON formatted logs and extracts event attributes as facets. When using observation library like micrometer-tracing, it is then as easy as adding a baggage before calling the logger. This baggage is then available in Datadog as an Event Attribute.
Possible Implementation
Maybe add a property like logbook.context-propagation: true which when enabled, instrumentate the WebClient to propagate the MDC context to be logged inside WebClient.
Detailed Description
Important note: This issue is only about client calls, because even though this is also useful for server logs, there is currently an issue for server logs here
Currently, in order to have the MDC logged inside Spring
WebClient
request/response logs, when usinglogbook-logstash
, it is necessary to wrap theLogbookClientHandler
with a customChannelDuplexHandler
Context
This change would make it easier to configure context propagation when using Logbook Netty with Spring Webflux.
Logging MDC context in logstash logs is particularly useful when combined with tool like Datadog, which natively parses JSON formatted logs and extracts event attributes as facets. When using observation library like micrometer-tracing, it is then as easy as adding a baggage before calling the logger. This baggage is then available in Datadog as an Event Attribute.
Possible Implementation
Maybe add a property like
logbook.context-propagation: true
which when enabled, instrumentate the WebClient to propagate the MDC context to be logged inside WebClient.Your Environment
Sample available here
The text was updated successfully, but these errors were encountered: